@import url('https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.0/css/all.min.css');
/* Font Awesome is loaded globally to ensure header/menu icons render consistently across all pages. */
/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --dark-bg: #1e293b;
    --light-bg: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --text-muted: #6b7280; /* slate-500 */
    --focus-ring: #93c5fd; /* light focus ring */
    --white: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border-color: #e2e8f0;
    --card-border: #e5e7eb;
    --text-color: var(--text-dark);
    --bg-card: #ffffff;
    --card-bg: #ffffff;
    --code-bg: #f8fafc;
    --code-fg: #0b1322;
    --animation-speed: 0.3s;
    --bounce-animation: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Dark theme variables override */
:root[data-theme="dark"] {
    --primary-color: #818cf8;
    --secondary-color: #a78bfa;
    --dark-bg: #0b1322;
    --light-bg: #0b1322;
    --text-dark: #e2e8f0;
    --text-light: #94a3b8;
    --text-muted: #9ca3af; /* slate-400 */
    --focus-ring: #60a5fa; /* dark focus ring */
    --white: #0f172a;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --border-color: #334155;
    --card-border: #334155;
    --text-color: var(--text-dark);
    --bg-card: #0f172a;
    --card-bg: #0f172a;
    --code-bg: #0f172a;
    --code-fg: #e5e7eb;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    color-scheme: light dark; /* allow UA widgets to match theme */
}

/* Global animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shineFlow {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Animation classes */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    transition: all var(--animation-speed) ease;
}

/* Global media elements */
img, svg, video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Base form controls */
input, textarea, select {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--white);
    color: var(--text-dark);
    transition: border-color .2s ease, box-shadow .2s ease;
}

input::placeholder, textarea::placeholder {
    color: var(--text-light);
}

input:focus-visible, textarea:focus-visible, select:focus-visible, .btn:focus-visible {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}

/* High-visibility focus rings for interactive controls */
.btn:focus-visible,
.theme-toggle:focus-visible,
.nav-menu a:focus-visible,
.mobile-menu-toggle:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    box-shadow: none;
}

label {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--text-dark);
    font-weight: 600;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
}

/* Responsive container breakpoints */
@media (min-width: 576px) { .container{ max-width: 540px; } }
@media (min-width: 768px) { .container{ max-width: 720px; } }
@media (min-width: 992px) { .container{ max-width: 960px; } }
@media (min-width: 1200px) { .container{ max-width: 1140px; } }
@media (min-width: 1400px) { .container{ max-width: 1320px; } }

/* Content helpers */
pre {
    background: var(--code-bg);
    color: var(--code-fg);
    padding: 12px;
    border-radius: 8px;
    overflow: auto;
}
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

figure { margin: 16px 0; }
figcaption { color: var(--text-light); font-size: .92rem; margin-top: 6px; }

/* Table wrapper for small screens */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Header */
.header {
    background: rgba(255,255,255,0.92);
    backdrop-filter: saturate(140%) blur(8px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: none;
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

:root[data-theme="dark"] .header {
    background: rgba(15,23,42,0.72);
    backdrop-filter: saturate(140%) blur(8px);
}

.header:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

/* Header actions (e.g., theme toggle) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Notification bell and badge in header */
.header .notification-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.header .notification-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--danger);
    color: #fff;
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--white);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-dark);
    cursor: pointer;
    transition: background-color var(--animation-speed) ease, border-color var(--animation-speed) ease, transform var(--animation-speed) var(--bounce-animation);
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--primary-color);
}

.theme-toggle i { color: var(--primary-color); }
body[data-theme="dark"] pre,
body[data-theme="dark"] code {
    background-color: var(--dark-bg);
    color: var(--text-dark);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform var(--animation-speed) var(--bounce-animation);
}

.logo:hover {
    transform: scale(1.05);
}

/* Make brand link wrap logo and title without changing look */
.logo a.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    color: inherit;
    text-decoration: none;
}

.logo-placeholder {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all var(--animation-speed) ease;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
}

.logo-placeholder:hover {
    transform: rotate(5deg) scale(1.1);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

.logo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--animation-speed) ease;
}

.logo h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all var(--animation-speed) ease;
}

/* Responsive logo sizing for small screens */
@media (max-width: 640px) {
    .logo-placeholder { width: 32px; height: 32px; }
    .logo h1 { font-size: 1.2rem; }
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-menu { position: relative; }
.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.95rem;
}

