 @import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

 :root {
     --primary: #6366f1;
     --primary-dark: #4f46e5;
     --primary-light: #818cf8;
     --accent-cyan: #22d3ee;
     --accent-green: #10b981;
     --accent-violet: #a78bfa;
     --success: #10b981;
     --warning: #f59e0b;
     --danger: #ef4444;
     --muted: #64748b;
     --glass: rgba(255, 255, 255, 0.6);
     --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
     --glow-primary: rgba(99, 102, 241, 0.35);
     --glow-cyan: rgba(34, 211, 238, 0.25);
 }

 [data-bs-theme="light"] {
     --bg: #f8f9fc;
     --card: #ffffff;
     --text: #1e1e2e;
     --text-muted: #64748b;
     --border: #e2e8f0;
     --nav-bg: rgba(255, 255, 255, 0.82);
     --card-hover-shadow: rgba(99, 102, 241, 0.08);
     --code-bg: #f1f5f9;
 }

 [data-bs-theme="dark"] {
     --bg: #0f1729;
     --card: #1a2234;
     --text: #e2e8f0;
     --text-muted: #94a3b8;
     --border: #1e2d45;
     --nav-bg: rgba(15, 23, 41, 0.78);
     --card-hover-shadow: rgba(99, 102, 241, 0.15);
     --code-bg: #151e30;
 }

 * {
     box-sizing: border-box;
     font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
 }

 body {
     background: var(--bg);
     color: var(--text);
     min-height: 100vh;
     transition: background 0.3s ease, color 0.3s ease;
     -webkit-font-smoothing: antialiased;
     -moz-osx-font-smoothing: grayscale;
 }

 h1, h2, h3, h4, h5, h6 {
     font-weight: 700;
     letter-spacing: -0.02em;
 }

 p {
     line-height: 1.65;
 }

 code, kbd, pre, samp {
     font-family: var(--font-mono);
 }

 /* ===== NAVBAR — Noodatiy Coding LMS ===== */
 .navbar {
     background: var(--nav-bg) !important;
     backdrop-filter: blur(16px);
     -webkit-backdrop-filter: blur(16px);
     border-bottom: none;
     padding: 0;
     position: relative;
     z-index: 1050;
     transition: transform .35s cubic-bezier(.4,0,.2,1), box-shadow .35s ease;
 }
 .navbar.nav-hidden {
     transform: translateY(-100%);
     box-shadow: none !important;
 }
 .navbar.nav-shadow {
     box-shadow: 0 4px 30px rgba(0,0,0,.08);
 }

 /* Animated gradient line at bottom */
 .navbar::after {
     content: '';
     position: absolute;
     bottom: 0; left: 0; right: 0;
     height: 2px;
     background: linear-gradient(90deg,
         transparent 0%,
         var(--primary) 15%,
         var(--accent-cyan) 35%,
         var(--accent-green) 50%,
         var(--accent-cyan) 65%,
         var(--primary) 85%,
         transparent 100%);
     background-size: 200% 100%;
     animation: navGradientFlow 4s linear infinite;
     opacity: .6;
 }
 @keyframes navGradientFlow {
     0% { background-position: 100% 0; }
     100% { background-position: -100% 0; }
 }

 .navbar-brand {
     font-weight: 800;
     color: var(--primary) !important;
     letter-spacing: -0.3px;
     font-size: 1.15rem;
     transition: opacity .2s;
 }
 .navbar-brand:hover { opacity: .85; }

 /* Nav inner container */
 .navbar .container { padding-top: .45rem; padding-bottom: .45rem; }

 /* ===== NAV LINKS ===== */
 .nav-link {
     color: var(--text) !important;
     font-weight: 500;
     font-size: .87rem;
     padding: .38rem .65rem;
     border-radius: 10px;
     transition: all .25s cubic-bezier(.4,0,.2,1);
     position: relative;
     overflow: hidden;
 }

 /* Hover ripple effect via pseudo */
 .nav-link::before {
     content: '';
     position: absolute;
     inset: 0;
     border-radius: inherit;
     background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(99,102,241,.12), transparent 70%);
     opacity: 0;
     transition: opacity .3s;
     pointer-events: none;
 }
 .nav-link:hover::before { opacity: 1; }
 .nav-link:hover {
     color: var(--primary) !important;
     transform: translateY(-1px);
 }

 /* Active link — glowing pill */
 .nav-link.active {
     background: rgba(99,102,241,.1);
     color: var(--primary) !important;
     font-weight: 600;
     box-shadow: 0 0 14px var(--glow-primary), inset 0 0 0 1px rgba(99,102,241,.18);
 }
 .nav-link.active::after {
     content: '';
     position: absolute;
     bottom: 4px; left: 50%; transform: translateX(-50%);
     width: 18px; height: 3px;
     border-radius: 10px;
     background: var(--primary);
     box-shadow: 0 0 8px var(--glow-primary);
 }

 /* Avatar */
 .avatar {
     width: 44px;
     height: 44px;
     border-radius: 12px;
     object-fit: cover;
     border: 2px solid var(--border);
     background: linear-gradient(135deg, #e6f0ff, #fff);
 }

 .avatar-lg {
     width: 140px;
     height: 140px;
     border-radius: 18px;
     object-fit: cover;
     border: 3px solid var(--border);
     background: linear-gradient(135deg, #f8fafc, #fff);
 }

 .avatar-initials {
     display: inline-grid;
     place-content: center;
     font-weight: 700;
     color: white;
     background: linear-gradient(135deg, var(--primary), var(--primary-dark));
     user-select: none;
 }

 /* Cards */
 .card {
     background: var(--card);
     border: 1px solid var(--border);
     border-radius: 14px;
     transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
 }

 .card:hover {
     transform: translateY(-3px);
     box-shadow: 0 12px 28px var(--card-hover-shadow), 0 4px 8px rgba(0, 0, 0, 0.04);
     border-color: rgba(99, 102, 241, 0.15);
 }

 .card-accent {
     border-left: 3px solid var(--primary);
 }

 .card-accent-cyan {
     border-left: 3px solid var(--accent-cyan);
 }

 .card-accent-green {
     border-left: 3px solid var(--accent-green);
 }

 /* Buttons */
 .btn-primary {
     background: linear-gradient(135deg, var(--primary), var(--primary-dark));
     border: none;
     box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
     transition: all 0.2s ease;
     font-weight: 600;
 }

 .btn-primary:hover {
     background: linear-gradient(135deg, var(--primary-light), var(--primary));
     box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4), 0 0 0 3px rgba(99, 102, 241, 0.1);
     transform: translateY(-1px);
 }

 .btn-primary:active {
     transform: translateY(0);
     box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
 }

 /* Badges */
 .coin-badge {
     background: linear-gradient(135deg, #fcd34d, #f59e0b, #d97706);
     color: #78350f;
     padding: .3rem .7rem;
     border-radius: 999px;
     font-weight: 700;
     font-size: .82rem;
     box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
     letter-spacing: 0.01em;
 }

 .role-badge {
     padding: .28rem .6rem;
     border-radius: 999px;
     font-size: .75rem;
     font-weight: 700;
 }

 /* Responsive container */
 .main-container {
     max-width: 1180px;
     margin: 1.25rem auto;
     padding: 0 1rem;
 }

 /* Katta ekranlar (2K, 4K, TV) */
 @media (min-width: 1921px) {
     .main-container {
         max-width: 1600px;
     }
 }
 @media (min-width: 2560px) {
     .main-container {
         max-width: 2000px;
         padding: 0 2rem;
     }
     html {
         font-size: 18px;
     }
 }
 @media (min-width: 3840px) {
     .main-container {
         max-width: 2800px;
         padding: 0 3rem;
     }
     html {
         font-size: 22px;
     }
 }

 /* Profile header card (used on profile page) */
 .profile-header {
     display: grid;
     grid-template-columns: auto 1fr;
     gap: 1.25rem;
     align-items: center;
 }

 @media (max-width: 768px) {
     .profile-header {
         grid-template-columns: 1fr;
         text-align: center;
     }

     .avatar-lg {
         margin: 0 auto;
     }
 }

 /* Theme Toggle button */
 .theme-toggle {
     position: fixed;
     bottom: 22px;
     right: 22px;
     z-index: 1100;
 }

 .theme-toggle .btn {
     width: 52px;
     height: 52px;
     border-radius: 50%;
     border: 1px solid var(--border);
     background: var(--card);
     color: var(--text);
 }

 /* Coin Celebration */
 .coin-celebration {
     position: fixed;
     inset: 0;
     display: none;
     align-items: center;
     justify-content: center;
     z-index: 1200;
 }

 .coin-celebration.show {
     display: flex;
 }

 .coin-celebration-content {
     text-align: center;
     padding: 2rem;
     border-radius: 18px;
     background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.3));
 }

 /* Small helpers */
 .muted {
     color: var(--text-muted);
 }

 .shadow-soft {
     box-shadow: 0 8px 30px rgba(2, 6, 23, 0.05);
 }

 /* ===== Mobile Profile Offcanvas ===== */
 #mobileProfileMenu {
     border-top-left-radius: 24px;
     border-top-right-radius: 24px;
     border: none;
     background: var(--card);
     max-height: 85vh;
 }

 #mobileProfileMenu .offcanvas-header {
     background: var(--card);
     border-top-left-radius: 24px;
     border-top-right-radius: 24px;
 }

 #mobileProfileMenu .offcanvas-body {
     background: var(--card);
 }

 .mobile-profile-grid {
     display: grid;
     grid-template-columns: repeat(3, 1fr);
     gap: 12px;
 }

 .mobile-profile-item {
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 8px;
     padding: 16px 8px;
     border-radius: 16px;
     background: var(--bg);
     text-decoration: none;
     color: var(--text);
     font-size: 0.8rem;
     font-weight: 600;
     transition: transform 0.2s ease, background 0.2s ease;
 }

 .mobile-profile-item:hover,
 .mobile-profile-item:active {
     transform: scale(0.95);
     background: rgba(99, 102, 241, 0.08);
     color: var(--primary);
 }

 .mobile-profile-icon {
     width: 48px;
     height: 48px;
     border-radius: 14px;
     background: rgba(99, 102, 241, 0.1);
     color: var(--primary);
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 1.3rem;
     transition: background 0.2s ease;
 }

 .mobile-profile-item:hover .mobile-profile-icon,
 .mobile-profile-item:active .mobile-profile-icon {
     background: rgba(99, 102, 241, 0.18);
 }

 .mobile-profile-logout {
     display: flex;
     align-items: center;
     justify-content: center;
     padding: 14px;
     border-radius: 14px;
     background: rgba(239, 68, 68, 0.08);
     color: #ef4444;
     font-weight: 700;
     font-size: 0.95rem;
     text-decoration: none;
     transition: transform 0.2s ease, background 0.2s ease;
 }

 .mobile-profile-logout:hover,
 .mobile-profile-logout:active {
     transform: scale(0.97);
     background: rgba(239, 68, 68, 0.15);
     color: #dc2626;
 }

 /* ===== Utility Classes ===== */

 .code-font {
     font-family: var(--font-mono);
     font-size: 0.9em;
     letter-spacing: -0.02em;
 }

 .glass-card {
     background: var(--glass);
     backdrop-filter: blur(16px);
     -webkit-backdrop-filter: blur(16px);
     border: 1px solid rgba(255, 255, 255, 0.12);
     border-radius: 14px;
 }

 [data-bs-theme="dark"] .glass-card {
     background: rgba(30, 45, 69, 0.45);
     border-color: rgba(255, 255, 255, 0.06);
 }

 .gradient-text {
     background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
     -webkit-background-clip: text;
     -webkit-text-fill-color: transparent;
     background-clip: text;
 }