@import url('https://fonts.googleapis.com/css2?family=Istok+Web:ital,wght@0,400;0,700;1,400&display=swap');

@font-face {
    font-family: 'Trajan Pro Regular';
    font-style: normal;
    font-weight: normal;
    src: local('Trajan Pro Regular'), url('../static/fonts/TrajanPro-Regular.woff') format('woff');
}

@font-face {
    font-family: 'PortLligat Sans';
    font-style: normal;
    font-weight: normal;
    src: local('PortLligat Sans'), url('../static/fonts/PortLligatSans-Regular.woff') format('woff');
}

:root {
    --bg-dark: #050b10;
    --card-bg: rgba(11, 25, 36, 0.9);
    --card-bg-light: rgba(19, 41, 58, 0.95);
    --border-color: rgba(211, 156, 10, 0.3);
    --border-highlight: #d39c0a;
    --gold: #ffdcaa;
    --gold-bright: #fcd078;
    --gold-dim: #d39c0a;
    --text-main: #f0f4f8;
    --text-muted: #95a8b6;
    --accent-blue: #19c8c3;
    --accent-red: #e74c3c;
    --accent-green: #2ecc71;
    --accent-purple: #9b59b6;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
    --nav-height: 64px;
}

html {
    color-scheme: dark;
    scrollbar-width: thin;
    scrollbar-color: rgba(211, 156, 10, 0.45) rgba(3, 10, 16, 0.35);
}

/* Custom Scrollbars matching PoPRuns theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(3, 10, 16, 0.35);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(211, 156, 10, 0.4);
    border-radius: 4px;
    border: 1px solid rgba(211, 156, 10, 0.2);
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(252, 208, 120, 0.7);
    border-color: rgba(252, 208, 120, 0.4);
    box-shadow: 0 0 6px rgba(252, 208, 120, 0.35);
}

::-webkit-scrollbar-thumb:active {
    background: #fcd078;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

body {
    background: var(--bg-dark) url('https://staticctf.ubisoft.com/J3yJr34U2pZ2Ieem48Dwy9uqj5PNUQTn/4aYyFLkVPIx2XdHuFecdxp/b7c267a2f15d2cd9f2e38fdcb8507f35/Memory_textured_background.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-main);
    font-family: 'Istok Web', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

popruns-marathon {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Main Container */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem 3.5rem;
    width: 100%;
    flex: 1;
}

/* Marathon Hero Section */
.marathon-hero {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 0.75rem 1.15rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(211, 156, 10, 0.25);
}

.marathon-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #d39c0a, #ffdcaa, #19c8c3, #d39c0a);
}

.hero-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.hero-header-main {
    flex: 1 1 auto;
    min-width: 0;
}

.hero-cta-slot {
    flex-shrink: 0;
}

.hero-submissions-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, #fcd078 0%, #d39c0a 100%);
    color: #050b10 !important;
    text-decoration: none !important;
    padding: 0.38rem 0.85rem;
    border-radius: 6px;
    font-family: 'Istok Web', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(211, 156, 10, 0.35);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.hero-submissions-btn:hover {
    background: linear-gradient(135deg, #ffdcaa 0%, #fcd078 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(252, 208, 120, 0.5);
    color: #000 !important;
}

.hero-submissions-btn i {
    font-size: 0.85rem;
}

.hero-title {
    font-family: 'Trajan Pro Regular', serif;
    font-size: 1.35rem;
    color: var(--gold);
    margin: 0 0 0.35rem 0;
    letter-spacing: 0.75px;
    line-height: 1.2;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
}

.meta-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.22rem 0.6rem;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-main);
    font-size: 0.78rem;
    white-space: nowrap;
}

.meta-pill i {
    color: var(--gold);
}

.meta-stat-pill {
    background: rgba(252, 208, 120, 0.08);
    border-color: rgba(211, 156, 10, 0.28);
    color: var(--gold-bright);
}

.meta-stat-pill strong {
    color: #fff;
}

.hero-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.hero-social-pills {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.social-pill {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.social-pill.discord {
    background: rgba(88, 101, 242, 0.15);
    color: #7289da;
    border: 1px solid rgba(88, 101, 242, 0.35);
}

.social-pill.discord:hover {
    background: rgba(88, 101, 242, 0.3);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.4);
}

.social-pill.youtube {
    background: rgba(255, 0, 0, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 0, 0, 0.35);
}

.social-pill.youtube:hover {
    background: rgba(255, 0, 0, 0.3);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.4);
}

