/**
 * ==============================================
 * HackForge CTF Platform
 * ==============================================
 * File: /assets/css/style.css
 * Description: Main stylesheet with cyberpunk theme
 * Features:
 *   - CSS variables for consistent theming
 *   - Reusable component classes
 *   - Purple accent glow effects
 *   - Responsive mobile-first design
 *   - Dark theme optimized
 * ==============================================
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    color-scheme: dark;
    --bg-dark: #0a0a0a;
    --bg-card: #121218;
    --bg-input: #0404048a;
    --bg-secondary: #1a1a24;
    --bg-tertiary: #252532;
    --border-color: #2a2a3a;
    --text-primary: #e8e8e8;
    --text-secondary: #b8b8c8;
    --text-tertiary: #707080;
    --text-comment: #777777;
    --accent-purple: #9d4edd;
    --accent-orange: #ff6b35;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --terminal-color: #9d4edd;
    --card-gradient: linear-gradient(135deg, #1a1a1a 0%, #2d1b69 100%); /* var(--card-gradient); #0000000a; OR linear-gradient(135deg, rgba(18, 18, 24, 0.95) 0%, rgba(26, 26, 38, 0.95) 100%);*/
    --footer-bg: #0d0d12;
    --glow-purple: 0 0 20px rgba(157, 78, 221, 0.3);
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-xxl: 3rem;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-round: 50%;
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after { box-sizing: border-box; }

html { 
    height: 100%;
    background: #0d0d0d;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Source Code Pro', monospace;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a0a2e 50%, #0d0d0d 100%);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100%;
    padding-top: 70px;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes elegantGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes glitchIn {
    0% { 
        opacity: 0; 
        transform: scale(1.05) rotateX(90deg);
        filter: blur(8px);
    }
    100% { 
        opacity: 1; 
        transform: scale(1) rotateX(0deg);
        filter: blur(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AJAX-loaded content animations */
.ajax-loaded {
    animation: fadeInUp 0.4s ease-out backwards;
}

.ajax-loaded.challenge-card,
.ajax-loaded.user-card {
    animation: fadeInUp 0.4s ease-out backwards;
}

.ajax-loaded.podium {
    animation: fadeInUp 0.5s ease-out;
}

.ajax-loaded.scoreboard-table {
    animation: fadeInUp 0.5s ease-out 0.1s backwards;
}

.ajax-loaded.your-rank-banner {
    animation: fadeInUp 0.4s ease-out;
}

a { color: var(--accent-purple); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: #b366e8; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin: 0 0 var(--space-md);
    
    font-family: 'Rajdhani', sans-serif;
  color: var(--accent-orange);
  font-size: 1.1rem;
  letter-spacing: 1px;
  
}

p { margin: var(--space-md) 0; font-size: 0.9rem; }
ul, ol { margin: 0 0 var(--space-md); padding-left: var(--space-lg); }
code { background: rgba(157, 78, 221, 0.2); padding: 0.2em 0.4em; border-radius: var(--radius-sm); font-size: 0.9em; }

/* Main wrapper for sticky footer */
main { 
    flex: 1;
    position: relative;
}

/* Purple ambient glow effect on main area */
main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1800px;
    height: 100%;
    background: radial-gradient(ellipse at top center, rgba(157, 78, 221, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* ========================================
   LAYOUT
   ======================================== */
.comment-body,
.comment-count,
.hint-header,
.hint-content { 
    font-size: 0.9rem; 
   }
   
.container {
    padding: var(--space-xl);
    
    width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
}

.page-header h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: transparent;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-purple) 50%, var(--accent-orange) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: elegantGradient 8s ease-in-out infinite;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 20px rgba(157, 78, 221, 0.3));
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.main-nav {
    max-width: 1800px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
}

.nav-brand,
.nav-logo {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent-purple);
    text-decoration: none;
    text-shadow: 0 0 4px var(--accent-purple);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--accent-purple);
    background: rgba(157, 78, 221, 0.1);
    text-shadow: 0 0 8px rgba(157, 78, 221, 0.4);
}

.nav-auth { display: flex; align-items: center; gap: var(--space-md); }

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    transition: background 0.2s ease;
}

.user-dropdown-toggle:hover {
    background: rgba(157, 78, 221, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-dropdown-toggle span {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.user-dropdown-toggle .user-xp {
    color: var(--accent-orange);
    font-weight: 600;
}

.dropdown-arrow {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.user-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: #1e1e2a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.user-dropdown.open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.user-dropdown-header .username {
    font-weight: 600;
    color: var(--text-primary);
}

.user-dropdown-header .user-level {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.7rem var(--space-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.user-dropdown-menu a:hover {
    background: rgba(157, 78, 221, 0.1);
    color: var(--text-primary);
}

.user-dropdown-menu a span {
    font-size: 1rem;
}

.user-dropdown-menu .logout-form {
    margin: 0;
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-xs);
}

.user-dropdown-menu .logout-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.6rem 1rem;
    color: var(--error-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.user-dropdown-menu .logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
}

.mobile-menu-toggle { display: none; }
.mobile-menu { display: none; }

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #7b2cbf 100%);
    color: #fff;
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #b366e8 0%, var(--accent-purple) 100%);
    color: #fff;
    box-shadow: 0 0 25px rgba(157, 78, 221, 0.5);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-secondary:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.2);
}

.btn-success { 
    background: var(--success-color); 
    color: #fff;
    margin-left: 5px;
    margin-right: 5px;
}
.btn-danger { background: var(--error-color); color: #fff; }
.btn-warning { background: var(--warning-color); color: #000; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-warning-outline {
    background: transparent;
    border: 1px solid var(--warning-color);
    color: var(--warning-color);
    margin-left: 5px;
    margin-right: 5px;
}
.btn-warning-outline:hover {
    background: rgba(245, 158, 11, 0.1);
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 1rem; }

/* ========================================
   FORMS
   ======================================== */
.form-group { margin-bottom: var(--space-lg); }

.form-text {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.2), 0 0 15px rgba(157, 78, 221, 0.1);
}

.form-control::placeholder { 
    color: var(--text-tertiary); 
    font-family: inherit;
}

select.form-control {
    appearance: none;
    background: rgba(0, 0, 0, 0.5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0a0b0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E") no-repeat right 1rem center;
    padding-right: 2.5rem;
    font-family: inherit;
    color-scheme: dark;
}

select.form-control option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Style select placeholder option */
select.form-control option[value=""] {
    color: var(--text-tertiary);
}

/* Style select when showing placeholder (requires :has support or JS) */
select.form-control:invalid,
select.form-control.placeholder-shown {
    color: var(--text-tertiary);
}

select.form-control:valid:not(.placeholder-shown) {
    color: var(--text-primary);
}

textarea.form-control { 
    resize: vertical; 
    min-height: 100px; 
    font-family: inherit;
}

/* Global select option styling for dark theme */
select {
    color-scheme: dark;
}

select option,
select.form-control option,
.form-control option,
.contact-card select option,
.input-with-icon select option,
.challenge-form select option {
    background: var(--bg-secondary) !important;
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Generic checkbox styling for dark mode */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
}

input[type="checkbox"]:hover {
    border-color: var(--accent-purple);
}

input[type="checkbox"]:checked {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Generic radio button styling for dark mode */
input[type="radio"] {
    width: 18px;
    height: 18px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
}

input[type="radio"]:hover {
    border-color: var(--accent-purple);
}

input[type="radio"]:checked {
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--accent-purple);
}

input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--accent-purple);
    border-radius: 50%;
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    border-left: 4px solid;
}

.alert-success { background: rgba(34, 197, 94, 0.1); border-color: var(--success-color); color: var(--success-color); }
.alert-danger { background: rgba(239, 68, 68, 0.1); border-color: var(--error-color); color: var(--error-color); }
.alert-warning { background: rgba(245, 158, 11, 0.1); border-color: var(--warning-color); color: var(--warning-color); }
.alert-info { background: rgba(157, 78, 221, 0.1); border-color: var(--accent-purple); color: var(--accent-purple); }

/* ========================================
   PAGE HEADER WITH PURPLE GLOW
   ======================================== */
.page-header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    animation: glitchIn 0.8s ease-out;
}

.page-header .subtitle {
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   CARDS & PANELS WITH PURPLE GLOW
   ======================================== */
.card, .panel {
    background: var(--card-gradient);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 0 30px rgba(157, 78, 221, 0.05);
    animation: fadeInUp 0.5s ease-out;
}

.card:hover, .panel:hover {
    border-color: rgba(157, 78, 221, 0.3);
    box-shadow: 0 0 40px rgba(157, 78, 221, 0.1);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 { margin: 0; font-size: 1rem; }
.panel-body { padding: var(--space-lg); }

/* ========================================
   PILLS & BADGES
   ======================================== */
.pill {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ========================================
   STATS GRID
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    background: var(--card-gradient);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.05);
    animation: fadeInUp 0.5s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.25s; }
.stat-card:nth-child(5) { animation-delay: 0.3s; }

.stat-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(157, 78, 221, 0.15);
}

.stat-icon { font-size: 1.5rem; margin-bottom: var(--space-sm); }
.stat-value { font-family: 'Rajdhani', sans-serif; font-size: 2rem; font-weight: 700; color: var(--accent-orange); }
.stat-label { color: var(--text-tertiary); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* ========================================
   LIVE TERMINAL BACKGROUND
   ======================================== */
.live-terminal {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    padding: var(--space-md);
}

.terminal-session {
    color: var(--terminal-color);
    opacity: 0.35;
    white-space: pre-wrap;
    word-break: break-all;
}

.cursor-live {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: var(--terminal-color);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Subtle scanline overlay - simplified to avoid visual artifacts */
.live-terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 0, 0, 0.05) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1;
}

/* CRT Screen subtle glow */
.live-terminal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(157, 78, 221, 0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: 2;
}

/* ========================================
   FILTERS BAR - FIXED ALIGNMENT
   ======================================== */
.filters-bar, .filters-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1b69 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.4s ease-out;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.filter-group label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select, .filter-group input[type="text"], .filter-group input[type="search"] {
    padding: 0.6rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 150px;
    height: 42px;
}

.filter-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.filter-group.search-group { flex: 1; min-width: 200px;  }
.filter-group.search-group input { width: 100%; }

/* Filter buttons aligned */
.filter-group .btn { height: 42px; }

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.4s ease-out 0.1s backwards;
}