/* Modern underline slider animation */
.nav-menu > ul > li > a::before {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 4px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--animation-speed) var(--bounce-animation);
}

.nav-menu > ul > li > a:hover::before,
.nav-menu > ul > li > a.active::before {
    transform: scaleX(1);
}

.nav-menu > ul > li > a:hover,
.nav-menu > ul > li > a.active {
    color: var(--primary-color);
}

.nav-menu .nav-user-mobile > a::before { display: none; }


/* Notification Bell - Global */
.notification-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    animation: pulse 2s infinite;
}

@media (max-width: 768px) {
    .notification-badge {
        top: -4px;
        right: -4px;
        width: 16px;
        height: 16px;
        font-size: 0.65rem;
    }
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all var(--animation-speed) var(--bounce-animation);
    padding: 6px;
    border-radius: 6px;
}

.mobile-menu-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.1);
}

/* Dropdown Menu */
.nav-menu .dropdown {
    position: relative;
}
.nav-menu .dropdown > a {
    display: flex;
    align-items: center;
    gap: 6px;
}
/* Fallback arrow independent of Font Awesome */
.nav-menu .dropdown > a i.fa-angle-down { display: none; }
.nav-menu .dropdown > a::after {
    content: '▾';
    font-size: 0.9rem;
    margin-left: 6px;
    transition: transform 0.2s ease;
}
.nav-menu .dropdown.open > a::after,
.nav-menu .dropdown:hover > a::after {
    transform: rotate(180deg);
}
.nav-menu .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    min-width: 300px;
    max-width: min(420px, calc(100vw - 24px));
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px) scale(.98);
    transition: opacity 180ms var(--ease-smooth), transform 220ms var(--ease-smooth);
    z-index: 1001;
}
/* duplicate block removed intentionally */
.nav-menu .dropdown:hover .dropdown-menu,
.nav-menu .dropdown.open .dropdown-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.nav-menu .dropdown-menu li {
    border: none;
}
.nav-menu .dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    white-space: normal;
    line-height: 1.25;
}
.nav-menu .dropdown-menu a i { color: var(--primary-color); width: 18px; text-align: center; }
.nav-menu .dropdown-menu a:hover {
    background: rgba(99, 102, 241, 0.08);
}

/* Mobile nav behavior */
@media (max-width: 992px) {
    .mobile-menu-toggle { display: block; }
    .nav-menu {
        display: block;
        position: fixed;
        top: 56px;
        left: 12px;
        right: 12px;
        background: var(--white);
        border: 1px solid var(--border-color);
        border-top-width: 1px;
        box-shadow: 0 16px 28px rgba(0,0,0,0.14);
        transform: translateY(-12px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform .2s ease, opacity .2s ease, visibility .2s ease;
        z-index: 1000;
        border-radius: 16px;
        max-height: 80vh;
        overflow-y: auto;
    }
    .nav-menu.open, .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .nav-menu ul {
        flex-direction: column;
        gap: 6px;
        padding: 10px;
    }
    .nav-menu .nav-user-mobile {
        display: none;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-menu.active .nav-user-mobile { display: flex; }
    [data-theme="dark"] .nav-menu .nav-user-mobile { border-color: rgba(255,255,255,0.12); }
    .nav-menu .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding: 6px;
        min-width: 100%;
        display: none;
    }
    .nav-menu .dropdown.open .dropdown-menu { display: block; }
}

/* Overlay for mobile menu */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.28);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
    z-index: 999;
}
.nav-overlay.active { opacity: 1; visibility: visible; }
body.nav-open { overflow: hidden; }

/* Accessibility helper */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap; /* added line */
    border: 0;
}