.social-pill.twitch {
    background: rgba(145, 71, 255, 0.15);
    color: #a970ff;
    border: 1px solid rgba(145, 71, 255, 0.35);
}

.social-pill.twitch:hover {
    background: rgba(145, 71, 255, 0.3);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(145, 71, 255, 0.4);
}

/* Tab panes */
.tab-pane {
    display: none;
    animation: fadeIn 0.25s ease-in-out;
}

.tab-pane.active {
    display: block;
}

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

/* Streamlined Schedule Controls Bar */
.schedule-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    background: var(--card-bg);
    border: 1px solid rgba(211, 156, 10, 0.25);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    margin-bottom: 0.75rem;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.controls-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Forms & Inputs */
.form-input,
.form-select {
    width: 100%;
    padding: 0.4rem 0.85rem;
    background: rgba(3, 10, 16, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    font-family: 'Istok Web', sans-serif;
    font-size: 0.86rem;
    transition: all 0.2s ease;
    outline: none;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--border-highlight);
    box-shadow: 0 0 8px rgba(211, 156, 10, 0.3);
    background: rgba(5, 15, 24, 0.95);
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffdcaa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.2rem;
    cursor: pointer;
}

.form-select option {
    background: #050b10;
    color: var(--text-main);
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 180px;
    min-width: 150px;
    max-width: 280px;
}

.search-icon {
    position: absolute;
    left: 0.65rem;
    color: var(--gold-dim);
    font-size: 0.8rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 32px;
    padding: 0.25rem 0.65rem 0.25rem 1.8rem !important;
    font-size: 0.84rem !important;
}

.select-input-wrap {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
}

.filter-game-select {
    height: 32px;
    font-size: 0.84rem !important;
    padding: 0.25rem 1.9rem 0.25rem 0.65rem !important;
    width: auto;
    max-width: 190px;
    background-position: right 0.65rem center;
}

.tz-control-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tz-icon {
    color: var(--gold-bright);
    font-size: 0.85rem;
    margin-right: 0.1rem;
}

.tz-select {
    height: 32px;
    font-size: 0.82rem !important;
    padding: 0.25rem 1.9rem 0.25rem 0.65rem !important;
    width: auto;
    min-width: 160px;
    max-width: 240px;
    background-position: right 0.65rem center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-family: 'Istok Web', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.btn-icon-sm {
    height: 32px;
    width: 32px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-sm:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.84rem;
}

.time-format-toggle {
    display: inline-flex;
    border: 1px solid rgba(211, 156, 10, 0.3);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(3, 10, 16, 0.85);
    height: 32px;
}

.btn-toggle-format {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0 0.6rem;
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-toggle-format:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.btn-toggle-format.active-time-format {
    background: var(--gold-dim) !important;
    color: #050b10 !important;
    font-weight: 700 !important;
}

.active-time-format {
    background: var(--gold-dim) !important;
    color: #000 !important;
    font-weight: 700 !important;
    border-color: var(--gold-bright) !important;
}

/* Schedule Table Container & Table */
.schedule-table-wrap {
    margin-top: 0;
    overflow: visible;
    border: 1px solid rgba(211, 156, 10, 0.25);
    border-radius: 8px;
    background: rgba(7, 18, 26, 0.85);
    box-shadow: var(--shadow);
}

.schedule-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-size: 0.87rem;
    text-align: left;
}

.schedule-table thead th {
    position: sticky;
    top: var(--nav-height, 64px);
    z-index: 20;
    background: #06111a;
    color: var(--gold);
    padding: 0.75rem 0.85rem;
    font-family: 'Trajan Pro Regular', serif !important;
    font-size: 0.84rem;
    letter-spacing: 0.5px;
    border-top: none;
    border-bottom: none;
    white-space: nowrap;
    text-transform: uppercase;
    box-shadow: 0 1px 0 rgba(211, 156, 10, 0.35), 0 4px 10px rgba(0, 0, 0, 0.5);
}

.schedule-table thead th:first-child {
    border-top-left-radius: 7px;
}

.schedule-table thead th:last-child {
    border-top-right-radius: 7px;
}

.schedule-table thead th::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: rgba(211, 156, 10, 0.35);
    pointer-events: none;
}

.schedule-day-header-row td.schedule-day-header-cell {
    background: rgba(6, 16, 24, 0.95);
    padding: 0.75rem 1.25rem;
    border-top: none;
    border-bottom: 1px solid rgba(211, 156, 10, 0.35);
}

.schedule-day-title {
    color: var(--gold-bright);
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: 'Trajan Pro Regular', serif;
    letter-spacing: 0.5px;
}