.category-pill {
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.category-pill:hover, .category-pill.active {
    border-color: var(--accent-purple);
    color: #ffffff;
    background: rgba(157, 78, 221, 0.3);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.2);
}

/* ========================================
   CHALLENGE GRID & CARDS
   ======================================== */
.challenge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: var(--space-lg);
}

.challenge-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1b69 100%); /* var(--card-gradient); */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.05);
    animation: fadeInUp 0.4s ease-out backwards;
}

.challenge-card:nth-child(1) { animation-delay: 0.05s; }
.challenge-card:nth-child(2) { animation-delay: 0.1s; }
.challenge-card:nth-child(3) { animation-delay: 0.15s; }
.challenge-card:nth-child(4) { animation-delay: 0.2s; }
.challenge-card:nth-child(5) { animation-delay: 0.25s; }
.challenge-card:nth-child(6) { animation-delay: 0.3s; }
.challenge-card:nth-child(n+7) { animation-delay: 0.35s; }

.challenge-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(157, 78, 221, 0.15);
}

.challenge-card.solved { border-left: 4px solid var(--success-color); }

.challenge-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.challenge-card-header .challenge-badges {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.challenge-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Points as pill */
.challenge-xp, .xp-pill {
    background: rgba(255, 107, 53, 0.3);
    color: var(--accent-orange);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-xl);
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 107, 53, 0.4);
}

/* Solved pill */
.solved-pill {
    background: rgba(34, 197, 94, 0.25); 
    color: var(--success-color); 
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-xl); 
    font-size: 0.8rem; 
    font-weight: 700;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.challenge-title {
    font-size: 1.15rem;
    margin-bottom: var(--space-sm);
}

.challenge-title a { color: var(--text-primary); }
.challenge-title a:hover { color: var(--accent-purple); }

.challenge-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
    flex: 1;
}

.challenge-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.challenge-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-xs);
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.challenge-difficulty { display: flex; gap: 2px; }

/* Smaller icons for solves/likes */
.challenge-stats {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.8rem;
}

.challenge-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.challenge-stats .icon { font-size: 0.9rem; }

/* Author smaller */
.challenge-author {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.challenge-author a { color: var(--accent-purple); font-size: 0.75rem; }

/* ========================================
   CHALLENGE DETAIL PAGE
   ======================================== */
.challenge-detail {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.challenge-detail .breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.challenge-detail .breadcrumb a {
    color: var(--accent-purple);
}

.challenge-detail .breadcrumb .separator {
    color: var(--text-tertiary);
}

.challenge-detail .breadcrumb .current {
    color: var(--text-primary);
}

.challenge-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-xl);
}

.challenge-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    min-width: 0;
}

.challenge-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    min-width: 0;
}

