/* /css/playoff-bracket.css */

:root {
    --bracket-border-color: #ddd;
    --bracket-bg-color: #f8f9fa;
    --winner-color: #28a745;
    --winner-bg: #e8f5e8;
    --team-hover-bg: #e9ecef;
    --playin-bg-color: #fff;
    --bg-color: #fff; 
    --details-border-color: #ddd;
    --details-summary-bg: #f8f9fa;
    --details-summary-hover-bg: #e9ecef;
}

.dark-mode {
    --bracket-border-color: #444;
    --bracket-bg-color: #2c2c2c;
    --winner-color: #66bb6a;
    --winner-bg: #3a4a3a;
    --team-hover-bg: #383838;
    --playin-bg-color: #1e1e1e;
    --bg-color: #121212; 
    --details-border-color: #444;
    --details-summary-bg: #2c2c2c;
    --details-summary-hover-bg: #383838;
}

#play-in-details {
    border: 1px solid var(--details-border-color);
    border-radius: 8px;
    margin-bottom: 2rem;
    background-color: var(--playin-bg-color);
}

#play-in-summary {
    padding: 1rem 1.5rem;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    list-style: none; 
    background-color: var(--details-summary-bg);
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

    #play-in-summary::-webkit-details-marker {
        display: none; 
    }

    #play-in-summary:hover {
        background-color: var(--details-summary-hover-bg);
    }

#play-in-details[open] #play-in-summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: 1px solid var(--details-border-color);
}

.play-in-content-wrapper {
    padding: 1.5rem;
}

.play-in-section {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    flex-wrap: wrap;
}

.play-in-conference {
    background-color: var(--playin-bg-color);
    border: 1px solid var(--bracket-border-color);
    border-radius: 8px;
    padding: 1.5rem;
    width: 100%;
    max-width: 550px;
    flex-grow: 1;
}

.page-header + .play-in-section {
    margin-bottom: 2rem;
}

#play-in-details .play-in-conference {
    border: none;
    padding: 0;
}

#play-in-details .play-in-content-wrapper {
    padding: 1.5rem;
}

.play-in-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.play-in-matchup {
    margin-bottom: 1rem;
}

    .play-in-matchup .matchup-label {
        font-size: 0.8rem;
        font-weight: bold;
        color: #666;
        margin-bottom: 0.25rem;
        text-align: center;
    }

.dark-mode .play-in-matchup .matchup-label {
    color: #bbb;
}

.play-in-matchup .team {
    width: 100%;
}

.bracket-container {
    width: 100%;
    overflow-x: auto;
    padding: 1rem 0;
    -webkit-overflow-scrolling: touch;
}

.bracket {
    display: grid;
    grid-template-areas: "titles" "body";
    grid-template-rows: auto 1fr;
    min-width: 1140px;
}

