/* ===========================
   ADMIN & ÁREA DO APRENDIZ STYLES
   =========================== */

/* ===========================
   LOGIN SCREEN
   =========================== */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--secondary) 100%);
    padding: 20px;
}

.login-card {
    max-width: 420px;
    width: 100%;
    padding: 48px 40px;
    text-align: center;
    border-radius: 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-2xl);
}

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
}

.login-card h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.login-card > p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.login-form .form-group {
    text-align: left;
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--bg-tertiary);
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color var(--transition-base);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 0.9rem;
}

.back-link {
    display: inline-block;
    margin-top: 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-base);
}

.back-link:hover {
    color: var(--primary);
}

/* ===========================
   ADMIN PANEL
   =========================== */
.admin-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--bg-tertiary);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.admin-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.admin-brand h2 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary);
}

.admin-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===========================
   ADMIN TABS
   =========================== */
.admin-tabs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px 0;
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--bg-tertiary);
    overflow-x: auto;
}

.admin-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-base);
    white-space: nowrap;
    font-family: inherit;
}

.admin-tab:hover {
    color: var(--primary);
}

.admin-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.admin-tab svg {
    flex-shrink: 0;
}

/* ===========================
   ADMIN CONTENT
   =========================== */
.admin-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-section-header h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* ===========================
   ADMIN FORM CARD
   =========================== */
.admin-form-card {
    padding: 28px;
    margin-bottom: 24px;
    border-radius: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.admin-form-card h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.admin-form-card .form-group {
    margin-bottom: 16px;
}

.admin-form-card label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.admin-form-card input,
.admin-form-card select,
.admin-form-card textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--bg-tertiary);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color var(--transition-base);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
}

.admin-form-card input:focus,
.admin-form-card select:focus,
.admin-form-card textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.admin-form-card input[type="file"] {
    padding: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding-top: 28px;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    accent-color: var(--primary);
}

/* ===========================
   ADMIN FILTERS
   =========================== */
.admin-filters {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.admin-filters label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.admin-filters select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--bg-tertiary);
    border-radius: 10px;
    font-size: 0.95rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
}

/* ===========================
   ADMIN TABLE
   =========================== */
.admin-table {
    overflow-x: auto;
    border-radius: 12px;
    margin-bottom: 20px;
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.admin-table thead th {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--bg-tertiary);
    font-size: 0.9rem;
    color: var(--text-primary);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: var(--bg-secondary);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.actions-cell {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.turma-curso-title {
    font-size: 1rem;
    color: var(--primary);
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bg-tertiary);
}

/* ===========================
   BADGES
   =========================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-ativo {
    background: #dcfce7;
    color: #16a34a;
}

.badge-inativo {
    background: #fee2e2;
    color: #dc2626;
}

.badge-palestra { background: #ede9fe; color: #7c3aed; }
.badge-curso { background: #dbeafe; color: #2563eb; }
.badge-evanginfantil { background: #fef3c7; color: #d97706; }
.badge-estudo { background: #d1fae5; color: #059669; }
.badge-evento { background: #fce7f3; color: #db2777; }
.badge-outro { background: #f3f4f6; color: #6b7280; }

/* ===========================
   ICON BUTTONS
   =========================== */
.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-edit {
    background: #ede9fe;
    color: #7c3aed;
}

.btn-edit:hover {
    background: #7c3aed;
    color: white;
}

.btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-delete:hover {
    background: #dc2626;
    color: white;
}

/* ===========================
   BUTTON VARIANTS
   =========================== */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ===========================
   UPLOAD PROGRESS
   =========================== */
.upload-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

#progressText {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 40px;
}

/* ===========================
   STATES
   =========================== */
.empty-state,
.error-state,
.loading-spinner {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.error-state {
    color: #dc2626;
}

.loading-spinner {
    color: var(--primary);
}

.file-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.file-link:hover {
    text-decoration: underline;
}

/* ===========================
   ADMIN NOTIFICATION
   =========================== */
.admin-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10000;
    animation: slideInRight 0.4s ease;
    box-shadow: var(--shadow-xl);
}

.admin-notification-success {
    background: #16a34a;
    color: white;
}

.admin-notification-error {
    background: #dc2626;
    color: white;
}

.admin-notification.fade-out {
    animation: slideOutRight 0.4s ease forwards;
}

@keyframes slideInRight {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(400px); opacity: 0; }
}