.challenge-header-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1b69 100%); /* var(--card-gradient); */
    border: 1px solid var(--border-color);

  
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.challenge-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.category-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.challenge-difficulty {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.challenge-difficulty .stars {
    font-size: 1.5rem;
    padding-bottom: 4px;
}

.challenge-difficulty .stars .difficulty-stars {
    font-size: 1.5rem;
}

.challenge-difficulty .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.difficulty{
    font-size: 1.5rem;
}

/* Difficulty Stars - universal styling */
.difficulty-stars {
    font-size: 1.4rem;
    letter-spacing: 1px;
    white-space: nowrap;
}

.difficulty-1 { color: #22c55e; } /* Green - Beginner */
.difficulty-2 { color: #84cc16; } /* Lime - Easy */
.difficulty-3 { color: #eab308; } /* Yellow - Moderate */
.difficulty-4 { color: #f97316; } /* Orange - Hard */
.difficulty-5 { color: #ef4444; } /* Red - Expert */

.challenge-title {
    font-size: 1.75rem;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-shadow: 0 0 15px rgba(157, 78, 221, 0.3);
}

.solved-badge {
    font-size: 0.85rem;
    padding: var(--space-xs) var(--space-sm);
    background: rgba(34, 197, 94, 0.25);
    color: var(--success-color);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(34, 197, 94, 0.4);
    font-weight: 700;
}

.challenge-meta {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    color: var(--text-secondary);
}

.challenge-meta .meta-item strong {
    color: var(--accent-orange);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover,
.action-btn.liked {
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Panels */
.panel {
    background: var(--card-gradient);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Panel with direct h3 (admin forms) - add padding */
.panel > h3 {
    padding: var(--space-md) var(--space-lg);
    margin: 0;
    font-size: 1rem;
    color: var(--accent-orange);
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.panel > h3 + .form-group,
.panel > h3 + .form-text,
.panel > h3 + p,
.panel > h3 + .info-list,
.panel > h3 + .form-row {
    padding-top: var(--space-lg);
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
}

.panel > .form-group,
.panel > .form-row,
.panel > .form-text,
.panel > .info-list {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
}

.panel > .form-group:last-child,
.panel > .form-row:last-child,
.panel > div:last-child {
    padding-bottom: var(--space-lg);
}

.panel-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.panel-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.panel-body {
    padding: var(--space-lg);
}

.challenge-description {
    color: var(--text-secondary);
    line-height: 1.8;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Code blocks and inline code */
.challenge-description code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.2em 0.5em;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: var(--accent-cyan);
    border: 1px solid var(--border-color);
}

.challenge-description pre {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-purple);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-md) 0;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.challenge-description pre code {
    background: none;
    padding: 0;
    border: none;
    border-radius: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--accent-cyan);
    display: block;
    white-space: pre;
}

.challenge-description strong {
    color: var(--text-primary);
    font-weight: 600;
}

.challenge-description em {
    color: var(--text-secondary);
    font-style: italic;
}

.challenge-resources {
    margin-top: var(--space-lg);
}

.challenge-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

/* Flag form */
.flag-panel.solved {
    border-color: var(--success-color);
}

.flag-panel.solved .panel-header {
    background: rgba(34, 197, 94, 0.1);
}

.flag-input-group {
    display: flex;
    gap: var(--space-md);
}

.flag-input-group input {
    flex: 1;
    font-family: 'Source Code Pro', monospace;
    letter-spacing: 0.5px;
}

.flag-result {
    margin-top: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    display: none;
}

.flag-result.success {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.flag-result.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

/* Hints */
.hints-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.hint-item {
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--border-color);
}

.hint-item.unlocked {
    border-left-color: var(--success-color);
}

.hint-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.hint-number {
    font-weight: 600;
    color: var(--text-primary);
}

.hint-cost {
    background: rgba(255, 107, 53, 0.15);
    color: var(--accent-orange);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 107, 53, 0.25);
}

.hint-content {
    color: var(--text-secondary);
}

.hint-content code {
    background: rgba(157, 78, 221, 0.2);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9em;
    color: var(--primary);
}

.hint-content kbd {
    background: var(--dark-light);
    padding: 0.2em 0.5em;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 0 var(--border-color);
}

/* Comments */
.comments-section .comment-form {
    margin-bottom: var(--space-lg);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Remove top margin when comments-list follows text-muted (no form shown) */
.panel-body > p.text-muted + .comments-list {
    margin-top: var(--space-md);
}

/* Reset margin for the "solve to comment" message */
.panel-body > p.text-muted {
    margin: 0;
}

.comment {
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.comment-author {
    color: var(--accent-purple);
    font-weight: 500;
}

.comment-time {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.comment-content {
    color: var(--text-secondary);
}

/* Sidebar panels */
.blood-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--accent-purple);
}

.blood-icon {
    font-size: 1.2rem;
}

.blood-time {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-top: var(--space-xs);
}

.solvers-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.solver-item {
    display: flex;
    align-items: center;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: background 0.3s ease;
    gap: var(--space-sm);
}

.solver-item:hover {
    background: rgba(157, 78, 221, 0.1);
}

.solver-name {
    color: var(--accent-purple);
    text-decoration: none;
}

.solver-name:hover {
    text-decoration: underline;
}

.solver-item .first-blood-badge {
    flex-shrink: 0;
}

.solver-time {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    margin-left: auto;
}

.author-card {
    display: block;
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    transition: background 0.3s ease;
    text-decoration: none;
}

.author-card:hover {
    background: rgba(157, 78, 221, 0.1);
}

.author-name {
    color: var(--text-primary);
    font-weight: 500;
}

.author-username {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.stat-value-sm {
    color: var(--accent-orange);
    font-weight: 600;
    font-size: 1rem;
}


/* Responsive challenge detail */
@media (max-width: 900px) {
    .challenge-layout {
        grid-template-columns: 1fr;
    }
    
    .challenge-sidebar {
        order: -1;
    }
}

/* ========================================
   SCOREBOARD - FIXED WITH PILLS
   ======================================== */
.scoreboard-filters {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.4s ease-out;
}

.scoreboard-filter-pill {
    padding: var(--space-sm) var(--space-lg);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.scoreboard-filter-pill:hover, .scoreboard-filter-pill.active {
    border-color: var(--accent-purple);
    color: #ffffff;
    background: rgba(157, 78, 221, 0.3);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.2);
}

.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: var(--space-xl);
    margin-bottom: var(--space-xxl);
    padding: var(--space-xl) 0;
}

.podium-place {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1b69 100%); /* var(--card-gradient); */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    width: 240px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out backwards;
}

.podium-place.second { animation-delay: 0.1s; }
.podium-place.first { animation-delay: 0.2s; }
.podium-place.third { animation-delay: 0.3s; }

.podium-place:hover { border-color: var(--accent-purple); box-shadow: var(--glow-purple); }
.podium-place.first { transform: scale(1.1); border-color: #ffd700; box-shadow: 0 0 30px rgba(255, 215, 0, 0.2); }
.podium-place.second { border-color: #c0c0c0; }
.podium-place.third { border-color: #cd7f32; }

.podium-rank { font-size: 2.5rem; margin-bottom: var(--space-sm); }
.podium-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-round);
    margin: 0 auto var(--space-md);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
}
.podium-avatar img { width: 100%; height: 100%; object-fit: cover; }
.podium-name { font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-xs); }
.podium-name a { color: inherit; }
.podium-xp { color: var(--accent-orange); font-weight: 700; font-family: 'Rajdhani', sans-serif; font-size: 1.25rem; }

/* Scoreboard table with rounded border */
.scoreboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1b69 100%); /* var(--card-gradient); */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

.scoreboard-table .xp-col {
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    color: var(--accent-orange);
    font-weight: 700;
}

.scoreboard-table .rank-col,
.scoreboard-table .level-col,
.scoreboard-table .solves-col,
.scoreboard-table .fb-col {
    text-align: center;
}

.scoreboard-table th, .scoreboard-table td {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.scoreboard-table th.rank-col,
.scoreboard-table th.level-col,
.scoreboard-table th.solves-col,
.scoreboard-table th.fb-col,
.scoreboard-table th.xp-col,
.scoreboard-table td.rank-col,
.scoreboard-table td.level-col,
.scoreboard-table td.solves-col,
.scoreboard-table td.fb-col,
.scoreboard-table td.xp-col {
    text-align: center;
}

.scoreboard-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--accent-purple);
    font-weight: 600;
}

.scoreboard-table tr:hover { background: rgba(157, 78, 221, 0.05); }
.scoreboard-table tr:last-child td { border-bottom: none; }

.rank-cell { font-weight: 700; color: var(--text-tertiary); width: 60px; }
.rank-cell.top-3 { font-size: 1.2rem; }

.user-cell { display: flex; align-items: center; gap: var(--space-md); }
.user-cell .avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-round);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}
.user-cell .avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-cell .username { color: var(--text-primary); font-weight: 600; }
.user-cell .username a { color: inherit; }
.user-cell .username a:hover { color: var(--accent-purple); }

.xp-cell { color: var(--accent-orange); font-weight: 700; font-family: 'Rajdhani', sans-serif; font-size: 1.1rem; }
.solves-cell { color: var(--text-secondary); }

/* ========================================
   USERS GRID - FIXED
   ======================================== */

/* Alphabet Filter */
.alphabet-filter {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
    justify-content: center;
}

.letter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 var(--space-xs);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.letter-pill:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    background: rgba(157, 78, 221, 0.1);
}

.letter-pill.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.user-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1b69 100%); /* var(--card-gradient); */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.05);
    animation: fadeInUp 0.4s ease-out backwards;
}

.user-card:nth-child(1) { animation-delay: 0.05s; }
.user-card:nth-child(2) { animation-delay: 0.1s; }
.user-card:nth-child(3) { animation-delay: 0.15s; }
.user-card:nth-child(4) { animation-delay: 0.2s; }
.user-card:nth-child(5) { animation-delay: 0.25s; }
.user-card:nth-child(6) { animation-delay: 0.3s; }
.user-card:nth-child(n+7) { animation-delay: 0.35s; }

.user-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(157, 78, 221, 0.15);
}

.user-card .avatar {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-round);
    margin: 0 auto var(--space-md);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
}
.user-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-card .display-name { font-weight: 600; color: var(--text-primary); margin-bottom: 0; font-size: 1rem; }
.user-card .username { color: var(--accent-purple); font-size: 0.85rem; margin-bottom: var(--space-sm); }
.user-card .username a { color: inherit; }
.user-card .user-stats { font-size: 0.85rem; color: var(--text-secondary); display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; justify-content: center; }
.user-card .user-stats .xp-pill { 
    background: rgba(255, 107, 53, 0.2);
    color: var(--accent-orange);
    padding: 2px 8px;
    border-radius: var(--radius-xl);
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 107, 53, 0.3);
}
.user-card .user-stats .solves { color: var(--success-color); }
.user-card .level-badge { 
    background: rgba(157, 78, 221, 0.2); 
    color: var(--accent-purple); 
    padding: var(--space-xs) var(--space-sm); 
    border-radius: var(--radius-sm); 
    font-size: 0.75rem; 
    margin-right: var(--space-xs);
}

