:root {
    --bg-base: #030712;
    --bg-elevated: #0B1121;
    --bg-card: #111827;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --accent-blue: #00f0ff;
    --accent-dark: #1E3A8A;
    --border-color: #1F2937;
    --glow: 0 0 10px rgba(0, 240, 255, 0.4);
    
    font-family: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Effects */
.bg-grid {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(to right, rgba(31, 41, 55, 0.2) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(31, 41, 55, 0.2) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
}

.bg-glow {
    position: fixed; top: -100px; right: -100px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%; z-index: -1;
}

/* Layout */
.sidebar {
    width: 250px;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    position: fixed; height: 100vh;
}

.content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem 3rem;
    max-width: 1200px;
}

/* Sidebar Components */
.logo { margin-bottom: 3rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem; }
.logo h1 { font-family: 'Share Tech Mono', monospace; font-size: 1.5rem; color: var(--accent-blue); text-shadow: var(--glow); }
.logo-sub { font-size: 0.75rem; color: var(--text-secondary); letter-spacing: 2px; }

.nav-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.nav-links li a {
    display: block; padding: 0.75rem 1rem; color: var(--text-secondary);
    text-decoration: none; font-size: 0.875rem; font-weight: 500;
    border-radius: 4px; transition: all 0.2s; border-left: 2px solid transparent;
}
.nav-links li a:hover {
    background: rgba(0, 240, 255, 0.05); color: var(--accent-blue);
}
.nav-links li a.active {
    background: rgba(0, 240, 255, 0.1); color: var(--accent-blue);
    border-left: 2px solid var(--accent-blue);
}

/* Header */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 3rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem;
}
.topbar h2 { font-family: 'Share Tech Mono', monospace; font-size: 1rem; color: var(--text-secondary); }
.status-ok { color: var(--accent-blue); text-shadow: var(--glow); animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 0.7; } 50% { opacity: 1; } 100% { opacity: 0.7; } }