.schedule-day-separator-row td {
    padding: 0 !important;
    height: 18px;
    background: rgba(2, 6, 10, 0.75) !important;
    border-top: 1px solid rgba(211, 156, 10, 0.2) !important;
    border-bottom: 1px solid rgba(211, 156, 10, 0.2) !important;
    border-left: none !important;
    border-right: none !important;
}

.schedule-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

.schedule-table tbody tr:hover td:not(.schedule-day-header-cell):not(.schedule-special-cell) {
    background: rgba(19, 41, 58, 0.6);
}

.schedule-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 7px;
}

.schedule-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 7px;
}

.schedule-table th.col-schedule-time,
.schedule-table td.col-schedule-time {
    width: 135px;
    min-width: 135px;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

.schedule-table th.col-game,
.schedule-table td.col-game {
    min-width: 220px;
}

.schedule-table th.col-category,
.schedule-table td.col-category {
    min-width: 160px;
}

.schedule-table th.col-schedule-runners,
.schedule-table td.col-schedule-runners {
    min-width: 130px;
}

.schedule-table th.col-estimate,
.schedule-table td.col-estimate {
    width: 110px;
    min-width: 110px;
    text-align: center;
    vertical-align: middle;
}

.schedule-time-primary {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--gold-bright);
}

.schedule-time-secondary {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.schedule-game-title {
    font-weight: 700;
    color: var(--gold);
    line-height: 1.35;
}

.schedule-category-text {
    color: var(--text-main);
}

.schedule-runners-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.schedule-runner-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    font-size: 0.82rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    width: fit-content;
}

.estimate-cell-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    position: relative;
}

.setup-buffer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-family: monospace;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.5);
    border: 1px dashed rgba(211, 156, 10, 0.4);
    border-radius: 12px;
    padding: 0.12rem 0.55rem;
    line-height: 1.25;
    user-select: none;
    transition: all 0.2s ease;
    cursor: default;
}

.setup-buffer-badge:hover {
    border: 1px solid var(--gold-bright);
    color: var(--gold-bright);
    background: rgba(211, 156, 10, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.platform-badge {
    display: inline-block;
    padding: 0.18rem 0.5rem;
    border-radius: 4px;
    background: rgba(25, 200, 195, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(25, 200, 195, 0.3);
    font-size: 0.78rem;
    font-weight: 600;
}

.estimate-tag {
    font-family: monospace;
    font-size: 0.88rem;
    color: var(--gold-bright);
    font-weight: 600;
}

.schedule-special-row td {
    padding: 0;
}

.schedule-special-cell {
    padding: 0.75rem 1rem !important;
}

.schedule-special-cell.break {
    background: rgba(230, 126, 34, 0.15);
    color: #f39c12;
    border-left: 4px solid #e67e22;
}

.schedule-special-cell.end {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border-left: 4px solid #2ecc71;
}

.schedule-special-inner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.92rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 2.5rem;
    color: rgba(211, 156, 10, 0.4);
    margin-bottom: 0.75rem;
}

/* Responsive */
@media (max-width: 900px) {
    .schedule-controls-bar {
        gap: 0.5rem;
    }
    .controls-left, .controls-right {
        width: 100%;
        justify-content: space-between;
    }
    .search-input-wrap {
        flex: 1 1 180px;
        max-width: none;
    }
    .select-input-wrap {
        flex: 1 1 140px;
    }
    .filter-game-select {
        width: 100%;
        max-width: none;
    }
    .tz-control-group {
        flex: 1 1 auto;
    }
    .tz-select {
        width: 100%;
        max-width: none;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0.65rem 0.5rem 2.5rem;
    }
    .marathon-hero {
        padding: 0.75rem 0.85rem;
    }
    .hero-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }
    .hero-header-actions {
        justify-content: space-between;
    }
    .hero-title {
        font-size: 1.2rem;
    }
    .hero-meta {
        gap: 0.35rem;
    }
    .meta-pill {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }
    .schedule-controls-bar {
        padding: 0.45rem 0.55rem;
    }
}

@media (max-width: 480px) {
    .controls-left {
        flex-direction: column;
        align-items: stretch;
    }
    .search-input-wrap,
    .select-input-wrap,
    .filter-game-select {
        width: 100%;
        max-width: 100%;
    }
    .controls-right {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
    }
    .tz-control-group {
        width: 100%;
    }
    .time-format-toggle {
        width: 100%;
    }
    .btn-toggle-format {
        flex: 1;
    }
}
