/**
 * Evo Academy — Components CSS
 * Botões, badges, cards, progress bars, modais, formulários, toast, dropdown
 */

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    border: none;
}
.btn-primary:hover {
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--border-light);
    color: var(--text);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-back {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-light);
    border: 1px solid rgba(34, 197, 94, 0.25);
    font-weight: 600;
    gap: 6px;
}
.btn-back:hover {
    background: rgba(34, 197, 94, 0.18);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}
.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}
.btn-full {
    width: 100%;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.badge-accent {
    background: var(--accent-glow);
    color: var(--accent);
}
.badge-green {
    background: var(--green-glow);
    color: var(--green);
}
.badge-yellow {
    background: var(--yellow-glow);
    color: var(--yellow);
}
.badge-red {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red);
}
.badge-tag {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s ease;
}
.card:hover {
    border-color: var(--border-light);
}
.card-clickable {
    cursor: pointer;
}
.card-clickable:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--shadow);
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}
.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
    background: var(--accent-glow);
}
.stat-card-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text);
}
.stat-card-label {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar-inner {
    height: 100%;
    background: var(--gradient);
    border-radius: 3px;
    transition: width 0.5s ease;
    min-width: 0;
}
.progress-bar-lg {
    height: 8px;
    border-radius: 4px;
}
.progress-bar-lg .progress-bar-inner {
    border-radius: 4px;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
}
.modal-overlay.hidden {
    display: none;
}
.modal-inner {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 80px var(--shadow);
    animation: dropIn 0.2s ease-out;
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}
.modal-close:hover {
    background: var(--bg-surface);
    color: var(--text);
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
}
.form-input:focus {
    border-color: var(--accent);
}
.form-input-with-icon {
    position: relative;
}
.form-input-with-icon .form-input {
    padding-right: 44px;
}
.form-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}
.form-input-icon:hover {
    color: var(--text);
}
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
    appearance: none;
    cursor: pointer;
}
.form-select:focus {
    border-color: var(--accent);
}
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 28px;
    border-radius: 12px;
    background: var(--green);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastFadeIn 0.25s ease-out;
}
@keyframes toastFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.toast.hidden {
    display: none;
}
.toast-error {
    background: var(--red);
}
.toast-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    margin-left: 8px;
    opacity: 0.7;
}
.toast-close:hover {
    opacity: 1;
}

/* ===== DROPDOWN ===== */
.dropdown {
    position: relative;
}
.dropdown-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    min-width: 200px;
    box-shadow: 0 12px 40px var(--shadow);
    z-index: 50;
    display: none;
    animation: dropIn 0.15s ease-out;
}
.dropdown-menu.open {
    display: block;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    text-decoration: none;
}
.dropdown-item:hover {
    background: var(--bg-surface);
    color: var(--text);
}
.dropdown-item-danger {
    color: var(--red);
}
.dropdown-item-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--red);
}
.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

/* ===== AVATAR ===== */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    background: var(--gradient);
    flex-shrink: 0;
    overflow: hidden;
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 11px;
}
.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 18px;
}
.avatar-xl {
    width: 96px;
    height: 96px;
    font-size: 28px;
}

/* ===== MATERIAL ITEM ===== */
.material-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s;
}
.material-item:hover {
    border-color: var(--border-light);
}
.material-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.material-icon-pdf { background: rgba(239, 68, 68, 0.12); color: var(--red); }
.material-icon-xlsx { background: rgba(34, 197, 94, 0.12); color: var(--green); }
.material-icon-docx { background: rgba(14, 165, 233, 0.12); color: var(--accent-teal); }
.material-icon-zip { background: rgba(234, 179, 8, 0.12); color: var(--yellow); }
.material-icon-default { background: var(--accent-glow); color: var(--accent); }

.material-info {
    flex: 1;
    min-width: 0;
}
.material-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.material-size {
    font-size: 11px;
    color: var(--text-dim);
}

/* ===== QUIZ OPTION ===== */
.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--text-muted);
}
.quiz-option:hover {
    border-color: var(--border-light);
    color: var(--text);
}
.quiz-option.selected {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--text);
}
.quiz-radio {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.quiz-option.selected .quiz-radio {
    border-color: var(--accent);
    background: var(--accent);
}
.quiz-option.selected .quiz-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-dim);
}
.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}
.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.empty-state-text {
    font-size: 13px;
}

/* ===== LOADING ===== */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
