:root {
    --bg-dark: #070d19;
    --bg-card: rgba(18, 26, 47, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --accent-blue: #38bdf8;
    --accent-purple: #818cf8;
    --accent-gold: #fbbf24;
    --accent-silver: #cbd5e1;
    --accent-bronze: #d97706;
    --accent-emerald: #34d399;
    --accent-rose: #f43f5e;
    --font-sans: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(129, 140, 248, 0.12) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    padding-bottom: 60px;
}

.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* Navbar */
.navbar {
    position: relative;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-icon {
    font-size: 28px;
    color: var(--accent-gold);
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.4));
}

.brand h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Custom Glass Dropdown Component */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.dropdown-trigger:hover, .custom-dropdown.open .dropdown-trigger {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.15);
}

.dropdown-arrow {
    font-size: 11px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

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

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.dropdown-item.active {
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-blue);
}

.check-icon {
    font-size: 12px;
    opacity: 0;
}

.dropdown-item.active .check-icon {
    opacity: 1;
    color: var(--accent-blue);
}

.text-accent {
    color: var(--accent-gold);
}

/* Status Badge & Instant Tooltip */
.status-badge-wrapper {
    position: relative;
    display: inline-block;
}

.status-badge-wrapper:hover .custom-tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.custom-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 230px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: all 0.12s ease-out;
}

.tooltip-header {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-blue);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 4px;
}

.tooltip-row:last-child {
    margin-bottom: 0;
}

.tooltip-label {
    color: var(--text-secondary);
}

.tooltip-val {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-weight: 600;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    cursor: default;
}

.status-badge.preview {
    background: rgba(251, 191, 36, 0.1);
    color: var(--accent-gold);
    border-color: rgba(251, 191, 36, 0.3);
}

.status-badge.live {
    background: rgba(52, 211, 153, 0.1);
    color: var(--accent-emerald);
    border-color: rgba(52, 211, 153, 0.3);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* Collapsible Standings Accordion */
.standings-accordion {
    margin-bottom: 20px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.25s ease;
}

.standings-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.standings-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.04);
}

.toggle-btn-left, .toggle-btn-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-hint {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.chevron-icon {
    font-size: 13px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.standings-accordion.open .chevron-icon {
    transform: rotate(180deg);
}

.standings-collapse-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
    padding: 0 20px;
}

.standings-accordion.open .standings-collapse-content {
    max-height: 800px;
    opacity: 1;
    padding: 0 20px 20px 20px;
}

.table-responsive {
    overflow-x: auto;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.standings-table th {
    padding: 10px 12px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.standings-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

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

.standings-table .team-col {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.standings-table .team-col img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.standings-table .pf-col {
    font-family: var(--font-mono);
    color: var(--accent-blue);
    font-weight: 700;
}

.standings-table tr.playoff-team {
    background: rgba(52, 211, 153, 0.06);
    border-left: 3px solid var(--accent-emerald);
}

.standings-table tr.playoff-team td:first-child {
    color: var(--accent-emerald);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: #fff;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Hero Section */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.active-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.hero-section h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
    background: linear-gradient(to right, #fff, var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 20px;
}

.podium-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}

.hero-top3-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.hero-others-container {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 16px;
    margin-top: 6px;
}

.hero-others-header {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-others-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hero-other-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    font-size: 12px;
}

.hero-other-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.hero-other-rank {
    font-weight: 800;
    color: var(--text-secondary);
    min-width: 22px;
    font-size: 11px;
}

.hero-other-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.hero-other-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-other-detail {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-blue);
    word-break: break-word;
    line-height: 1.3;
}

.podium-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    border-radius: 14px;
    position: relative;
}

.podium-card.rank-1 {
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.06);
}

.podium-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.podium-card.rank-1 .podium-avatar { border-color: var(--accent-gold); }
.podium-card.rank-2 .podium-avatar { border-color: var(--accent-silver); }
.podium-card.rank-3 .podium-avatar { border-color: var(--accent-bronze); }

.podium-info {
    overflow: hidden;
}

.podium-header-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.podium-rank-tag {
    font-weight: 800;
    font-size: 15px;
    color: var(--accent-gold);
    white-space: nowrap;
}

.podium-name {
    font-weight: 800;
    font-size: 17px;
    color: var(--text-primary);
    line-height: 1.25;
    word-break: break-word;
}

.podium-score {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-blue);
    font-family: var(--font-mono);
}

/* Upcoming Objective Placeholders */
.upcoming-card-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.upcoming-card-box i {
    font-size: 14px;
    color: var(--accent-gold);
}

.upcoming-hero-box {
    background: rgba(56, 189, 248, 0.06);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 14px;
    padding: 20px;
    margin-top: 16px;
}

.upcoming-hero-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upcoming-hero-box p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Tabs */
.tab-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active, .tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.obj-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.obj-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.week-pill {
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent-purple);
    font-size: 11px;
    font-weight: 700;
}

.status-tag {
    font-size: 11px;
    color: var(--text-secondary);
}

.obj-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.obj-card .desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.4;
}

/* Top 3 Rankings list inside Card */
.card-rankings {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.rank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.rank-num {
    font-weight: 800;
    font-size: 15px;
    min-width: 24px;
}

.rank-row.pos-1 .rank-num { color: var(--accent-gold); }
.rank-row.pos-2 .rank-num { color: var(--accent-silver); }
.rank-row.pos-3 .rank-num { color: var(--accent-bronze); }

.rank-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.rank-row-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.rank-row-name {
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    word-break: break-word;
    line-height: 1.3;
}

.rank-row-detail {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-blue);
    word-break: break-word;
    line-height: 1.3;
}

.view-full-badge {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
    font-weight: 600;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-glow);
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 22px;
    margin-top: 8px;
    margin-bottom: 4px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.table-title {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.standings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.standing-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.standing-item.rank-1 {
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.06);
}

.standing-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-badge {
    font-weight: 800;
    min-width: 24px;
    font-size: 13px;
}

.rank-1 .rank-badge { color: var(--accent-gold); }
.rank-2 .rank-badge { color: var(--accent-silver); }
.rank-3 .rank-badge { color: var(--accent-bronze); }

.standing-item-header img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
}

.team-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.standing-item-detail {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-blue);
    font-weight: 600;
    padding-left: 34px;
}

/* Responsive Mobile Optimizations */
@media (max-width: 640px) {
    #statusText {
        display: none !important;
    }
    .status-badge {
        padding: 6px 8px !important;
        gap: 0 !important;
        flex-shrink: 0 !important;
    }
    .dropdown-trigger {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 6px 12px !important;
        font-size: 13px !important;
    }
    .nav-actions {
        gap: 8px !important;
        flex-wrap: nowrap !important;
    }
    .podium-name {
        font-size: 15px;
    }
}