.level-badge {
  display: inline-block;
  background: rgba(157, 78, 221, 0.2);
  color: var(--accent-purple);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.rank-1 {
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.rank-3 {
  color: #cd7f32;
  text-shadow: 0 0 10px rgba(205, 127, 50, 0.2);
}

.rank-2 {
  color: #c0c0c0;
  text-shadow: 0 0 10px rgba(192, 192, 192, 0.2);
}

/* ========================================
   AUTH PAGES
   ======================================== */
.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
/*    padding: var(--space-xl) var(--space-md); */
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

.auth-page .page-header {
    width: 100%;
    text-align: center;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--card-gradient);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xxl) var(--space-xl);
    box-shadow: 0 0 40px rgba(157, 78, 221, 0.1);
    animation: fadeInUp 0.5s ease-out;
}

/* Auth form font consistency */
.auth-form .form-label {
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.auth-form .form-control,
.auth-form .form-control::placeholder {
    font-family: inherit;
    font-size: 1rem;
}

.auth-form .form-control::placeholder {
    color: var(--text-tertiary);
}

/* Make form inputs larger */
.auth-form .form-control {
    padding: var(--space-md) var(--space-lg);
}

/* Input with icon styling */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon .input-icon {
    position: absolute;
    left: var(--space-md);
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SVG Icons for inputs */
.input-with-icon .input-icon.icon-email::before {
    content: '';
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='M22 6l-10 7L2 6'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='M22 6l-10 7L2 6'/%3E%3C/svg%3E") center/contain no-repeat;
}

.input-with-icon .input-icon.icon-lock::before {
    content: '';
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0110 0v4'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0110 0v4'/%3E%3C/svg%3E") center/contain no-repeat;
}

.input-with-icon .input-icon.icon-user::before {
    content: '';
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M5.5 21a8.5 8.5 0 0113 0'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M5.5 21a8.5 8.5 0 0113 0'/%3E%3C/svg%3E") center/contain no-repeat;
}

.input-with-icon .input-icon.icon-clipboard::before {
    content: '';
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='4' y='4' width='16' height='18' rx='2'/%3E%3Cpath d='M9 4V2h6v2'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='4' y='4' width='16' height='18' rx='2'/%3E%3Cpath d='M9 4V2h6v2'/%3E%3C/svg%3E") center/contain no-repeat;
}

.input-with-icon .input-icon.icon-message::before {
    content: '';
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.input-with-icon .form-control {
    padding-left: 2.75rem;
}

.input-with-icon select.form-control {
    padding-left: 2.75rem;
}

.input-with-icon select.form-control option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.input-with-icon--textarea {
    align-items: flex-start;
}

.input-with-icon--textarea .input-icon {
    top: var(--space-md);
}

.input-with-icon--textarea .form-control {
    padding-left: 2.75rem;
}

/* Password toggle button */
.password-toggle {
    position: absolute;
    right: var(--space-sm);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs) var(--space-sm);
    color: var(--text-tertiary);
    transition: color 0.2s;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.password-toggle .eye-icon {
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center/contain no-repeat;
    display: block;
}

.password-toggle.revealed .eye-icon {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Fallback for browsers that don't support :has() */
.input-with-icon input[type="password"],
.input-with-icon input[type="text"] {
    padding-right: 3rem;
}

.auth-form .btn-block {
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
}

.auth-header { text-align: center; margin-bottom: var(--space-xl); }
.auth-header h1 { font-size: 1.75rem; margin-bottom: var(--space-sm); text-shadow: 0 0 15px rgba(157, 78, 221, 0.3); }
.auth-header p { color: var(--text-secondary); margin: 0; }

.auth-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
}
.auth-form .checkbox-label input[type="checkbox"] { 
    width: 18px; 
    height: 18px; 
    accent-color: var(--accent-purple);
    cursor: pointer;
    /* Custom checkbox styling for dark mode */
    appearance: none;
    -webkit-appearance: none;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}
.auth-form .checkbox-label input[type="checkbox"]:hover {
    border-color: var(--accent-purple);
}
.auth-form .checkbox-label input[type="checkbox"]:checked {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}
.auth-form .checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}
.auth-form .checkbox-label a { color: var(--accent-purple); }
.auth-form .checkbox-group { margin-bottom: var(--space-md); }

.auth-footer {
    text-align: center;
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
    color: var(--text-tertiary);
}
.auth-footer a { color: var(--accent-purple); margin-left: var(--space-sm); }
.auth-footer a.btn-primary { color: #fff; margin-left: 0; }
.auth-footer a.btn-primary:hover { color: #fff; }

.auth-links { 
    display: flex; 
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md); 
    font-size: 0.9rem; 
    border-top: 1px solid var(--border-color);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}
.auth-links a { color: var(--accent-purple); }

.comment-text { color: var(--text-comment); padding-left:4px; }

/* ========================================
   CONTACT PAGE
   ======================================== */
.contact-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl) var(--space-md);
    width: 100%;
}

.contact-success {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}
.contact-success .success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
}
.contact-success h2 {
    color: var(--success);
    margin-bottom: var(--space-sm);
}
.contact-success p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.contact-card {
    width: 100%;
    max-width: 700px;
    background: var(--card-gradient);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xxl) var(--space-xl);
    box-shadow: 0 0 40px rgba(157, 78, 221, 0.1);
    animation: fadeInUp 0.5s ease-out;
}

.contact-card .form-label {
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
}

.contact-card .form-control,
.contact-card .form-control::placeholder {
    font-family: inherit;
    font-size: 1rem;
}

.contact-card .form-control::placeholder {
    color: var(--text-tertiary);
}

.contact-card .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.contact-card textarea.form-control {
    min-height: 180px;
    resize: vertical;
}

.contact-card select.form-control option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .contact-card .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   DASHBOARD
   ======================================== */
.dashboard { margin-bottom: var(--space-xl); }
.dashboard-grid { display: grid; grid-template-columns: 1fr 350px; gap: var(--space-xl); }
.dashboard-sidebar { display: flex; flex-direction: column; gap: var(--space-lg); }

.hero-section { margin-bottom: var(--space-xl); text-align: center; }
.hero-title { font-size: 2.5rem; margin-bottom: var(--space-sm); text-shadow: 0 0 30px rgba(157, 78, 221, 0.4); animation: fadeInUp 0.6s ease-out; }
.hero-title .highlight { color: var(--accent-purple); }
.hero-subtitle { color: var(--text-secondary); margin-bottom: var(--space-lg); padding: 0; animation: fadeInUp 0.6s ease-out 0.1s backwards; }
.hero-actions { display: flex; gap: var(--space-md); margin-bottom: 60px; animation: fadeInUp 0.5s ease-out 0.2s backwards; }

.user-progress-section { margin-bottom: var(--space-xl); }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-md); animation: fadeInUp 0.4s ease-out; }
.section-header h2 { margin: 0; text-shadow: 0 0 15px rgba(157, 78, 221, 0.3); }
.view-all { color: var(--accent-purple); font-size: 0.9rem; }

/* Dashboard Challenge List */
.challenge-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.challenge-list-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-md) var(--space-lg);
    padding-top: calc(var(--space-md) + 3px);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease-out backwards;
}

