:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #64748b;
    --bg-body: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.7);
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active-text: #ffffff;
    --sidebar-section-text: #64748b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    /* CEFR Colors */
    --cefr-a1: #10b981; /* Emerald */
    --cefr-a2: #fbbf24; /* Amber */
    --cefr-b1: #f97316; /* Orange */
    --cefr-b2: #3b82f6; /* Blue */
    --cefr-c1: #8b5cf6; /* Violet */
    --cefr-c2: #ef4444; /* Red */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

/* Glassmorphism Classes */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
}

.glass-dark {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
}

/* Login Page Styling */
.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    position: relative;
}

.login-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(15, 23, 42, 0.4));
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    z-index: 10;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    left: 0;
    top: 0;
    padding: 24px 16px;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-logo {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 40px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: var(--sidebar-text) !important;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
}

.sidebar-section-header {
    margin-top: 24px;
    margin-bottom: 8px;
    padding: 0 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sidebar-section-text) !important;
    opacity: 0.9;
}

.chevron-icon {
    transition: transform 0.3s ease;
}

[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

.sidebar-submenu a {
    padding: 10px 12px !important;
    font-size: 0.9rem !important;
}

/* Collapsed State Helpers */
.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .collapse.show {
    display: none !important;
}

.sidebar.collapsed .chevron-icon {
    display: none !important;
}

#sidebarToggle {
    border-radius: 8px;
    transition: background 0.2s;
}

#sidebarToggle:hover {
    background: var(--sidebar-hover);
}

.collapsed #sidebarToggle {
    margin: 0 auto;
}

.collapsed .sidebar-logo {
    justify-content: center !important;
    padding: 0 !important;
}

.collapsed .sidebar-logo .gap-3 {
    gap: 0 !important;
}

.collapsed .sidebar-menu a {
    justify-content: center;
    padding: 12px 0;
}

/* Mobile Responsive Styles */
@media (max-width: 767.98px) {
    .sidebar {
        left: -260px;
        width: 260px !important;
        box-shadow: none;
    }

    .sidebar.mobile-show {
        left: 0;
        box-shadow: 10px 0 30px rgba(0,0,0,0.2);
    }

    .content {
        margin-left: 0 !important;
        padding: 20px;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
        backdrop-filter: blur(4px);
    }

    .sidebar.mobile-show + .sidebar-overlay {
        display: block;
    }

    #sidebarToggle {
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 1001;
        background: var(--primary-color);
        color: white !important;
        border-radius: 50%;
        width: 45px;
        height: 45px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .sidebar.mobile-show #sidebarToggle {
        position: absolute;
        top: 24px;
        right: 16px;
        background: transparent;
        box-shadow: none;
    }
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background: var(--sidebar-hover);
    color: var(--sidebar-active-text) !important;
}

.sidebar-menu a.active {
    background: var(--primary) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Content Area Styling */
.content {
    margin-left: 260px;
    padding: 40px;
    min-height: 100vh;
}

/* Dashboard Cards */
.card-dashboard {
    padding: 24px;
    border: none;
    transition: transform 0.2s;
}

.card-dashboard:hover {
    transform: translateY(-5px);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 20px;
}

.bg-primary-soft { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.bg-success-soft { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.bg-warning-soft { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

/* Form Elements */
.form-control {
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-primary {
    background: var(--primary);
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Skeleton Loading Animation */
@keyframes skeleton-loading {
    0% { background-color: rgba(226, 232, 240, 0.4); }
    100% { background-color: rgba(203, 213, 225, 0.6); }
}

.skeleton-box {
    animation: skeleton-loading 1s linear infinite alternate;
    border-radius: 8px;
    height: 100%;
    width: 100%;
}

.is-loading .card-body, 
.is-loading .card-img-top,
.is-loading .bg-primary-soft {
    visibility: hidden;
}

.is-loading .card {
    position: relative;
    overflow: hidden;
}

.is-loading .card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: skeleton-loading 1s linear infinite alternate;
}

/* Loading Overlay */
#gen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.gen-loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(59, 130, 246, 0.2);
    border-bottom-color: #3b82f6;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.gen-text {
    font-family: 'Outfit', sans-serif;
    color: #1e293b;
    font-weight: 600;
    font-size: 1.2rem;
}