/* Doubts UI */
.doubts-header { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.doubt-card { border:1px solid var(--border-color); border-radius:12px; padding:14px; background: var(--white); margin-bottom:14px; }
.doubt-card .meta { display:flex; gap:10px; align-items:center; margin-bottom:8px; }
.doubt-card .meta img { width:32px; height:32px; border-radius:50%; object-fit:cover; }
.doubt-card .title { font-size:18px; font-weight:700; }
.doubt-card pre { background: rgba(99,102,241,0.06); padding:10px; border-radius:8px; overflow:auto; }
.doubt-card pre code { color: var(--text-dark); font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.92rem; }
.doubt-badges { display:flex; gap:8px; align-items:center; margin-top:8px; }
.comment-box { margin-top: 10px; }
.comment-item { border-top: 1px dashed var(--border-color); padding-top: 10px; margin-top: 10px; }
.comment-item .meta { display:flex; gap:8px; align-items:center; }
.comment-item .meta img { width:24px; height:24px; border-radius:50%; }
.comment-actions { display:flex; gap:10px; align-items:center; margin-top:6px; }
.badge-solved { background:#dcfce7; color:#166534; padding:4px 8px; border-radius:999px; font-size:12px; font-weight:700; }
.badge-unsolved { background:#fee2e2; color:#7f1d1d; padding:4px 8px; border-radius:999px; font-size:12px; font-weight:700; }

/* Doubts code box */
.code-box { border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; background: var(--white); }
.code-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; background: #f8fafc; border-bottom: 1px solid var(--border-color); }
.code-lang { font-weight: 700; font-size: 12px; color: var(--text-light); letter-spacing: .08em; }
.code-actions { display: flex; gap: 8px; align-items: center; }
.code-body { max-height: 360px; overflow: auto; margin: 0; border-radius: 0; }
@media (max-width: 640px) { .code-body { max-height: 240px; } }

/* Utility responsive grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 992px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Cards and question list responsiveness */
.card { border-radius: 12px; background: var(--white); padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); }
.question-card { border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; background: var(--white); margin-bottom: 16px; }
.question-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.question-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-light); }
@media (max-width: 640px) {
    .question-card { padding: 12px; }
    .question-meta { gap: 8px; }
}

/* Team section UI */
/* Team section unified styles (avoid duplicate/conflicting rules) */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.team-card { background: var(--white); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.06); transition: transform .2s ease, box-shadow .2s ease; }
.team-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.team-avatar { width: 104px; height: 104px; border-radius: 50%; margin: 0 auto 12px; object-fit: cover; box-shadow: 0 4px 12px rgba(99,102,241,0.2); }
.team-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.team-role { color: var(--text-light); margin-bottom: 10px; }
.team-bio { color: var(--text-dark); font-size: .95rem; }
@media (max-width: 640px) { .team-avatar { width: 92px; height: 92px; } }

/* Table responsive helpers */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 10px; border-bottom: 1px solid var(--border-color); }
.table-responsive { overflow-x: auto; }
.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }

/* Admin layout responsiveness */
.admin-wrapper { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--white); border-right: 1px solid var(--border-color); }
.admin-main { background: var(--light-bg); }
@media (max-width: 992px) {
    .admin-wrapper { grid-template-columns: 1fr; }
    .admin-sidebar { position: sticky; top: 0; z-index: 900; }
}

/* Helper classes */
.hidden-sm { display: none; }
@media (min-width: 641px) { .hidden-sm { display: initial; } }
.stack-sm { display: flex; flex-wrap: wrap; gap: 10px; }

/* Page header responsive */
.page-header h1 { font-size: 2rem; }
.page-header p { max-width: 720px; }
@media (max-width: 640px) { .page-header h1 { font-size: 1.5rem; } }

/* Welcome Section Enhanced */
.welcome-section {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 25%, #06b6d4 50%, #22c55e 75%, #f59e0b 100%);
    color: var(--white);
    padding: 100px 0;
    text-align: center;
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: float 6s ease-in-out infinite;
}

.welcome-content {
    position: relative;
    z-index: 2;
}

.welcome-content h2 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    line-height: 1.2;
}

.welcome-text {
    display: block;
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 10px;
    opacity: 0.9;
    animation: slideInLeft 0.8s ease-out;
}

.welcome-subtitle {
    display: block;
    font-size: 1.5rem;
    font-weight: 400;
    margin-top: 10px;
    opacity: 0.8;
    animation: slideInRight 0.8s ease-out 0.2s both;
}

.welcome-description {
    font-size: 1.4rem;
    margin-bottom: 40px;
    opacity: 0.95;
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.text-highlight {
    background: linear-gradient(135deg, #fff, #e9d5ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    position: relative;
    display: inline-block;
    animation: highlightPulse 3s ease-in-out infinite;
}

.text-highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    animation: underlineGlow 2s ease-in-out infinite;
}

/* Welcome Stats */
.welcome-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    animation: bounceIn 0.8s ease-out;
}