.challenge-list-item:nth-child(1) { animation-delay: 0.05s; }
.challenge-list-item:nth-child(2) { animation-delay: 0.1s; }
.challenge-list-item:nth-child(3) { animation-delay: 0.15s; }
.challenge-list-item:nth-child(4) { animation-delay: 0.2s; }
.challenge-list-item:nth-child(5) { animation-delay: 0.25s; }
.challenge-list-item:nth-child(n+6) { animation-delay: 0.3s; }
.challenge-list-item:hover { border-color: var(--accent-purple); background: rgba(157, 78, 221, 0.05); }
.challenge-list-item.solved { border-left: 3px solid var(--success-color); }
.challenge-list-item .challenge-top-row { display: flex; justify-content: space-between; align-items: flex-start; }
.challenge-list-item .challenge-category { 
    font-size: 0.7rem; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 600;
}
.challenge-list-item .challenge-badges { display: flex; align-items: center; gap: var(--space-sm); margin-top: 2px; }
.challenge-list-item .solved-pill { 
    background: rgba(34, 197, 94, 0.25); 
    color: var(--success-color); 
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-xl); 
    font-size: 0.8rem; 
    font-weight: 700;
    border: 1px solid rgba(34, 197, 94, 0.4);
    margin-right: 2px;
}
.challenge-list-item .challenge-title, .challenge-list-item h4 { color: var(--text-primary); font-weight: 600; margin: var(--space-xs) 0 0 0; font-size: 1rem; font-family: 'Rajdhani', sans-serif; }
.challenge-list-item .challenge-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--text-tertiary); margin-top: 12px; }

/* Dashboard Sidebar */
.category-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.category-item { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm); border-radius: var(--radius-md); text-decoration: none; transition: all 0.3s ease; }
.category-item:hover { background: rgba(157, 78, 221, 0.1); }
.category-item .category-icon { font-size: 1.2rem; }
.category-item .category-name { flex: 1; color: var(--text-primary); }
.category-item .category-count { padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 600; }

.leaderboard-mini { display: flex; flex-direction: column; gap: var(--space-sm); }
.leaderboard-item { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm); border-radius: var(--radius-md); text-decoration: none; transition: all 0.3s ease; }
.leaderboard-item:hover { background: rgba(157, 78, 221, 0.1); }
.leaderboard-item .rank { font-size: 1.2rem; width: 30px; text-align: center; }
.leaderboard-item .player-name { flex: 1; color: var(--text-primary); }
.leaderboard-item .player-xp { color: var(--accent-orange); font-weight: 600; }

.quick-links { display: flex; flex-direction: column; gap: var(--space-sm); }
.quick-link { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm); border-radius: var(--radius-md); color: var(--text-secondary); text-decoration: none; transition: all 0.3s ease; }
.quick-link:hover { background: rgba(157, 78, 221, 0.1); color: var(--accent-purple); }

/* User Progress */
.progress-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); margin-bottom: var(--space-lg); }
.progress-stat { text-align: center; padding: var(--space-md); background: rgba(0, 0, 0, 0.2); border-radius: var(--radius-md); }
.progress-value { font-family: 'Rajdhani', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--accent-orange); }
.progress-label { font-size: 0.8rem; color: var(--text-tertiary); text-transform: uppercase; }
.category-progress h4 { margin-bottom: var(--space-md); color: var(--text-secondary); font-size: 0.9rem; }
.category-bars { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.category-bar { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-sm); background: rgba(0, 0, 0, 0.2); border-radius: var(--radius-sm); font-size: 0.85rem; }
.category-bar .category-name { color: var(--text-secondary); }

/* Announcements */
.announcements-section { margin-bottom: var(--space-xl); animation: fadeInUp 0.4s ease-out; }
.announcement {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.1) 0%, rgba(255, 107, 53, 0.05) 100%);
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.1);
    animation: fadeInUp 0.4s ease-out backwards;
}

.announcement:nth-child(1) { animation-delay: 0.1s; }
.announcement:nth-child(2) { animation-delay: 0.15s; }
.announcement:nth-child(3) { animation-delay: 0.2s; }
.announcement-pin { margin-right: var(--space-sm); }
.announcement-content h4 { color: var(--accent-orange); margin-bottom: var(--space-sm); }
.announcement-content p { color: var(--text-secondary); margin: 0; }
.announcement-meta { color: var(--text-tertiary); font-size: 0.85rem; margin-top: var(--space-sm); }

/* Welcome Section */
.welcome-section {
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.5s ease-out;
}

.welcome-card {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(157, 78, 221, 0.08) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.1);
}

.welcome-card h3 {
    color: var(--success-color);
    margin-bottom: var(--space-md);
    font-size: 1.4rem;
}

.welcome-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.welcome-card .category-highlights {
    list-style: none;
    padding: 0;
    margin: var(--space-md) 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-sm);
}

.welcome-card .category-highlights li {
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.welcome-card .category-highlights li strong {
    color: var(--accent-purple);
}

.welcome-card .welcome-reminder {
    color: var(--text-tertiary);
    font-size: 0.95rem;
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-md);
    margin-bottom: 0;
}

/* ========================================
   CONTENT PAGES
   ======================================== */
.content-page {
    max-width: 1200px;
    margin: 0 auto;
}

.content-page h2 {
    font-size: 1.5rem;
    margin: var(--space-xl) 0 var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-shadow: 0 0 15px rgba(157, 78, 221, 0.3);
    animation: fadeInUp 0.4s ease-out;
}

.content-page h3 { font-size: 1.25rem; margin: var(--space-lg) 0 var(--space-md); }
.content-page p { color: var(--text-secondary); line-height: 1.7; font-size: 1rem; margin-bottom: var(--space-md); }
.content-page ol, .content-page ul { color: var(--text-secondary); line-height: 1.7; font-size: 1rem; margin-bottom: var(--space-md); padding-left: var(--space-xl); }
.content-page li { margin-bottom: var(--space-sm); }
.content-page li strong { color: var(--accent-purple); }

/* FAQ Accordion */
.faq-section { margin-bottom: var(--space-xl); }
.faq-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    overflow: hidden;
    animation: fadeInUp 0.4s ease-out backwards;
}

.faq-item:nth-child(1) { animation-delay: 0.05s; }
.faq-item:nth-child(2) { animation-delay: 0.1s; }
.faq-item:nth-child(3) { animation-delay: 0.15s; }
.faq-item:nth-child(4) { animation-delay: 0.2s; }
.faq-item:nth-child(5) { animation-delay: 0.25s; }
.faq-item:nth-child(n+6) { animation-delay: 0.3s; }
.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.3s ease;
}
.faq-question:hover { background: rgba(157, 78, 221, 0.1); }
.faq-icon { color: var(--accent-purple); transition: transform 0.3s ease; font-size: 1.2rem; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 var(--space-lg);
    color: var(--text-secondary);
    line-height: 1.6;
}
.faq-item.open .faq-answer { max-height: 500px; padding: var(--space-md) var(--space-lg) var(--space-lg); }

/* Contact Page */
.contact-form {
    background: var(--card-gradient);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: 0 0 30px rgba(157, 78, 221, 0.08);
}
.contact-form h3 { color: var(--accent-purple); margin-bottom: var(--space-lg); }
.contact-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-lg); }
.contact-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-purple);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}
.contact-item h4 { color: var(--text-primary); margin-bottom: var(--space-sm); }
.contact-item p { color: var(--text-secondary); font-size: 0.9rem; margin: 0; }

/* Contribute Page */
.contribute-card {
    background: var(--card-gradient);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    box-shadow: 0 0 30px rgba(157, 78, 221, 0.08);
    animation: fadeInUp 0.4s ease-out backwards;
}

.contribute-card:nth-of-type(1) { animation-delay: 0.1s; }
.contribute-card:nth-of-type(2) { animation-delay: 0.15s; }
.contribute-card:nth-of-type(3) { animation-delay: 0.2s; }
.contribute-card:nth-of-type(4) { animation-delay: 0.25s; }
.contribute-card:nth-of-type(5) { animation-delay: 0.3s; }
.contribute-card h3 { color: var(--accent-purple); margin-bottom: var(--space-md); }
.contribute-card p { color: var(--text-secondary); line-height: 1.6; }
.contribute-card ul { color: var(--text-secondary); margin-left: var(--space-lg); }
.contribute-card li { margin-bottom: var(--space-sm); }

/* ========================================
   PROFILE PAGE
   ======================================== */
.profile-page {
    max-width: 1000px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
    padding: var(--space-xl);
    background: var(--card-gradient);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 30px rgba(157, 78, 221, 0.08);
    position: relative;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-round);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(157, 78, 221, 0.3);
}

