:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --accent-color: #fbbf24;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-light: #f1f5f9;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: var(--bg-light);
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-lg);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-brand i {
    font-size: 1.75rem;
    color: var(--accent-color);
}

.sidebar.collapsed .sidebar-brand-text {
    display: none;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Stats Cards in Sidebar */
.sidebar-stats {
    padding: 1.25rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.stat-card-icon.primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-card-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-card-icon.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-card-icon.warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.stat-card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: white;
}

.sidebar.collapsed .stat-card-label,
.sidebar.collapsed .stat-card-value {
    display: none;
}

.sidebar.collapsed .stat-card {
    padding: 0.5rem;
    text-align: center;
}

.sidebar.collapsed .stat-card-icon {
    margin: 0 auto;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 1.25rem;
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 0.75rem;
    padding: 0 0.75rem;
    font-weight: 600;
}

.sidebar.collapsed .nav-section-title {
    display: none;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(4px);
}

.nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    background: var(--bg-light);
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

/* Top Bar */
.top-bar {
    background: white;
    padding: 1.25rem 2rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 1.5rem 2rem;
    margin: 1.5rem 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.filter-input {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.625rem 1rem;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.filter-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Content Area */
.content-area {
    padding: 0 2rem 2rem 2rem;
}

/* Loading Indicator */
.loading-container {
    background: white;
    border-radius: 16px;
    padding: 3rem 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.progress {
    height: 28px;
    border-radius: 14px;
    background: var(--bg-light);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), #3b82f6);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
}

/* Course Cards */
.course-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.course-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.course-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.meta-item i {
    color: var(--primary-color);
}

.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

.badge.bg-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #64748b, #475569) !important;
    color: white !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: white !important;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    color: white !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    color: white !important;
}

.btn-modern {
    border-radius: 10px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-modern.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-modern.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-modern.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-modern.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Classes List */
.classes-container {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
}

.class-item {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.class-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
    border-color: var(--primary-color);
}

.class-item:last-child {
    margin-bottom: 0;
}

.class-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

/* Modal Improvements */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 16px 16px 0 0;
    padding: 1.25rem 1.5rem;
    border: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-title {
    font-weight: 700;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: var(--bg-light);
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--bg-light);
}

.avatar-initials {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

/* Mobile Menu Toggle - OCULTO EN DESKTOP */
.mobile-menu-toggle {
    display: none;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.25rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-overlay.show {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .main-content.expanded {
        margin-left: 0;
    }

    .top-bar,
    .filters-section,
    .content-area {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .filters-section {
        margin: 1rem;
    }

    /* MOSTRAR botón móvil solo en pantallas pequeñas */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .page-subtitle {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .course-card {
        padding: 1rem;
    }

    .course-title {
        font-size: 1.1rem;
    }

    .btn-modern {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-card {
    animation: fadeIn 0.3s ease-out;
}

/* Mejoras de accesibilidad */
.btn-modern:focus,
.filter-input:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Scrollbar personalizado para todo el sitio */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