/* ===========================
   ÁREA DO APRENDIZ
   =========================== */
.aprendiz-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding: 20px 0;
    color: white;
}

.aprendiz-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.aprendiz-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: white;
}

.aprendiz-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.aprendiz-brand h1 {
    font-size: 1.3rem;
    margin: 0;
}

.aprendiz-brand span {
    font-size: 0.85rem;
    opacity: 0.8;
}

.aprendiz-header .btn-outline {
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.aprendiz-header .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.aprendiz-main {
    min-height: calc(100vh - 200px);
    padding: 32px 0;
    background: var(--bg-secondary);
}

/* ===========================
   APRENDIZ INTRO
   =========================== */
.aprendiz-intro {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px 32px;
    margin-bottom: 32px;
    border-radius: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.aprendiz-intro-icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.aprendiz-intro h2 {
    font-size: 1.3rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.aprendiz-intro p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

/* ===========================
   APRENDIZ FILTERS
   =========================== */
.aprendiz-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.filter-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--bg-tertiary);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color var(--transition-base);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===========================
   CURSOS GRID (Aprendiz)
   =========================== */
.cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.curso-card {
    padding: 28px;
    border-radius: 16px;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.curso-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.curso-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: white;
}

.curso-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.curso-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.curso-card-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===========================
   TURMAS GRID (Aprendiz)
   =========================== */
.turmas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.turma-select-card {
    padding: 24px;
    border-radius: 14px;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-base);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
}

.turma-select-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.turma-select-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--primary);
}

.turma-select-card h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.turma-ano {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ===========================
   MATERIAIS HEADER (Aprendiz)
   =========================== */
.materiais-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.materiais-header h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.materiais-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* ===========================
   MATERIAIS GRID (Aprendiz)
   =========================== */
.materiais-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.material-card {
    padding: 24px;
    border-radius: 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    transition: all var(--transition-base);
}

.material-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.material-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.material-icon {
    flex-shrink: 0;
}

.material-meta {
    display: flex;
    gap: 8px;
}

.material-ext {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.material-size {
    font-size: 0.8rem;
    color: var(--text-light);
}

.material-card h4 {
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.material-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 16px;
    line-height: 1.4;
}

.material-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.material-date {
    font-size: 0.8rem;
    color: var(--text-light);
}

.material-card-footer .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ===========================
   APRENDIZ FOOTER
   =========================== */
.aprendiz-footer {
    background: var(--text-primary);
    color: rgba(255, 255, 255, 0.6);
    padding: 24px 0;
    text-align: center;
    font-size: 0.85rem;
}

.aprendiz-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.aprendiz-footer .heart-icon {
    fill: #e74c3c;
    vertical-align: middle;
}

/* ===========================
   DARK MODE SUPPORT
   =========================== */
.dark-mode .login-card,
.dark-mode .admin-form-card,
.dark-mode .admin-filters,
.dark-mode .aprendiz-intro,
.dark-mode .curso-card,
.dark-mode .turma-select-card,
.dark-mode .material-card {
    background: rgba(30, 30, 50, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .admin-header {
    background: var(--text-primary);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .admin-table thead th {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
}

.dark-mode .admin-table tbody td {
    border-bottom-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.dark-mode .admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dark-mode .admin-form-card input,
.dark-mode .admin-form-card select,
.dark-mode .admin-form-card textarea,
.dark-mode .filter-group select,
.dark-mode .admin-filters select {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.dark-mode .error-message {
    background: rgba(220, 38, 38, 0.1);
}

.dark-mode .aprendiz-main {
    background: #0f0f1a;
}

.dark-mode .badge-ativo {
    background: rgba(22, 163, 74, 0.1);
}

.dark-mode .badge-inativo {
    background: rgba(220, 38, 38, 0.1);
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
    .admin-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .admin-email {
        display: none;
    }

    .admin-tabs {
        padding: 12px 16px 0;
    }

    .admin-tab {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .admin-tab svg {
        display: none;
    }

    .admin-content {
        padding: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .aprendiz-filters {
        grid-template-columns: 1fr;
    }

    .aprendiz-intro {
        flex-direction: column;
        text-align: center;
    }

    .aprendiz-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .cursos-grid {
        grid-template-columns: 1fr;
    }

    .materiais-grid {
        grid-template-columns: 1fr;
    }

    .turmas-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .login-card {
        padding: 32px 24px;
    }

    .checkbox-label {
        padding-top: 0;
    }
}