.profile-avatar .avatar-placeholder {
    font-size: 2.5rem;
    font-weight: 600;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; }

.profile-name { 
    font-size: 2rem; 
    margin-bottom: var(--space-xs); 
    display: inline-flex;
    align-items: center; 
    gap: var(--space-sm); 
}

.profile-username { color: var(--text-tertiary); margin-bottom: var(--space-sm); }

.profile-level {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    margin-bottom: var(--space-md);
}

.profile-level .level-badge {
    background: rgba(157, 78, 221, 0.2);
    color: var(--accent-purple);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.profile-level .xp-points {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-orange);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
}

.profile-bio {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.6;
    padding: 0;
}

.profile-links {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.profile-link-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
}

.profile-link {
    color: var(--accent-purple);
    text-decoration: none;
    font-size: 0.9rem;
}

.profile-link:hover {
    text-decoration: underline;
}

.profile-meta {
    display: flex;
    gap: var(--space-lg);
    color: var(--text-tertiary);
    font-size: 0.9rem;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.profile-actions {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    display: flex;
    gap: var(--space-sm);
}

/* Profile Stats Grid */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.profile-stats .stat-card {
    background: var(--card-gradient);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
}

.profile-stats .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-orange);
    margin-bottom: var(--space-xs);
}

.profile-stats .stat-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* Category Breakdown */
.category-breakdown {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.category-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.category-row .cat-name {
    min-width: 100px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.category-row .cat-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.category-row .cat-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.category-row .cat-count {
    min-width: 30px;
    text-align: right;
    color: var(--accent-orange);
    font-weight: 600;
    font-size: 1rem;
}

/* Profile Solves Table */
.solves-table {
    overflow-x: auto;
}

.solves-table table {
    width: 100%;
    border-collapse: collapse;
}

.solves-table th {
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.solves-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.solves-table tr:last-child td {
    border-bottom: none;
}

.solves-table tr:hover td {
    background: rgba(157, 78, 221, 0.05);
}

.solves-table a {
    color: var(--accent-purple);
    text-decoration: none;
    font-size: 0.95rem;
}

.solves-table a:hover {
    text-decoration: underline;
}

.solves-table .difficulty-stars {
    font-size: 1.2rem;
    letter-spacing: 1px;
}

/* Badges Grid */
.badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.badge-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    cursor: default;
    transition: background 0.3s ease, transform 0.2s ease;
}

.badge-item:hover {
    background: rgba(157, 78, 221, 0.15);
    transform: translateY(-1px);
}

.badge-item .badge-icon {
    font-size: 1.2rem;
}

.badge-item .badge-name {
    color: var(--text-primary);
    font-size: 0.95rem;
}

@media (max-width: 900px) {
    .profile-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .profile-actions {
        position: static;
        margin-top: var(--space-md);
    }
    .profile-links, .profile-meta {
        justify-content: center;
    }
}

/* Challenges Created List */
.created-challenges-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.created-challenge {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.2s ease;
}

.created-challenge:hover {
    background: rgba(157, 78, 221, 0.15);
}

.created-challenge .category-badge {
    min-width: 80px;
    text-align: center;
}

.created-challenge .ch-title {
    flex: 1;
    color: var(--text-primary);
    font-size: 1rem;
}

.created-challenge .ch-xp {
    color: var(--accent-orange);
    font-weight: 600;
    font-size: 0.95rem;
}

/* ========================================
   EMPTY STATES
   ======================================== */
.empty-state {
    text-align: center;
    padding: 4rem var(--space-xl);
    color: var(--text-tertiary);
}
.empty-icon { font-size: 4rem; margin-bottom: var(--space-md); opacity: 0.5; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: var(--space-sm); }
.empty-state p { margin-bottom: var(--space-lg); }
.empty-actions { display: flex; gap: var(--space-md); justify-content: center; flex-wrap: wrap; }

/* ========================================
   FOOTER - STICKY
   ======================================== */
.footer {
    background: var(--footer-bg);
    padding: var(--space-xl) 0 var(--space-md);
    margin-top: auto;
    
    
    border-top: 1px solid var(--accent-purple);
  background: linear-gradient(135deg, rgba(13, 13, 13, 0.98) 0%, rgba(26, 26, 26, 0.98) 50%, rgba(45, 27, 105, 0.5) 100%);
}

.footer-content {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-xl);
}

.footer-brand { max-width: 250px; }
.footer-logo { font-family: 'Rajdhani', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--accent-purple); text-shadow: 0 0 10px rgba(157, 78, 221, 0.4); padding-left:var(--space-md) }
.footer-brand p { color: var(--text-tertiary); font-size: 0.9rem; margin-top: var(--space-sm); }

.footer-links { display: flex; gap: var(--space-xxl); flex-wrap: wrap; }
.footer-column h4 { color: var(--text-primary); font-size: 0.9rem; margin-bottom: var(--space-md); text-transform: uppercase; letter-spacing: 1px; }
.footer-column a { display: block; color: var(--text-tertiary); font-size: 0.85rem; margin-bottom: var(--space-sm); transition: color 0.3s ease; }
.footer-column a:hover { color: var(--accent-purple); }

.footer-bottom {
    max-width: 1800px;
    margin: var(--space-xl) auto 0;
    padding: var(--space-md) var(--space-xl) 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .progress-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    body { padding-top: 60px; }
    .main-header { height: 60px; padding: var(--space-sm) var(--space-md); }
    .main-nav { flex-wrap: wrap; }
    .nav-menu, .nav-auth { display: none; }
    
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: var(--space-sm);
        background: transparent;
        border: none;
        cursor: pointer;
    }
    .mobile-menu-toggle span { display: block; width: 24px; height: 2px; background: var(--text-secondary); }
    
    .mobile-menu {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(13, 13, 13, 0.98);
        border-bottom: 1px solid var(--border-color);
        padding: var(--space-md);
        z-index: 999;
        flex-direction: column;
        gap: var(--space-sm);
    }
    .mobile-menu.open { display: flex; }
    .mobile-menu a { color: var(--text-secondary); padding: 0.75rem var(--space-md); border-radius: var(--radius-md); }
    .mobile-menu a:hover { background: rgba(157, 78, 221, 0.1); color: var(--accent-purple); }
    
    .live-terminal { top: 60px; }
    .container { padding: var(--space-md); }
    .filters-bar, .filters-form { flex-direction: column; align-items: stretch; }
    .filter-group.search-group { max-width: none; }
    .filter-group { width: 100%; }
    .filter-group select, .filter-group input { width: 100%; }
    .challenge-grid, .users-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .podium { flex-direction: column; align-items: center; }
    .podium-place.first { transform: none; order: -1; }
    .footer-content { flex-direction: column; align-items: center; text-align: center; }
    .footer-links { justify-content: center; gap: var(--space-xl); }
    .auth-card { padding: var(--space-lg); }
    .auth-page { padding: var(--space-md); }
    .scoreboard-filters { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .category-pills { justify-content: center; }
    .hero-actions { flex-direction: column; }
    .progress-stats { grid-template-columns: 1fr; }
}

/* ========================================
   CHALLENGE CARD FOOTER - FIXED
   ======================================== */
.challenge-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.challenge-card-header .challenge-badges {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.challenge-card-header .solved-pill {
    background: rgba(34, 197, 94, 0.25); 
    color: var(--success-color); 
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-xl); 
    font-size: 0.8rem; 
    font-weight: 700;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.challenge-category {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.challenge-xp-pill {
    background: rgba(255, 107, 53, 0.3);
    color: var(--accent-orange);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-xl);
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 107, 53, 0.4);
}

.challenge-card-body {
    flex: 1;
}

.challenge-card-body .challenge-title {
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
}

.challenge-card-body .challenge-difficulty {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    font-size: 1rem;
}