.stat-item:nth-child(1) { animation-delay: 0.3s; }
.stat-item:nth-child(2) { animation-delay: 0.5s; }
.stat-item:nth-child(3) { animation-delay: 0.7s; }

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #e9d5ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
    animation: numberCount 2s ease-out;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 400;
}

/* Enhanced CTA Buttons */
.cta-buttons {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-glow:hover::before {
    left: 100%;
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* New Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 0.9;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 0.8;
        transform: translateX(0);
    }
}

@keyframes highlightPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes underlineGlow {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(20px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(-5px);
    }
    70% {
        transform: scale(0.9) translateY(2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes numberCount {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.brand-animated {
    background: linear-gradient(90deg, #fff, #e9d5ff, #dbeafe, #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 300% 100%;
    animation: shineFlow 4s linear infinite;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--animation-speed) var(--bounce-animation);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #5855eb, #7c3aed);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--primary-color);
    border-color: var(--white);
}

/* My Tasks Widget */
.my-tasks-widget {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    margin-top: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.6s ease-out;
}

:root[data-theme="dark"] .my-tasks-widget {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.widget-header h3 {
    color: var(--text-dark);
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.widget-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--animation-speed) ease;
    text-decoration: none;
    font-size: 14px;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.task-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform var(--animation-speed) ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-list {
    max-height: 200px;
    overflow-y: auto;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all var(--animation-speed) ease;
    cursor: pointer;
}

.task-item:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.task-item.overdue {
    border-left: 4px solid var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.task-item.completed {
    opacity: 0.7;
    text-decoration: line-through;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    cursor: pointer;
}

.task-name {
    flex: 1;
    color: var(--text-dark);
    font-weight: 500;
}

.task-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 10px;
}

.task-item.overdue .task-time {
    color: var(--danger);
    font-weight: 600;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Quick Add Task Modal */
.quick-add-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.quick-add-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.quick-add-form {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

.quick-add-form h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
    text-align: center;
}

.quick-add-form .form-group {
    margin-bottom: 15px;
}

.quick-add-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-dark);
    font-size: 1rem;
    transition: border-color var(--animation-speed) ease;
}

.quick-add-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.quick-add-form .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.quick-add-form .btn {
    flex: 1;
    padding: 12px;
    font-size: 0.9rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive widget styles */
@media (max-width: 768px) {
    .my-tasks-widget {
        margin-top: 30px;
        padding: 20px;
    }
    
    .widget-header h3 {
        font-size: 1.3rem;
    }
    
    .task-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .task-list {
        max-height: 150px;
    }
    
    .quick-add-form {
        padding: 20px;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .welcome-section {
        padding: 60px 0;
    }
    
    .welcome-content h2 {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .welcome-text {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .welcome-subtitle {
        font-size: 1rem;
        margin-top: 5px;
    }
    
    .welcome-description {
        font-size: 1rem;
        margin-bottom: 25px;
        padding: 0 10px;
    }
    
    .welcome-stats {
        gap: 25px;
        margin-bottom: 30px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .btn-glow {
        min-width: 200px;
        text-align: center;
    }
    
    .task-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .widget-actions {
        gap: 5px;
    }
    
    .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* Updates Section */
.updates-section,
.languages-section {
    padding: 60px 0;
}

.updates-section h2,
.languages-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--text-dark);
}

.updates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.update-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.update-card:hover {
    transform: translateY(-5px);
}

.update-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.update-card .count {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.update-card .date {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Languages Grid */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

/* Enhanced Section Headers */
.languages-section h2,
.updates-section h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    animation: fadeInUp 0.8s ease-out;
}

.languages-section h2::after,
.updates-section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    animation: slideInCenter 1s ease-out 0.3s both;
}

@keyframes slideInCenter {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 80px;
        opacity: 1;
    }
}

.languages-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.languages-toolbar .search-input {
    flex: 1 1 280px;
    max-width: 480px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.view-toggle .toggle-btn {
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-dark);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.view-toggle .toggle-btn.active {
    background: var(--light-bg);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.language-card {
    background: var(--white);
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-dark);
    display: block;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.language-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.6s ease;
}

.language-card:hover::before {
    left: 100%;
}

.language-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, var(--white), rgba(99, 102, 241, 0.02));
}

.language-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
    display: inline-block;
}

.language-card:hover .language-icon {
    transform: scale(1.1) rotate(-5deg);
    filter: drop-shadow(0 5px 15px rgba(99, 102, 241, 0.4));
}

.language-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.language-card:hover h3 {
    color: var(--primary-color);
}

.language-card .question-count {
    color: var(--text-light);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.language-card:hover .question-count {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.language-card .language-desc {
    color: var(--text-light);
    margin-top: 8px;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.language-card:hover .language-desc {
    color: var(--text-dark);
    transform: translateY(-1px);
}

/* Language Card Entrance Animation */
.language-card {
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.language-card:nth-child(1) { animation-delay: 0.1s; }
.language-card:nth-child(2) { animation-delay: 0.2s; }
.language-card:nth-child(3) { animation-delay: 0.3s; }
.language-card:nth-child(4) { animation-delay: 0.4s; }
.language-card:nth-child(5) { animation-delay: 0.5s; }
.language-card:nth-child(6) { animation-delay: 0.6s; }
.language-card:nth-child(7) { animation-delay: 0.7s; }
.language-card:nth-child(8) { animation-delay: 0.8s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced List View */
.language-card.list-item {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    text-align: left;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 12px;
}

.language-card.list-item .language-icon {
    font-size: 2.5rem;
    margin: 0;
    justify-self: center;
}

.language-card.list-item .question-count {
    margin: 0;
    justify-self: end;
    font-weight: 600;
}

.language-card.list-item .language-desc {
    margin: 4px 0 0 0;
    grid-column: 2;
}

.language-card.list-item:hover .language-icon {
    transform: scale(1.1) rotate(-5deg);
}

@media (max-width: 640px) {
    .language-card.list-item {
        grid-template-columns: 48px 1fr;
    }
}

/* Footer */
.footer {
    background: linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)), var(--dark-bg);
    color: var(--white);
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--white);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* Footer accessibility improvements */
.footer-section nav ul li a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Anti-inspect deterrents */
body.disable-select,
.protected-content {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
img {
    -webkit-user-drag: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}
input, textarea, [contenteditable="true"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Footer: Professional layout helpers */
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img.footer-logo { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; box-shadow: 0 4px 14px rgba(99,102,241,0.25); }
.footer-brand h3 { margin: 0; color: var(--white); }
.footer-section p.footer-desc { color: rgba(255,255,255,0.8); margin-top: 8px; max-width: 420px; }
.footer-section ul { padding-left: 0; }
.footer-section ul li a i { margin-right: 8px; }

/* Team Page (duplicate block removed; unified styles declared earlier) */

/* Form Styles */
.form-container {
    max-width: 500px;
    margin: 50px auto;
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Utility: muted helper for hints/subtext */
.text-muted {
    color: #6b7280; /* gray-500 */
    font-size: 0.9em;
}

.alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* Dashboard Styles */
.dashboard {
    padding: 40px 0;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-card p {
    color: var(--text-light);
}

/* Question Card */
.question-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
}

.question-header h3 {
    color: var(--text-dark);
    flex: 1;
}

.question-meta {
    display: flex;
    gap: 15px;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.question-description {
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 20px;
}

.question-actions {
    display: flex;
    gap: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.action-btn:hover {
    color: var(--primary-color);
}

.action-btn.liked {
    color: var(--danger);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-wrapper {
        padding: 0.8rem 0;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        z-index: 1000;
        border-radius: 0 0 8px 8px;
    }
    
    .nav-menu.active {
        display: block;
        animation: slideDown 0.3s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav-menu ul {
        flex-direction: column;
        padding: 1rem 0;
    }
    
    .nav-menu li {
        margin: 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem 2rem;
        border-bottom: none;
        transition: background-color 0.3s ease;
    }
    
    .nav-menu a:hover {
        background-color: var(--light-bg);
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    /* Remove pseudo-element fallback to avoid double hamburger icon */
    .mobile-menu-toggle i { display: inline-block; }

    /* Mobile dropdown display */
    .nav-menu .dropdown > a {
        justify-content: space-between;
        width: 100%;
    }
    .nav-menu .dropdown-menu {
        position: static;
        border: none;
        box-shadow: none;
        padding: 0;
        display: none;
    }
    .nav-menu .dropdown.open .dropdown-menu {
        display: block;
    }
    
    .welcome-content h2 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .welcome-content p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
    
    .languages-grid,
    .updates-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Question cards responsive */
    .question-card {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .question-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
        justify-content: flex-start;
    }
    
    .question-actions .btn {
        flex: 1;
        min-width: 120px;
    }
    
    /* Better mobile table handling */
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table table {
        min-width: 600px;
    }
    
    /* Improved form responsiveness */
    .form-container {
        margin: 30px auto;
        padding: 30px 20px;
        max-width: 90%;
    }
}
    
    /* Form responsive */
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
        padding: 0.8rem;
    }

/* Simple grid for stacked form layout spacing */
.form-grid {
    display: grid;
    gap: 12px;
}
    
    /* Table responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    /* Button responsive */
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        min-height: 44px; /* Touch-friendly size */
    }
    
    /* Card responsive */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Language card responsive */
    .language-card {
        padding: 1.5rem 1rem;
    }
    
    .language-card h3 {
        font-size: 1.2rem;
    }
/* Remove the stray closing brace */

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .welcome-section {
        padding: 80px 0;
    }
    
    .welcome-content h2 {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .welcome-text {
        font-size: 1rem;
    }
    
    .welcome-subtitle {
        font-size: 1.2rem;
    }
    
    .welcome-description {
        font-size: 1.1rem;
        margin-bottom: 30px;
    }
    
    .welcome-stats {
        gap: 40px;
        margin-bottom: 40px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    .cta-buttons {
        gap: 15px;
    }
    
    .nav-menu a {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .question-card {
        padding: 0.8rem;
    }
    
    .question-header h3 {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .question-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .question-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .question-actions .btn {
        width: 100%;
        min-width: auto;
    }
    
    .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.7rem;
    }
    
    .language-card {
        padding: 1rem 0.8rem;
    }
    
    .language-card h3 {
        font-size: 1.1rem;
    }
    
    .language-card p {
        font-size: 0.9rem;
    }
    
    .stats-grid {
        gap: 0.8rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .stat-card p {
        font-size: 0.8rem;
    }
    
    /* Mobile-first navigation improvements */
    .mobile-menu-toggle {
        padding: 0.25rem;
        font-size: 1.1rem;
    }
    
    .nav-menu {
        border-radius: 0 0 6px 6px;
    }
    
    /* Better touch targets */
    .cta-buttons .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }
}

/* Tablet responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .languages-grid,
    .updates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        padding: 0 30px;
    }
}

/* Advanced UI Animations */

/* Page Load Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Apply animations to elements */
.card, .question-card, .solution-card, .comment-card {
    animation: fadeInUp 0.6s ease-out;
}

.card:nth-child(even) {
    animation: slideInLeft 0.6s ease-out;
}

.card:nth-child(odd) {
    animation: slideInRight 0.6s ease-out;
}

.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    transition: transform 0.1s;
}

/* Form Input Animations */
.form-group input, .form-group textarea, .form-group select {
    transition: all 0.3s ease;
    position: relative;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.15);
}

/* Navigation Animations */
.nav-menu a {
    position: relative;
    overflow: hidden;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transition: left 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    left: 0;
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Hover Effects for Cards */
.question-card, .solution-card, .comment-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-card:hover, .solution-card:hover, .comment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Stagger Animation for Lists */
.questions-list .question-card:nth-child(1) { animation-delay: 0.1s; }
.questions-list .question-card:nth-child(2) { animation-delay: 0.2s; }
.questions-list .question-card:nth-child(3) { animation-delay: 0.3s; }
.questions-list .question-card:nth-child(4) { animation-delay: 0.4s; }
.questions-list .question-card:nth-child(5) { animation-delay: 0.5s; }

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Page Transition */
body {
    animation: fadeInUp 0.5s ease-out;
}

/* Icon Animations */
.fas, .far {
    transition: all 0.3s ease;
}

.btn:hover .fas,
.btn:hover .far {
    transform: scale(1.1);
}

/* Progress Bar Animation */
@keyframes progressBar {
    from { width: 0%; }
    to { width: 100%; }
}

.progress-bar {
    animation: progressBar 2s ease-in-out;
}

/* Notification Animation */
.notification-badge {
    animation: pulse 2s infinite, bounceIn 0.5s ease-out;
}

/* Mobile Responsive Animations */
@media (max-width: 768px) {
    .card, .question-card, .solution-card, .comment-card {
        animation: fadeInUp 0.4s ease-out;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .question-card:hover, .solution-card:hover, .comment-card:hover {
        transform: none;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* -----------------------------
   Question Detail: Action Buttons
   - Animate Back to Questions and Like button
   - Heart pulse on like
   ----------------------------- */
@keyframes actionPopIn {
    from { transform: translateY(-6px); }
    to { transform: translateY(0); }
}
@keyframes heartBeat {
    0% { transform: scale(1); }
    20% { transform: scale(1.2); }
    40% { transform: scale(1); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.question-title-section a.btn { animation: actionPopIn 260ms var(--ease-smooth) forwards; }
#likeBtn { animation: actionPopIn 320ms var(--ease-smooth) forwards; }
#likeBtn,
.question-title-section a.btn {
    opacity: 1;
    visibility: visible;
}
#likeBtn .fa-heart { transition: transform 140ms var(--ease-smooth), color 160ms var(--ease-smooth); }
#likeBtn:hover .fa-heart { transform: scale(1.08); }
#likeBtn.liked .fa-heart { color: var(--primary-color); animation: heartBeat 600ms var(--ease-smooth); }
/* -----------------------------
   Header & Dropdown Enhancements
   - Smooth underline animation
   - Better dropdown reveal
   - Dark mode transition polish
   ----------------------------- */

/* Easing and ink bar variables */
:root { --ease-smooth: cubic-bezier(.22,.61,.36,1); --nav-ink-height: 2px; }

/* Make header wrapper flexible on small screens */
.nav-wrapper { flex-wrap: wrap; gap: 8px; }

/* Smooth underline (ink bar) for nav links */
.nav-menu a { position: relative; overflow: visible; }
.nav-menu a::before { content: none; }
.nav-menu a::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    bottom: -4px;
    height: var(--nav-ink-height);
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: center;
    opacity: 0;
    transition: transform 220ms var(--ease-smooth), opacity 220ms var(--ease-smooth);
}
.nav-menu a:hover::after,
.nav-menu a.active::after { transform: scaleX(1); opacity: 1; }

/* Dropdown reveal: subtle fade + slide + scale */
.nav-menu .dropdown-menu {
    opacity: 0;
    transform: translateY(10px) scale(.98);
    transition: opacity 180ms var(--ease-smooth), transform 220ms var(--ease-smooth);
    will-change: transform, opacity;
    visibility: hidden;
    pointer-events: none;
}

.header .nav-menu img { width: 32px !important; height: 32px !important; object-fit: cover; border-radius: 50%; }
.nav-menu .dropdown:hover .dropdown-menu,
.nav-menu .dropdown.open .dropdown-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    pointer-events: auto;
}

/* Use a dedicated nav background to improve dark mode contrast */
.nav-menu { background: var(--white); }
[data-theme="dark"] .nav-menu { background: #0f172a; }

/* Smooth color/background/border transitions for dark mode */
body, header.header, .nav-menu, .card, .question-card, .doubt-card, footer,
.dropdown-menu, .data-table, .team-card, .comment-box, .comment-item {
    transition: background-color 220ms var(--ease-smooth),
                color 220ms var(--ease-smooth),
                border-color 220ms var(--ease-smooth);
}

/* Computer dropdown item hover refinement */
.nav-menu .dropdown-menu a { transition: color 160ms var(--ease-smooth), background-color 160ms var(--ease-smooth); }
.nav-menu .dropdown-menu a:hover { background: rgba(99,102,241,0.08); color: var(--primary-color); }

/* Topics grid for language pages (Computer Mathematics, etc.) */
.topics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 992px) { .topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .topics-grid { grid-template-columns: 1fr; } }
.topic-card { display: block; padding: 16px; border: 1px solid var(--border-color); border-radius: 10px; text-decoration: none; background: var(--white); transition: box-shadow .2s ease, transform .2s ease; color: inherit; }
.topic-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }
.topic-card.active { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.topic-header { display:flex; align-items:center; gap:12px; margin-bottom:8px; }
.topic-icon { width:36px; height:36px; border-radius:8px; display:flex; align-items:center; justify-content:center; background: var(--light-bg); color: var(--primary-color); }
.topic-desc { color: var(--text-light); font-size: 0.95rem; line-height:1.4; }
.pill { display:inline-block; padding:6px 10px; border-radius:999px; border:1px solid var(--border-color); background: var(--card-bg); }