.meta-stats { display: flex; gap: 2rem; }
.meta-stat { display: flex; flex-direction: column; }
.meta-stat span:first-child { font-size: 0.7rem; color: var(--text-secondary); letter-spacing: 1px; }
.meta-stat span:last-child { font-size: 1.25rem; font-weight: 700; color: #fff; }

/* Sections */
.view-section { display: none; animation: fadeIn 0.3s ease-out; }
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.sec-header { margin-bottom: 1.5rem; }
.sec-header h3 { font-family: 'Share Tech Mono', monospace; color: var(--accent-blue); letter-spacing: 1px; }
.mt-8 { margin-top: 3rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Cards & Grids */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    padding: 1.5rem; border-radius: 6px; transition: all 0.3s ease;
}
.card:hover { border-color: var(--accent-blue); box-shadow: 0 0 15px rgba(0,240,255,0.1); transform: translateY(-2px); }
.card-title { font-weight: 700; margin-bottom: 0.5rem; color: #fff; }
.card-desc { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.5; }

/* Timeline */
.timeline { border-left: 2px solid var(--accent-dark); padding-left: 1.5rem; margin-left: 0.5rem; }
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-item::before {
    content: ''; position: absolute; left: -1.8rem; top: 0; width: 10px; height: 10px;
    border-radius: 50%; background: var(--accent-blue); box-shadow: var(--glow);
}
.timeline-time { font-family: 'Share Tech Mono', monospace; font-size: 0.75rem; color: var(--accent-blue); margin-bottom: 0.25rem; }
.timeline-content h4 { font-size: 1rem; color: #fff; margin-bottom: 0.25rem; }
.timeline-content p { font-size: 0.875rem; color: var(--text-secondary); }

/* Tables */
.table-wrapper { overflow-x: auto; background: var(--bg-card); border-radius: 6px; border: 1px solid var(--border-color); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color); }
.data-table th { font-size: 0.75rem; letter-spacing: 1px; color: var(--text-secondary); font-weight: 500; }
.data-table tbody tr { animation: staggerFade 0.4s ease-out backwards; cursor: pointer; }
.data-table tbody tr:hover { background: rgba(0, 240, 255, 0.05); }
.data-table .rank { color: var(--accent-blue); font-family: 'Share Tech Mono', monospace; }

@keyframes staggerFade {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Team Member Sub-rows */
.team-row { cursor: pointer; }
.team-members-row { background: var(--bg-elevated); display: none; }
.team-members-row.show { display: table-row; }
.members-list { padding: 1rem 2rem; }
.member-item { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px dashed var(--border-color); font-size: 0.875rem; }
.member-item:last-child { border-bottom: none; }

/* Challenges Grid */
.chal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.chal-card { cursor: pointer; }
.chal-header { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.chal-name { font-weight: 700; color: #fff; }
.chal-points { font-family: 'Share Tech Mono'; color: var(--accent-blue); }
.chal-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag { font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 3px; background: rgba(0, 240, 255, 0.1); color: var(--accent-blue); }

.search-box {
    background: var(--bg-card); border: 1px solid var(--border-color);
    padding: 0.5rem 1rem; color: #fff; border-radius: 4px;
    font-family: inherit; outline: none; width: 250px;
}
.search-box:focus { border-color: var(--accent-blue); }

/* Modal */
.modal {
    margin: auto; background: var(--bg-elevated); border: 1px solid var(--accent-blue);
    padding: 0; border-radius: 6px; width: 90%; max-width: 600px;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.15); color: #fff;
    backdrop-filter: blur(10px);
}
.modal::backdrop { background: rgba(0, 0, 0, 0.8); }
.modal-box { position: relative; padding: 2rem; }
.close-btn { 
    position: absolute; top: 1rem; right: 1.5rem; background: transparent; 
    border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; 
}
.close-btn:hover { color: var(--accent-blue); }

.modal-header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.modal-badges { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

.modal-body { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; max-height: 250px; overflow-y: auto; margin-bottom: 1.5rem; }
.modal-body h3 { color: #fff; margin: 1rem 0 0.5rem; }

.flag-box { background: var(--bg-base); border: 1px dashed var(--accent-blue); padding: 1rem; border-radius: 4px; display: flex; flex-direction: column; gap: 0.5rem; }
.flag-label { font-size: 0.75rem; color: var(--accent-blue); font-family: 'Share Tech Mono'; }
.flag-box code { color: #fff; word-break: break-all; }

.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.solvers-list {
    max-height: 150px; overflow-y: auto; background: var(--bg-card); 
    border: 1px solid var(--border-color); border-radius: 4px; padding: 0.5rem;
}
.solver-item {
    display: flex; justify-content: space-between; font-size: 0.75rem; 
    padding: 0.5rem; border-bottom: 1px dashed var(--border-color);
}
.solver-item:last-child { border-bottom: none; }
.solver-team { font-weight: 700; color: #fff; }
.solver-user { color: var(--accent-blue); }
.pagination-container { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.pag-btn {
    background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary);
    padding: 0.4rem 0.8rem; font-family: 'Share Tech Mono', monospace; font-size: 0.8rem;
    cursor: pointer; border-radius: 4px; transition: all 0.2s;
}
.pag-btn:hover { border-color: var(--accent-blue); color: #fff; }
.pag-btn.active { background: rgba(0, 240, 255, 0.1); border-color: var(--accent-blue); color: var(--accent-blue); box-shadow: var(--glow); }
.pag-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Mobile Elements (Hidden by default) */
.mobile-header, .mobile-nav { display: none; }

/* Responsive */
@media (max-width: 1024px) {
    .content { padding: 2rem; }
}

@media (max-width: 768px) {
    body { flex-direction: column; }
    
    .sidebar { display: none; }
    
    .mobile-header {
        display: flex; justify-content: space-between; align-items: center;
        padding: 1rem 1.5rem; background: var(--bg-elevated);
        border-bottom: 1px solid var(--border-color);
        position: fixed; top: 0; left: 0; right: 0; z-index: 100;
        backdrop-filter: blur(10px);
    }
    .mobile-logo { font-family: 'Share Tech Mono'; color: var(--accent-blue); font-weight: 700; }
    .system-status-mini { font-size: 0.7rem; font-family: 'Share Tech Mono'; }

    .content {
        margin-left: 0; padding: 5rem 1rem 6rem;
        max-width: 100%;
    }

    .topbar { flex-direction: column; align-items: flex-start; gap: 1.5rem; margin-bottom: 2rem; }
    .meta-stats { width: 100%; justify-content: space-between; gap: 0.5rem; }
    .meta-stat span:last-child { font-size: 1rem; }

    .mobile-nav {
        display: block; position: fixed; bottom: 0; left: 0; right: 0;
        background: var(--bg-elevated); border-top: 1px solid var(--border-color);
        z-index: 100; padding: 0.5rem 0; backdrop-filter: blur(10px);
    }
    .mobile-nav .nav-links {
        flex-direction: row; justify-content: space-around; gap: 0;
    }
    .mobile-nav .nav-links li a {
        border-left: none; border-top: 2px solid transparent; padding: 0.5rem;
        font-size: 0.7rem; text-align: center;
    }
    .mobile-nav .nav-links li a.active {
        border-top: 2px solid var(--accent-blue); background: transparent;
    }

    .chal-grid { grid-template-columns: 1fr; }
    .cards-grid { grid-template-columns: 1fr; }
    
    .modal { width: 95%; }
    .modal-box { padding: 1.5rem 1rem; }
    
    .data-table th, .data-table td { padding: 0.75rem 0.5rem; font-size: 0.8rem; }
}

@media (max-width: 480px) {
    .meta-stats { flex-wrap: wrap; }
    .meta-stat { flex: 1 1 30%; }
    .sec-header h3 { font-size: 1rem; }
}