.challenge-card-body .challenge-difficulty .label {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.challenge-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.challenge-card-footer .challenge-stats {
    display: flex;
    gap: var(--space-md);
}

.challenge-card-footer .stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.challenge-card-footer .stat-icon {
    font-size: 0.85rem;
}

.challenge-card-footer .challenge-author {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.challenge-card-footer .challenge-author a {
    color: var(--accent-purple);
}

.challenge-tags .tag {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(157, 78, 221, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-right: var(--space-xs);
}

/* Toggle label alignment */
.toggle-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    height: 42px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    /* Custom checkbox styling for dark mode */
    appearance: none;
    -webkit-appearance: none;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-label input[type="checkbox"]:hover {
    border-color: var(--accent-purple);
}

.toggle-label input[type="checkbox"]:checked {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

.toggle-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 11px;
    font-weight: bold;
}

/* ========================================
   SORT PILLS & ADDITIONAL FIXES
   ======================================== */
.sort-pills {
    display: flex;
    gap: var(--space-sm);
    margin-left: auto;
}

.your-rank-banner {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.15) 0%, rgba(255, 107, 53, 0.1) 100%);
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
    max-width: 740px;
    margin-left: auto;
    margin-right: auto;
}

.your-rank-banner .rank-label { color: var(--text-secondary); }
.your-rank-banner .rank-value { font-family: 'Rajdhani', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--accent-purple); }
.your-rank-banner .rank-xp { color: var(--accent-orange); font-weight: 600; margin-left: auto; }

/* Podium score styling */
.podium-score {
    color: var(--accent-orange);
    font-weight: 700;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}

/* Scoreboard container */
.scoreboard-container { margin-bottom: var(--space-xl); }

/* ========================================
   HERO TITLE GLOW EFFECT (v1 style)
   ======================================== */
.hero-brand-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, var(--accent-purple) 0%, #b366e8 50%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 30px rgba(157, 78, 221, 0.5));
    animation: glitchIn 0.8s ease-out, glow-pulse 3s ease-in-out 0.8s infinite alternate;
}

@keyframes glow-pulse {
    from { filter: drop-shadow(0 0 20px rgba(157, 78, 221, 0.4)); }
    to { filter: drop-shadow(0 0 40px rgba(157, 78, 221, 0.7)); }
}

.hero-tagline {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: -10px;
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.btn-block {
    width: 100%;
}

/* ========================================
   SPOILER TEXT
   ======================================== */
.spoiler {
    background: var(--text-tertiary);
    color: transparent;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    user-select: none;
}

.spoiler:hover::before {
    content: 'Click to reveal';
    position: absolute;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.spoiler:not(.spoiler) {
    background: transparent;
    color: inherit;
}

/* ========================================
   COMMENT FORM
   ======================================== */
.comment-form {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.comment-form textarea {
    width: 100%;
    min-height: 80px;
    margin-bottom: var(--space-sm);
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.2);
}

.comment-form textarea::placeholder {
    color: var(--text-tertiary);
}

.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-warning {
    color: var(--warning-color);
    font-size: 0.8rem;
}

/* ========================================
   TEXT UTILITIES
   ======================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-tertiary); }
.success-message { color: var(--success-color); }

/* ========================================
   SETTINGS PAGE
   ======================================== */
.settings-page {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.settings-page .page-header {
    margin-bottom: var(--space-lg);
    text-align: center;
}

.settings-page .page-header h1 {
    margin-bottom: 0;
}

.settings-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.settings-tabs a {
    padding: var(--space-sm) var(--space-lg);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    min-width: 130px;
    text-align: center;
}

.settings-tabs a:hover {
    color: var(--text-primary);
    background: rgba(157, 78, 221, 0.1);
}

.settings-tabs a.active {
    color: var(--accent-purple);
    background: rgba(157, 78, 221, 0.15);
    font-weight: 600;
}

.settings-page .panel {
    margin-bottom: var(--space-xl);
}

.settings-page .alert {
    margin-bottom: var(--space-lg);
}

/* Avatar Section */
.avatar-section {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-orange));
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.avatar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
}

.avatar-hint {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin: 0;
    width: 100%;
    margin-top: var(--space-xs);
}

/* Country Selector */
.country-selector {
    position: relative;
}

.selected-country {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.6rem 1rem;
    background: #1a1a2e;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.selected-country:hover {
    border-color: var(--accent-purple);
}

.selected-country .dropdown-arrow {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.country-flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

.country-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 300px;
    background: #1a1a2e;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.country-dropdown.open {
    display: block;
}

.country-search {
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
    background: #1a1a2e;
}

.country-search input {
    width: 100%;
    padding: 0.5rem;
    background: #252540;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.country-options {
    max-height: 250px;
    overflow-y: auto;
    background: #1a1a2e;
}

.country-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.6rem var(--space-md);
    cursor: pointer;
    transition: background 0.2s ease;
    background: #1a1a2e;
}

.country-option:hover {
    background: #2d2d4a;
}

.country-option .country-name {
    color: var(--text-primary);
}

/* Form Rows */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Notification Checkboxes */
.notification-group {
    margin-bottom: var(--space-xl);
}

.notification-group h4 {
    color: var(--accent-orange);
    margin-bottom: var(--space-md);
    font-size: 1rem;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s ease;
}

.checkbox-row:hover {
    background: rgba(157, 78, 221, 0.1);
}

.checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--accent-purple);
    /* Custom checkbox styling for dark mode */
    appearance: none;
    -webkit-appearance: none;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-row input[type="checkbox"]:hover {
    border-color: var(--accent-purple);
}

.checkbox-row input[type="checkbox"]:checked {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

.checkbox-row input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checkbox-title {
    font-weight: 600;
    color: var(--text-primary);
}

.checkbox-desc {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* Info List (Security page) */
.info-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

/* ========================================
   ADMIN AREA STYLES
   ======================================== */

/* Admin Navigation */
.admin-nav {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-xl);
    padding: 0 var(--space-lg);
}

.admin-nav-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-nav-links a {
    padding: var(--space-md) var(--space-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.admin-nav-links a:hover {
    color: var(--text-primary);
    background: rgba(157, 78, 221, 0.1);
}

.admin-nav-links a.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
    background: rgba(157, 78, 221, 0.1);
}

.admin-nav-links a.admin-nav-danger {
    color: var(--error-color);
}

.admin-nav-links a.admin-nav-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.admin-nav-links a.admin-nav-danger.active {
    color: var(--error-color);
    border-bottom-color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
}

/* Admin Dashboard */
.admin-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.admin-dashboard .page-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.admin-dashboard .page-header h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: transparent;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-purple) 50%, var(--accent-orange) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: elegantGradient 8s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(157, 78, 221, 0.3));
}

/* Admin Stats Grid */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.admin-stats .stat-card {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.1) 0%, rgba(255, 107, 53, 0.05) 100%);
    border: 1px solid rgba(157, 78, 221, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    transition: all 0.3s ease;
}

.admin-stats .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(157, 78, 221, 0.2);
}

.admin-stats .stat-card.highlight {
    border-color: var(--warning-color);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.admin-stats .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-purple);
    line-height: 1;
    margin-bottom: var(--space-sm);
}

.admin-stats .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Admin Grid Layout */
.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

