/* Global Variables & Theme */
:root {
    /* Colors - Dark Mode DEFAULT */
    --bg-main: #050505;
    --bg-surface: #0F0F0F;
    --bg-surface-hover: #161616;

    --text-primary: #EDEDED;
    --text-secondary: #A1A1A1;
    --text-tertiary: #666666;

    --border-color: #222222;
    --border-hover: #333333;

    /* Accents - Web3 Neon */
    --accent-green: #00FF94;
    --accent-purple: #9D4EDD;
    --accent-blue: #3B82F6;
    --accent-amber: #F59E0B;
    --accent-red: #EF4444;

    /* Status Colors */
    --status-active-bg: rgba(0, 255, 148, 0.1);
    --status-active-text: #00FF94;
    --status-upcoming-bg: rgba(157, 78, 221, 0.1);
    --status-upcoming-text: #9D4EDD;
    --status-ended-bg: rgba(255, 255, 255, 0.05);
    --status-ended-text: #888888;

    /* Navbar */
    --nav-bg: rgba(5, 5, 5, 0.9);

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Layout */
    --container-xl: 1400px;
    --container-lg: 1100px;
    --nav-height: 64px;
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-main: #FDFDFD;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F8FAFC;

    --text-primary: #2D3748;
    --text-secondary: #718096;
    --text-tertiary: #A0AEC0;

    --border-color: #E2E8F0;
    --border-hover: #CBD5E1;

    --accent-green: #10B981;
    --accent-purple: #8B5CF6;

    --status-active-bg: #ECFDF5;
    --status-active-text: #10B981;
    --status-upcoming-bg: #F3F4F6;
    --status-upcoming-text: #6B7280;
    --status-ended-bg: #F1F5F9;
    --status-ended-text: #94A3B8;

    --nav-bg: rgba(255, 255, 255, 0.9);
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s ease;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    display: block;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Icons */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* Utilities */
.container {
    padding: 0 20px;
    margin: 0 auto;
}

.container-xl {
    max-width: var(--container-xl);
}

.container-lg {
    max-width: var(--container-lg);
}

.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 8px;
}

.gap-4 {
    gap: 16px;
}

.gap-6 {
    gap: 24px;
}

.gap-8 {
    gap: 32px;
}

.text-xs {
    font-size: 12px;
}

.text-sm {
    font-size: 13px;
}

.text-base {
    font-size: 14px;
}

.text-lg {
    font-size: 16px;
}

.text-xl {
    font-size: 20px;
}

.text-2xl {
    font-size: 24px;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.05em;
}

.text-muted {
    color: var(--text-secondary);
}

.text-dim {
    color: var(--text-tertiary);
}

.text-accent {
    color: var(--accent-green);
}

/* Components */

/* Navbar */
.navbar {
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.brand-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.nav-menu {
    display: flex;
    gap: 32px;
}

.nav-item {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    position: relative;
    padding: 8px 0;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-primary);
}

.nav-item.active {
    border-bottom: 2px solid var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    color: var(--text-secondary);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.icon-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

.btn-primary {
    background: #fff;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
}

[data-theme="light"] .btn-primary {
    background: #000;
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.8;
}

/* Mobile Menu */
.hamburger {
    display: none;
    /* Desktop default */
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
}

.mobile-dropdown {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    flex-direction: column;
    gap: 20px;
    z-index: 999;
}

.mobile-dropdown.active {
    display: flex;
}

/* Navbar Socials & Mobile Toggle */
.social-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-social-toggle {
    display: none;
    /* Hidden on Desktop */
    color: var(--text-primary);
}

@media (max-width: 1024px) {
    .nav-menu {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    /* Hide direct icons on mobile, show toggle */
    .social-group {
        display: none;
        position: absolute;
        top: 60px;
        /* Below navbar */
        right: 70px;
        /* Aligned near toggle */
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
        padding: 8px;
        border-radius: 8px;
        flex-direction: row;
        gap: 12px;
        z-index: 1001;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .social-group.active {
        display: flex;
        animation: fadeIn 0.2s ease;
    }

    .mobile-social-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--bg-surface);
        border: 1px solid var(--border-color);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards & Tables */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: 0.2s;
}

.card:hover {
    border-color: var(--border-hover);
    background: var(--bg-surface-hover);
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-surface-hover);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.badge-active {
    background: var(--status-active-bg);
    color: var(--status-active-text);
    border-color: rgba(0, 255, 148, 0.2);
}

[data-theme="light"] .badge-active {
    border-color: rgba(16, 185, 129, 0.2);
}

.badge-upcoming {
    background: var(--status-upcoming-bg);
    color: var(--status-upcoming-text);
    border-color: var(--border-color);
}

.badge-type {
    background: var(--bg-surface-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Page Specific: Header Stats (Homepage) */
.page-header {
    margin-bottom: 24px;
}

/* Form Elements */
.search-input {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
    width: 200px;
}

.search-input:focus {
    outline: 1px solid var(--accent-blue);
}

.filter-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    padding: 32px 0;
    margin-top: 48px;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Sidebar Specific fix for Light mode */
[data-theme="light"] .sidebar .btn-primary[style*="background: transparent"] {
    color: var(--text-primary) !important;
}