.bracket-header-row {
    grid-area: titles;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.bracket-body-row {
    grid-area: body;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.round-title {
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
}

    .round-title .series-format {
        display: block;
        font-size: 0.85rem;
        font-weight: normal;
        color: #6c757d;
        margin-top: 4px;
    }

.dark-mode .round-title .series-format {
    color: #adb5bd;
}

.round-column {
    display: flex;
    flex-direction: column;
    padding: 0 0.75rem;
}

.conference-section {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.conference-subtitle {
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    color: #6c757d;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.dark-mode .conference-subtitle {
    color: #adb5bd;
}

.conference-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    align-items: center; 
}

.matchup-subgroup {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex-grow: 1;
    width: 100%;
    align-items: center; 
}

.matchup {
    display: inline-flex; 
    flex-direction: column;
    position: relative;
    margin: 0.75rem 0;
}

.team {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background-color: var(--bracket-bg-color);
    border: 1px solid var(--bracket-border-color);
    border-radius: 4px;
    width: 210px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

    .team:hover {
        background-color: var(--team-hover-bg);
        border-color: #007bff;
    }

    .team:first-of-type {
        margin-bottom: 1rem;
    }

    .team.winner {
        font-weight: bold;
        border-color: var(--winner-color);
        background-color: var(--winner-bg);
    }

    .team.tbd {
        font-style: italic;
        color: #777;
    }

.dark-mode .team.tbd {
    color: #aaa;
}

.team.non-interactive {
    pointer-events: none;
}

.team-logo {
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.team-info {
    display: flex;
    justify-content: space-between;
    flex-grow: 1;
    align-items: center;
}

.team-seed {
    font-weight: bold;
    margin-right: 0.5rem;
    color: #666;
    min-width: 20px;
}

.dark-mode .team-seed {
    color: #bbb;
}

.team-name {
    font-size: 0.9rem;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.series-score {
    font-size: 0.9rem;
    font-weight: bold;
}

.team-record {
    font-size: 0.85rem;
    color: #666;
    font-weight: normal;
    white-space: nowrap;
}

.dark-mode .team-record {
    color: #bbb;
}

.team.winner .series-score {
    color: var(--winner-color);
}

.is-clickable:hover {
    outline: 2px solid gold;
    border-radius: 8px;
    cursor: pointer;
}

.final-round {
    justify-content: center;
    align-items: center;
}

.finals-champion {
    text-align: center;
}

.champion-box {
    background-color: var(--bracket-bg-color);
    border: 2px solid gold;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .champion-box .team-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    .champion-box h3 {
        font-size: 1.3rem;
        white-space: nowrap;
    }

    .champion-box h4 {
        font-size: 1.2rem;
        margin-top: 0.5rem;
    }

@media (max-width: 1140px) {
    .bracket {
        min-width: 1020px;
    }

    .team {
        width: 185px;
    }
}

@media (max-width: 768px) {
    .page-header h2 {
        font-size: 1.8rem;
    }

    main {
        padding: 1rem;
    }

    .play-in-section {
        flex-direction: column;
        gap: 1rem;
    }

    .play-in-title {
        font-size: 1.3rem;
    }

    #play-in-summary {
        font-size: 1.2rem;
    }

    .team-name {
        font-size: 0.8rem;
    }
}

/* ====================================================================== */
/* MODERN STYLE OVERRIDES (only apply when data-style-rollout="modern") */
/* ====================================================================== */

[data-style-rollout="modern"] #play-in-details,
[data-style-rollout="modern"] .play-in-conference,
[data-style-rollout="modern"] .champion-box,
[data-style-rollout="modern"] .matchup {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

[data-style-rollout="modern"] #play-in-summary {
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    border: 1px solid #e5e7eb;
    color: #0f172a;
}

[data-style-rollout="modern"] .play-in-title,
[data-style-rollout="modern"] .round-title {
    color: #0f172a;
}

[data-style-rollout="modern"] .round-title .series-format,
[data-style-rollout="modern"] .matchup-label {
    color: #1f2937;
}

[data-style-rollout="modern"] .team {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-color: #e5e7eb;
}

[data-style-rollout="modern"] .team:hover {
    background: linear-gradient(145deg, #f8fafc, #edf2ff);
}

[data-style-rollout="modern"] .team.winner {
    background: linear-gradient(145deg, #ecfdf3, #d1fae5);
    border-color: #86efac;
}

[data-style-rollout="modern"] .team.tbd {
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
}

[data-style-rollout="modern"] .team-name,
[data-style-rollout="modern"] .team-record {
    color: #0f172a;
}

[data-style-rollout="modern"] header {
    background: linear-gradient(135deg, #0f172a, #111d35);
    border-bottom: 1px solid #1f2937;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
}

[data-style-rollout="modern"] footer {
    background: linear-gradient(135deg, #0f172a, #111d35);
    border-top: 1px solid #1f2937;
}

[data-style-rollout="modern"] footer a {
    color: #60a5fa;
}

[data-style-rollout="modern"] footer a:hover {
    color: #93c5fd;
}

[data-style-rollout="modern"].dark-mode #play-in-details,
[data-style-rollout="modern"].dark-mode .play-in-conference,
[data-style-rollout="modern"].dark-mode .champion-box,
[data-style-rollout="modern"].dark-mode .matchup {
    background: linear-gradient(145deg, #1a1f2e, #1e2433);
    border: 1px solid #2d3748;
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.35);
}

[data-style-rollout="modern"].dark-mode #play-in-summary {
    background: linear-gradient(145deg, #111827, #0f172a);
    border-color: #2d3748;
    color: #e5e7eb;
}

[data-style-rollout="modern"].dark-mode .play-in-title,
[data-style-rollout="modern"].dark-mode .round-title {
    color: #e5e7eb;
}

[data-style-rollout="modern"].dark-mode .round-title .series-format,
[data-style-rollout="modern"].dark-mode .matchup-label {
    color: #cbd5e1;
}

[data-style-rollout="modern"].dark-mode .team {
    background: linear-gradient(145deg, #1a1f2e, #1e2433);
    border-color: #2d3748;
}

[data-style-rollout="modern"].dark-mode .team:hover {
    background: linear-gradient(145deg, #0b1220, #111827);
}

[data-style-rollout="modern"].dark-mode .team.winner {
    background: linear-gradient(145deg, #1e2a1f, #223024);
    border-color: #4ade80;
}

[data-style-rollout="modern"].dark-mode .team.tbd {
    background: linear-gradient(145deg, #111827, #0f172a);
}

[data-style-rollout="modern"].dark-mode .team-name,
[data-style-rollout="modern"].dark-mode .team-record {
    color: #e5e7eb;
}

[data-style-rollout="modern"].dark-mode footer {
    background: linear-gradient(135deg, #1a1f2e, #1e2433);
    border-top: 1px solid #2d3748;
}

[data-style-rollout="modern"].dark-mode footer a {
    color: #60a5fa;
}

[data-style-rollout="modern"].dark-mode footer a:hover {
    color: #93c5fd;
}

