:root {
            --primary-color: #4f46e5;
            --secondary-color: #e0e7ff;
            --sidebar-width: 260px;
            --sidebar-collapsed-width: 70px;
            --header-height: 60px;
            --transition-speed: 0.3s;
            --text-primary: #1f2937;
            --text-secondary: #6b7280;
            --bg-primary: #ffffff;
            --bg-secondary: #f8fafc;
        }

        .dark-mode {
            --primary-color: #6366f1;
            --secondary-color: #312e81;
            --text-primary: #f9fafb;
            --text-secondary: #d1d5db;
            --bg-primary: #1f2937;
            --bg-secondary: #111827;
        }
        .dark-mode .toggle-btn {
            background: var(--bg-primary);
            color: var(--primary-color);
        }

        /* Reset and base styles */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: var(--bg-secondary);
            color: var(--text-primary);
            transition: all var(--transition-speed) ease;
        }

        .dashboard-container {
            display: flex;
            min-height: 100vh;
        }

        /* Sidebar Styling */
        .sidebar {
            width: var(--sidebar-width);
            height: 100vh;
            background: linear-gradient(135deg, var(--primary-color), #7c3aed);
            color: white;
            position: fixed;
            left: 0;
            top: 0;
            transition: width var(--transition-speed) cubic-bezier(0.25, 0.46, 0.45, 0.94);
            overflow: hidden;
            box-shadow: 4px 0 20px rgba(0,0,0,0.1);
            z-index: 1000;
        }

        .sidebar.collapsed {
            width: var(--sidebar-collapsed-width);
        }

        .sidebar-header {
            padding: 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            min-height: 80px;
        }

        .logo {
            font-size: 28px;
            flex-shrink: 0;
            background: rgba(255,255,255,0.2);
            width: 40px;
            height: 40px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .logo-text {
            font-size: 22px;
            font-weight: bold;
            opacity: 1;
            transition: opacity var(--transition-speed) ease;
            white-space: nowrap;
        }

        .sidebar.collapsed .logo-text {
            opacity: 0;
            width: 0;
            overflow: hidden;
        }

        /* Navigation */
        .nav-menu {
            list-style: none;
            padding: 20px 0;
        }

        .nav-menu li {
            margin: 2px 0;
        }

        .nav-link {
            display: flex;
            align-items: center;
            padding: 16px 20px;
            color: rgba(255,255,255,0.9);
            text-decoration: none;
            transition: all var(--transition-speed) ease;
            position: relative;
            border-radius: 0 25px 25px 0;
            margin-right: 10px;
        }

        .nav-link:hover {
            background: rgba(255,255,255,0.1);
            color: white;
            transform: translateX(5px);
        }

        .nav-link.active {
            background: rgba(255,255,255,0.2);
            color: white;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        }

        .nav-link::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            height: 100%;
            width: 4px;
            background: white;
            transform: scaleY(0);
            transition: transform var(--transition-speed) ease;
            border-radius: 0 4px 4px 0;
        }

        .nav-link.active::before {
            transform: scaleY(1);
        }

        .nav-link .icon {
            font-size: 20px;
            margin-right: 15px;
            flex-shrink: 0;
            width: 24px;
            text-align: center;
            position: relative;
        }

        .nav-link .text {
            opacity: 1;
            transition: opacity var(--transition-speed) ease;
            font-weight: 500;
        }

        .sidebar.collapsed .nav-link .text {
            opacity: 0;
            width: 0;
            overflow: hidden;
        }

        .sidebar.collapsed .nav-link .icon {
            margin-right: 0;
        }

        /* Badge for notifications */
        .badge {
            position: absolute;
            top: -2px;
            right: -2px;
            background: #ef4444;
            color: white;
            border-radius: 50%;
            width: 16px;
            height: 16px;
            font-size: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
        }

        /* Tooltip for collapsed state */
        .nav-link::after {
            content: attr(data-tooltip);
            position: absolute;
            left: 70px;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(0,0,0,0.8);
            color: white;
            padding: 8px 12px;
            border-radius: 6px;
            font-size: 14px;
            white-space: nowrap;
            opacity: 0;
            visibility: hidden;
            transition: all var(--transition-speed) ease;
            z-index: 1002;
        }

        .sidebar.collapsed .nav-link:hover::after {
            opacity: 1;
            visibility: visible;
        }

        /* Toggle Button */
        .toggle-btn {
            position: absolute;
            top: 25px;
            right: -15px;
            width: 30px;
            height: 30px;
            background: var(--bg-primary);
            border: 2px solid var(--primary-color);
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            transition: all var(--transition-speed) ease;
            color: var(--primary-color);
        }

        .toggle-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(0,0,0,0.2);
        }

        .toggle-icon {
            transition: transform var(--transition-speed) ease;
            font-size: 14px;
            font-weight: bold;
        }

        .sidebar.collapsed .toggle-icon {
            transform: rotate(180deg);
        }

        /* Main Content */
        .main-content {
            margin-left: var(--sidebar-width);
            transition: margin-left var(--transition-speed) ease;
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        .sidebar.collapsed ~ .main-content {
            margin-left: var(--sidebar-collapsed-width);
        }

        .content-header {
            background: var(--bg-primary);
            padding: 20px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            border-bottom: 1px solid #e5e7eb;
        }

        .content-header h1 {
            font-size: 28px;
            color: var(--text-primary);
            margin: 0;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 15px;
            color: var(--text-secondary);
        }

        .dark-mode-toggle {
            background: var(--primary-color);
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 14px;
            transition: all var(--transition-speed) ease;
        }

        .dark-mode-toggle:hover {
            background: #3730a3;
            transform: translateY(-1px);
        }

        .content-area {
            padding: 30px;
            flex: 1;
            background: var(--bg-secondary);
        }

        /* Content Cards */
        .content-card {
            background: var(--bg-primary);
            padding: 25px;
            border-radius: 12px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.07);
            margin-bottom: 20px;
            border: 1px solid #e5e7eb;
            transition: all var(--transition-speed) ease;
        }

        .dark-mode .content-card {
            border-color: #374151;
        }

        .content-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(0,0,0,0.1);
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin: 20px 0;
        }

        .stat-card {
            background: linear-gradient(135deg, var(--primary-color), #7c3aed);
            color: white;
            padding: 20px;
            border-radius: 12px;
            text-align: center;
            box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
        }

        .stat-card h3 {
            font-size: 32px;
            margin-bottom: 5px;
        }

        .stat-card p {
            opacity: 0.9;
            font-size: 14px;
        }

        /* Assignment List */
        .assignment-list {
            list-style: none;
        }

        .assignment-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px;
            margin: 10px 0;
            background: var(--bg-primary);
            border-radius: 8px;
            border-left: 4px solid var(--primary-color);
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .assignment-due {
            color: var(--text-secondary);
            font-size: 14px;
        }

        .due-soon {
            color: #ef4444;
            font-weight: bold;
        }

        /* Mobile Responsiveness */
       @media (max-width: 768px) {
    /* Sidebar hidden off-screen by shifting left */
    .sidebar {
        width: var(--sidebar-width);
        left: -260px; /* Hide sidebar */
        transition: left var(--transition-speed) ease;
        position: fixed;
        top: 0;
        height: 100vh;
        z-index: 1000;
    }

    /* Show sidebar when open */
    .sidebar.open {
        left: 0;
    }

    /* Collapsed sidebar behaves same as hidden on mobile */
    .sidebar.collapsed {
        left: -260px;
        width: var(--sidebar-width);
    }

    .sidebar.collapsed.open {
        left: 0;
    }

    /* Main content takes full width when sidebar hidden */
    .main-content {
        margin-left: 0;
        transition: margin-left var(--transition-speed) ease;
    }

    /* When sidebar is open, main content shifts right */
    .sidebar.open ~ .main-content,
    .sidebar.collapsed.open ~ .main-content {
        margin-left: var(--sidebar-width);
    }

    /* Toggle button fixed on top-left, above sidebar */
    .toggle-btn {
        position: fixed;
        top: calc(var(--header-height) + 10px);
        left: 20px;
        z-index: 1101; /* Above sidebar */
        background: var(--primary-color);
        color: white;
        border: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        width: 30px;
        height: 30px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all var(--transition-speed) ease;
    }

    .toggle-btn:hover {
        transform: scale(1.2);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    }

    /* Adjust content header padding and font size */
    .content-header {
        padding: 15px 20px;
    }

    .content-header h1 {
        font-size: 24px;
    }

    /* Reduce padding in content area */
    .content-area {
        padding: 20px;
    }

    /* Stack stats grid in single column */
    .stats-grid {
        grid-template-columns: 1fr;
    }
}


        /* Mobile overlay */
        .mobile-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 999;
            opacity: 0;
            visibility: hidden;
            transition: all var(--transition-speed) ease;
        }

        .mobile-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        /* Loading animation */
        .loading {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid rgba(79, 70, 229, 0.3);
            border-radius: 50%;
            border-top-color: var(--primary-color);
            animation: spin 1s ease-in-out infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }