/* Global Variables & Theme */
:root {
    /* Colors - Modern Dark Professional */
    --bg-dark: #09090b;
    /* Zinc 950 */
    --bg-card: #18181b;
    /* Zinc 900 */
    --bg-elevated: #27272a;
    /* Zinc 800 */

    --primary: #6366f1;
    /* Indigo 500 - Kept as accent but minimized */
    --primary-hover: #4f46e5;
    /* Indigo 600 */
    --primary-dim: rgba(255, 255, 255, 0.05);
    /* White glow, not color */

    --text-main: #fafafa;
    /* Zinc 50 */
    --text-muted: #a1a1aa;
    /* Zinc 400 */

    --border: #27272a;
    /* Zinc 800 */

    /* Layout */
    --container-width: 1200px;
    /* Standard wide container */
    --header-height: 64px;

    /* Effects */
    --radius: 8px;
    /* Professional, tighter corners */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    /* Subtle shadows */
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    /* Clean headings */
    font-weight: 700;
    letter-spacing: -0.025em;
    /* Tight tracking for headings */
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

/* Utility Classes */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

.text-gradient {
    /* Clean modern gradient */
    background: linear-gradient(to right, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}


/* Standard Grid System */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

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

/* Professional Card */
.card,
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: transform 0.2s, box-shadow 0.2s;
    /* Legacy glass support if needed, but solid for Pro SaaS */
}

.card:hover,
.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    /* Standard rounded */
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    /* White text on Indigo button */
    border: 1px solid var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

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

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--text-muted);
}



/* Hero Section */
.hero {
    padding: 100px 0 60px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 600px;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 16px;
    line-height: 1.1;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    max-width: 480px;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-visual {
    position: absolute;
    top: 50%;
    right: -5%;
    transform: translateY(-50%);
    width: 50%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glow-orb {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--primary-dim) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.6;
}

/* Sections General */
.section {
    padding: 40px 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 40px;
    text-align: center;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.stat-card {
    padding: 32px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    font-family: 'Space Grotesk', sans-serif;
}

.stat-label {
    color: var(--text-muted);
    font-size: 1rem;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(9, 9, 11, 0.8);
    /* Dark Zinc transparent */
    backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}



header .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
}

.logo img {
    width: 32px;
    height: 32px;
    animation: spin-slow 10s linear infinite;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.3);
    padding: 40px 20px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}



.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-col h4 {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a {
    color: var(--text-muted);
}

.footer-col a:hover {
    color: var(--primary);
}

/* Standard Table Styles */
.table-container {
    margin-top: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

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

th,
td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-elevated);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
}

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

tr:hover td {
    background: var(--bg-card);
    color: var(--text-main);
}

/* Search & Filters */
.filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.form-input,
.search-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-main);
    font-family: inherit;
    width: 100%;
    transition: all 0.3s ease;
}

.form-input:focus,
.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-dim);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Animations */
@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-fade-in {
    animation: fade-in-up 0.8s ease-out forwards;
}

/* DataTables Customization */
/* DataTables Customization */
/* DataTables Customization */
.dataTables_wrapper {
    margin-top: 24px;
    width: 100%;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 24px;
    color: var(--text-muted);
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-main);
    margin-left: 8px;
    outline: none;
    transition: all 0.2s;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-dim);
}

/* Align controls */
.dataTables_wrapper .dataTables_filter {
    float: right;
}

.dataTables_wrapper .dataTables_length {
    float: left;
}

/* Clearfix for floats */
.dataTables_wrapper::after {
    content: "";
    display: table;
    clear: both;
}

/* Ensure table container matches leaderboard */
.table-container {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* ... (omitted styles) ... */

table.dataTable {
    width: 100% !important;
    border-collapse: collapse !important;
    white-space: normal !important;
    /* Force text wrapping */
    table-layout: auto;
    /* Allow column sizing based on content, but constrained by wrapping */
}

table.dataTable.no-footer {
    border-bottom: 1px solid var(--border);
}

table.dataTable thead th,
table.dataTable thead td {
    background: var(--bg-elevated) !important;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 24px !important;
    border-bottom: 1px solid var(--border) !important;
}

table.dataTable tbody th,
table.dataTable tbody td {
    padding: 16px 24px !important;
    background: transparent !important;
    color: var(--text-muted);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border) !important;
}

table.dataTable.display tbody tr.odd>.sorting_1,
table.dataTable.order-column.stripe tbody tr.odd>.sorting_1 {
    background-color: transparent !important;
}

table.dataTable.display tbody tr.even>.sorting_1,
table.dataTable.order-column.stripe tbody tr.even>.sorting_1 {
    background-color: transparent !important;
}

table.dataTable tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

table.dataTable tbody tr:hover>.sorting_1 {
    background-color: transparent !important;
}

/* Ensure cell content wraps but respects width */
table.dataTable tbody td {
    white-space: normal !important;
    max-width: 300px;
    word-wrap: break-word;
}

/* ... */

/* Catalog Specifics */
.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

.episode-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s;
}

.episode-chip:hover {
    border-color: var(--primary);
    color: var(--text-main);
    background: var(--primary-dim);
}

.episode-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
}

/* Leaderboard Specifics */
.rank-1 {
    color: #f59e0b;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Amber 500 */
.rank-2 {
    color: #94a3b8;
    text-shadow: 0 0 10px rgba(148, 163, 184, 0.3);
}

/* Slate 400 */
.rank-3 {
    color: #b45309;
    text-shadow: 0 0 10px rgba(180, 83, 9, 0.3);
}

/* Amber 700 */

.tab-container {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.tab-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 10px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.tab-btn.active {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.1);
}

.user-cell {
    font-family: 'Space Mono', monospace;
    color: var(--primary);
    opacity: 0.9;
}

/* Badges & Alerts */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(48, 209, 88, 0.2);
    color: #30d158;
}

.badge-danger {
    background: rgba(255, 69, 58, 0.2);
    color: #ff453a;
}

.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-info {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary-dim);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Forms Extra */
.chk-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.chk-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.95rem;
}

.chk-item input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}



.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    width: 95%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    position: relative;
    transform: scale(0.95);
    animation: fade-in-up 0.3s ease-out forwards;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.modal-header h3 {
    word-break: break-word;
    /* Prevent long titles from clipping */
    max-width: 90%;
    line-height: 1.3;
}

.modal-close {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--primary);
}