.admin-section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.admin-section h3 {
    color: var(--accent-orange);
    margin-bottom: var(--space-lg);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.action-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(157, 78, 221, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.action-card:hover {
    background: rgba(157, 78, 221, 0.15);
    border-color: var(--accent-purple);
    transform: translateX(3px);
}

.action-card .icon {
    font-size: 1.5rem;
}

.action-card .label {
    font-weight: 500;
}

.action-card .badge {
    margin-left: auto;
    background: var(--error-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.action-card--danger {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.3);
}

.action-card--danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--error-color);
}

/* Activity Log */
.activity-log {
    max-height: 400px;
    overflow-y: auto;
    padding-right: var(--space-sm);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    padding-right: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-action {
    color: var(--accent-purple);
    font-weight: 500;
    flex-shrink: 0;
}

.activity-user {
    color: var(--text-secondary);
}

.activity-time {
    margin-left: auto;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Admin Page Common Styles */
.admin-page {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.admin-page--wide {
    max-width: 1600px;
}

.admin-page > .panel,
.admin-page > .admin-filters,
.admin-page > div > .panel {
    width: 100%;
}

/* Ensure panel content doesn't shrink the panel */
.admin-page .panel {
    width: 100%;
}

/* Only add margin when panels are stacked (not in grid) */
.admin-page > .panel + .panel,
.admin-page .content > .panel + .panel {
    margin-top: var(--space-xl);
}

/* Reset margin for panels inside grids */
.admin-page .admin-grid > .panel,
.admin-page .danger-zone-grid > .panel {
    margin-top: 0;
}

.admin-page .panel-body {
    min-height: 200px;
}

.admin-page .empty-state {
    width: 100%;
    padding: var(--space-xxl) var(--space-lg);
}

/* Admin Content Wrapper - ensures consistent width */
.admin-content-wrapper {
    width: 100%;
    min-width: 800px;
}

.admin-content-wrapper > .admin-filters,
.admin-content-wrapper > .panel {
    width: 100%;
}

.admin-page .page-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.admin-page .page-header h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: transparent;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-purple) 50%, var(--accent-orange) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: elegantGradient 8s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(157, 78, 221, 0.3));
}

.admin-page .page-header p {
    color: var(--text-secondary);
    margin-top: var(--space-sm);
}

/* Admin Tables */
.admin-table-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: rgba(157, 78, 221, 0.1);
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.admin-table tbody tr:hover {
    background: rgba(157, 78, 221, 0.05);
}

.admin-table .actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.admin-table .actions-cell form {
    display: inline-flex;
    margin: 0;
}

.admin-table .actions-cell .btn {
    min-height: 32px;
    min-width: 75px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Admin Filter Bar */
.admin-filters {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.admin-filters .filter-pills {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    justify-content: center;
}

.admin-filters .filter-pill {
    padding: var(--space-xs) var(--space-md);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.admin-filters .filter-pill:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.admin-filters .filter-pill.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.admin-filters .search-form {
    display: flex;
    gap: var(--space-sm);
    margin-left: auto;
}

.admin-filters .search-form .form-control {
    min-width: 200px;
    height: 38px;
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.admin-filters .search-form .btn {
    height: 38px;
}

/* Challenge Form Grid */
.challenge-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-xl);
    align-items: start;
}

.challenge-form .form-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.challenge-form .form-main > .panel {
    margin-bottom: 0;
}

.challenge-form .form-sidebar {
    position: sticky;
    top: var(--space-lg);
}

@media (max-width: 900px) {
    .challenge-form .form-grid {
        grid-template-columns: 1fr;
    }
    .challenge-form .form-sidebar {
        position: static;
    }
}

/* Role Select Dropdown */
.role-select {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--text-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    min-width: 80px;
}

.role-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.role-select:focus {
    outline: none;
    border-color: var(--accent-purple);
}

/* Status Badges */
.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success-color);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.status-unverified {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-tertiary);
}

/* Role Badges */
.role-badge {
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.role-admin {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

.role-moderator {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.role-contributor {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success-color);
}

.role-player {
    background: rgba(157, 78, 221, 0.2);
    color: var(--accent-purple);
}

/* Admin Settings Page */
.admin-settings {
    max-width: 800px;
    margin: 0 auto;
}

.settings-section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.settings-section h3 {
    color: var(--accent-orange);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-info h4 {
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.setting-info p {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin: 0;
}

.setting-value {
    color: var(--accent-purple);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.pagination-btn {
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination-numbers {
    display: flex;
    gap: var(--space-xs);
}

.pagination-numbers a,
.pagination-numbers span {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    min-width: 32px;
    text-align: center;
}

.pagination-numbers a {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border-color);
}

.pagination-numbers a:hover {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
}

.pagination-numbers .current {
    background: var(--accent-purple);
    color: white;
}

/* ========================================
   CONTRIBUTOR AREA STYLES
   ======================================== */

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    justify-content: center;
}

.filter-tab {
    padding: var(--space-sm) var(--space-lg);
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.filter-tab:hover {
    color: var(--text-primary);
    background: rgba(157, 78, 221, 0.1);
}

.filter-tab.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
    background: rgba(157, 78, 221, 0.1);
}

/* Additional Badge Styles */
.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-secondary {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* Info Box */
.info-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-top: var(--space-xl);
}

.info-box h4 {
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    font-size: 1rem;
}

.info-box ul {
    list-style: disc;
    margin-left: var(--space-xl);
    color: var(--text-secondary);
}

.info-box li {
    margin-bottom: var(--space-sm);
    font-size: 0.9rem;
}

.info-box p {
    margin-top: var(--space-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================================
   DATA TABLES (Contributor Area)
   ======================================== */

.table-responsive {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin-bottom: var(--space-lg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.data-table th,
.data-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 0.875rem;
}

.data-table th {
    background: rgba(157, 78, 221, 0.1);
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: rgba(157, 78, 221, 0.05);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Actions Column */
.data-table .table-actions {
    white-space: nowrap;
    text-align: center;
}

.data-table .table-actions form {
    display: inline-flex;
    margin: 0;
    justify-content: center;
}

.data-table .table-actions .btn {
    margin: 0 auto;
}

/* Challenge Title in Tables */
.data-table .challenge-title {
    font-size: 0.95rem;
}

.data-table .challenge-title strong,
.data-table td > strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* Actions cell in data tables */
.data-table .actions-cell {
    white-space: nowrap;
}

.data-table .actions-cell .btn {
    min-width: 60px;
}

/* File info with description */
.data-table td code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    display: inline-block;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.data-table td small {
    display: block;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column width hints */
.data-table th:first-child,
.data-table td:first-child {
    min-width: 120px;
}

/* Status badges in tables */
.data-table .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
}

/* Form Actions */
.challenge-form .form-actions {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

/* Panel Header Consistency */
.panel-header h3 {
    margin: 0;
    color: var(--accent-orange);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Admin Section Headers */
.admin-section > h3 {
    color: var(--accent-orange);
    margin-bottom: var(--space-lg);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Dashboard Spacing */
.admin-dashboard > .admin-grid {
    margin-bottom: var(--space-xl);
}

.admin-dashboard > .admin-section,
.admin-dashboard > .panel,
.admin-dashboard > .info-box {
    margin-bottom: var(--space-xl);
}

.admin-dashboard > *:last-child {
    margin-bottom: 0;
}

/* Report Issue Link */
.report-issue-link {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.report-issue-link:hover {
    color: var(--warning);
}

/* Comment System Enhancements */
.comment-captcha {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

.comment-captcha .captcha-label {
    color: var(--text-secondary);
    margin-right: 0.25rem;
}

.comment-captcha .captcha-num {
    color: var(--accent);
    font-weight: 600;
}

.comment-captcha .captcha-op,
.comment-captcha .captcha-eq {
    color: var(--text-tertiary);
}

.comment-captcha .captcha-input {
    width: 50px;
    padding: 0.25rem 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    text-align: center;
}

.comment-captcha .captcha-input:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-captcha .captcha-input::-webkit-outer-spin-button,
.comment-captcha .captcha-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.comment-captcha .captcha-input[type=number] {
    -moz-appearance: textfield;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.comment-actions {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
}

.comment-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 0.15rem 0.3rem;
    text-decoration: none;
    color: inherit;
}

.comment:hover .comment-action-btn {
    opacity: 1;
}

.comment-action-btn:hover {
    opacity: 1;
}

.solver-badge-sm {
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 600;
}

.edited-badge {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    font-style: italic;
}

.comment-footer {
    margin-top: 0.5rem;
}

.reply-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
}

.reply-btn:hover {
    color: var(--accent);
}

.comment-replies {
    margin-left: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
    margin-top: 0.75rem;
}

.comment-replies .comment {
    padding: 0.75rem 0;
    background: transparent;
    border-radius: 0;
}

.comment-replies .comment:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.reply-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.cancel-reply {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: auto;
}

.cancel-reply:hover {
    color: var(--danger);
}

.comment-edit-form {
    margin-top: 0.5rem;
}

.comment-edit-form .edit-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.comment-edit-form .edit-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-edit-form .edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
