/* static/css/pitcher_search_themed.css */
/* Visual styles for the redesigned pitcher_search page.
   Base typography and layout are inherited from best_matchups_redesign.css
   and player_search_themed.css. */

/* === HEADER === */
.pitcher-header {
    background-color: #161B22;
    border: 1px solid #30363D;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 100%;
    max-width: none;
}

/* Ensure anchor scrolls below the fixed nav */
#pitcher-info {
    scroll-margin-top: 70px;
}

/* Top row: player details + last start */
.pitcher-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    width: 100%;
    margin-left: 15px;
}
.pitcher-header .team-badge {
    font-size: 1.1rem;
    padding: 0.7em 0.9em;
}
.pitcher-header .player-details {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    flex-grow: 1;
}
.pitcher-header .pitcher-name {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #F0F6FC;
    margin: 0;
}
.pitcher-header .player-info p {
    font-size: 0.9rem;
    color: #8B949E;
    margin: 0;
}
.pitcher-header .player-bio {
    font-size: 0.85rem;
    color: #C9D1D9;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.2rem 0.6rem;
    margin: 0;
    margin-left: 1.5rem; /* nudge bio section right */
}
.pitcher-header .player-bio dt {
    font-weight: 500;
    color: #8B949E;
}
.pitcher-header .player-bio dd {
    margin: 0;
}
.pitcher-header .last-start-box {
    background-color: #161B22;
    border: 0.5px solid #21262D;
    padding: 0.75rem 1rem;
    flex: 1 1 280px;
    max-width: 100%;
    margin-right: 15px;
}
.pitcher-header .last-start-box .table {
    background-color: #161B22;
    border-color: #21262D;
}
.pitcher-header .last-start-box h6 {
    color: #F0F6FC;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #21262D;
    padding-bottom: 0.25rem;
}
.pitcher-header .last-start-box .table th,
.pitcher-header .last-start-box .table td {
    padding: 0.25rem;
    font-size: 0.8rem;
    color: #C9D1D9;
    border-color: #21262D;
    background-color: #161B22; /* match dark theme */
}
.pitcher-header .last-start-box .table th {
    background-color: rgba(13,17,23,0.5);
}

.pitcher-header .season-stats-container {
    margin-bottom: 0;
    flex: 1 1 100%;
    max-width: 100%;
}

/* === CONTENT SECTIONS === */
.recent-performance-container {
    background-color: #161B22;
    padding: 1.25rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 100%;
    max-width: none;
}
.recent-performance-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #F0F6FC;
    margin-bottom: 1rem;
    border-bottom: 1px solid #21262D;
    padding-bottom: 0.6rem;
}
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}
.performance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.performance-table th,
.performance-table td {
    padding: 1rem;
    border-bottom: 1px solid #21262D;
    white-space: nowrap;
}
.performance-table th {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: #C9D1D9;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    background-color: rgba(13,17,23,0.5);
}
.performance-table tbody tr:hover {
    background-color: rgba(88,166,255,0.03);
}
.performance-table td {
    color: #C9D1D9;
}
.performance-table td:first-child {
    font-weight: 500;
    color: #F0F6FC;
}

/* === SCHEDULE CARD === */
.schedule-card {
    background-color: #161B22;
    border: 1px solid #30363D;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 100%;
    max-width: none;
}
.schedule-card .recent-performance-title {
    margin-bottom: 1rem;
}

/* Schedule table specific tweaks */
#scheduleTable th,
#scheduleTable td {
    text-align: center;
    vertical-align: middle;
}
#scheduleTable .team-badge {
    font-size: 1rem;
    padding: 0.4em 0.7em;
}
#scheduleTable .sp-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #FFFFFF;
}
.vs-cell {
    width: 40px;
    font-weight: 600;
    color: #FFFFFF;
    position: relative;
    right: 70px; /* nudge further left for centering */
}
.vs-col { width: 40px; }

/* Probable lineup table */
.lineup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.lineup-table th,
.lineup-table td {
    padding: 1rem;
    border-bottom: 1px solid #21262D;
    color: #C9D1D9;
    vertical-align: middle;
    white-space: nowrap;
}
.lineup-table th {
    background-color: rgba(13,17,23,0.5);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
}
.lineup-table tbody tr:hover {
    background-color: #21262D;
}

/* Disable hover background for lineup section */
.game-info-row.lineup-row:hover {
    background-color: #161B22;
}
.lineup-last10 {
    font-size: 0.85rem;
    color: rgba(240, 246, 252, 0.85);
    font-weight: 500;
}
.lineup-player-name {
    font-size: 0.95rem;
    font-weight: 600;
    display: block;
    color: #FFFFFF;
}

/* === LOAD MORE BUTTON === */
.load-more-btn {
    background-color: #197BFF;
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.load-more-btn:hover {
    background-color: #3793FF;
}

/* === TEAM RANK FILTER === */
#rank-split.form-select,
#rank-range.form-select {
    background-color: #161B22;
    border: 1px solid #30363D;
    color: #C9D1D9;
    border-radius: 4px;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238B949E' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: auto;
}
#rank-split.form-select:focus,
#rank-range.form-select:focus {
    border-color: #58A6FF;
    box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, 0.25);
    outline: none;
}

/* === PROP PERFORMANCE FILTER + CHART === */
.ps-filter-box {
    background-color: #14171b;
    border: 1px solid #21262D;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}
.ps-chart-box {
    background-color: #14171b;
    border: 1px solid #21262D;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
}
.ps-prop-selector-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}
.ps-prop-selector__control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ps-prop-selector__control label {
    color: #8B949E;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    margin-bottom: 0;
}
.ps-prop-selector__select {
    background-color: #161B22;
    border: 1px solid #30363D;
    color: #C9D1D9;
    border-radius: 4px;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
    min-width: 100px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238B949E' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ps-prop-selector__select:focus {
    border-color: #58A6FF;
    box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, 0.25);
    outline: none;
}
.ps-prop-selector__slider-control {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 200px;
}

@media (max-width: 768px) {
    .ps-prop-selector-container {
        flex-direction: column; /* Stack controls vertically */
        align-items: stretch;    /* Full width for each row */
        gap: 0.75rem;
    }
}

#threshold-slider {
    accent-color: #58A6FF;
    flex-grow: 1;
    height: 4px;
    background: #30363D;
    border-radius: 2px;
    cursor: pointer;
    -webkit-appearance: none;
}
#threshold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #58A6FF;
    border: 2px solid #161B22;
    cursor: pointer;
    margin-top: -6px;
}
#threshold-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #58A6FF;
    border: 2px solid #161B22;
    cursor: pointer;
}
#threshold-value {
    color: #F0F6FC;
    font-weight: 600;
    font-size: 0.9rem;
    background-color: #1F6FEB;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    min-width: 2em;
    text-align: center;
}
.prop-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}
.prop-header-left { flex-grow: 1; }
#prop-player-name.card-title {
    font-size: 1.2rem;
    color: #F0F6FC;
    margin-bottom: 0.15rem;
    border-bottom: none;
    font-weight: 900;
}
#prop-player-name.card-title::after { display: none; }
#prop-history-title.prop-history-title {
    font-size: 1.1rem;
    color: #8B949E;
    font-weight: 500;
    margin-bottom: 0;
}

#hit-rate.hit-rate-box,
#prop-line-box.prop-line-box,
#opp-rank-box.rank-box {
    background: #161B22;
    border: 1px solid #30363D;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 1rem;
    row-gap: 0.25rem;
    text-align: center;
    width: 12rem;
    min-width: 12rem;
    box-sizing: border-box;
    margin: 0;
}

#opp-rank-box.rank-box {
    width: 9rem;
    min-width: 9rem;
}

#opp-rank-box .label,
#opp-rank-box .value {
    grid-column: span 3;
}

#opp-rank-box .label {
    font-size: 0.75rem;
    color: #8B949E;
    text-transform: uppercase;
    white-space: nowrap;
}

#opp-rank-box .value {
    font-size: 0.95rem;
    color: #F0F6FC;
    font-weight: 600;
}

.full-span {
    grid-column: span 3;
}

#hit-rate .label {
    font-size: 0.75rem;
    color: #8B949E;
    text-transform: uppercase;
    white-space: nowrap;
}
#prop-line-box .label {
    font-size: 0.75rem;
    color: #8B949E;
    text-transform: uppercase;
    white-space: nowrap;
}
#hit-rate .value {
    font-size: 0.95rem;
    color: #F0F6FC;
    font-weight: 600;
}
#prop-line-box .value {
    font-size: 0.95rem;
    color: #F0F6FC;
    font-weight: 600;
}
.highlight-col {
    background: rgba(25, 123, 255, 0.25);
    border-radius: 4px;
}
.prop-logo-box img {
    width: 28px;
    height: 28px;
    opacity: 0.7;
}
#propPulseChart {
    height: 250px;
    background: transparent;
    padding: 0;
    margin-top: 0.5rem;
}

/* Game Range Summary */
#game-range-summary.ps-game-range-summary {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #0D1117;
    border-top: 1px solid #58A6FF;
    padding: 0.75rem 1rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    color: #C9D1D9;
    z-index: 1000;
    display: none;
}
#game-range-summary .summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
#game-range-summary .summary-title {
    font-size: 1rem;
    font-weight: 600;
    color: #F0F6FC;
}
#game-range-summary .clear-btn {
    background-color: #484F58;
    border: 1px solid #484F58;
    color: #C9D1D9;
    padding: 0.25em 0.75em;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
#game-range-summary .clear-btn:hover {
    background-color: #58A6FF;
    color: #FFFFFF;
    border-color: #58A6FF;
}
#game-range-summary table th,
#game-range-summary table td {
    padding: 0.5rem;
    font-size: 0.8rem;
    color: #C9D1D9;
    white-space: nowrap;
}
#game-range-summary table th {
    background-color: rgba(88, 166, 255, 0.05);
    color: #F0F6FC;
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1051;
}
.loading-spinner .spinner-border {
    border-color: #58A6FF;
    border-right-color: transparent;
    width: 3rem;
    height: 3rem;
}

/* Home/Away & L/R splits layout */
.ha-splits-line {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem 1rem;
}
.ha-splits-line .stat-item {
    margin-bottom: 0;
}
.ha-splits-line .home-stat { grid-column: 1; grid-row: 1; }
.ha-splits-line .away-stat { grid-column: 1; grid-row: 2; }
.ha-splits-line .vs-lh-stat { grid-column: 2; grid-row: 1; }
.ha-splits-line .vs-rh-stat { grid-column: 2; grid-row: 2; }

@media (max-width: 600px) {
    .ha-splits-line {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    .ha-splits-line .stat-item {
        width: 100%;
    }
    .ha-splits-line .home-stat { order: 1; }
    .ha-splits-line .away-stat { order: 2; }
    .ha-splits-line .vs-lh-stat { order: 3; }
    .ha-splits-line .vs-rh-stat { order: 4; }
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 992px) {
    .pitcher-header-top {
        flex-direction: column;
        align-items: stretch;
    }
    .pitcher-header .player-details {
        width: 100%;
    }
    .pitcher-header .last-start-box {
        width: 100%;
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .pitcher-header {
        padding: 1rem;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    .pitcher-header .player-details {
        gap: 0.75rem;
    }
    .pitcher-header .pitcher-name {
        font-size: 1.6rem;
    }
    .pitcher-header .player-info p {
        font-size: 0.85rem;
    }
    .pitcher-header .team-badge {
        font-size: 1rem;
        padding: 0.35em 0.6em;
    }
    .pitcher-header .player-bio {
        font-size: 0.8rem;
    }
    .pitcher-header .last-start-box {
        padding: 0.6rem 0.8rem;
    }
    .pitcher-header .last-start-box h6 {
        font-size: 0.9rem;
    }
    .pitcher-header .last-start-box .table th,
    .pitcher-header .last-start-box .table td {
        font-size: 0.75rem;
    }
}

@media (max-width: 992px) {
    .prop-history-header {
        justify-content: flex-start; /* boxes appear below title */
        align-items: flex-start;
    }
    .prop-header-left {
        flex-basis: 100%;
        margin-bottom: 0.25rem;
    }
    #prop-line-box.prop-line-box,
    #hit-rate.hit-rate-box,
    #opp-rank-box.rank-box {
        width: 8rem;
        min-width: 8rem;
        font-size: 0.8rem;
        column-gap: 0.5rem;
        padding: 0.5rem;
    }
    #opp-rank-box.rank-box {
        width: 6rem;
        min-width: 6rem;
    }
    #prop-line-box .label,
    #hit-rate .label,
    #opp-rank-box .label {
        font-size: 0.65rem;
    }
    #prop-line-box .value,
    #hit-rate .value,
    #opp-rank-box .value {
        font-size: 0.85rem;
    }
    .prop-logo-box {
        display: block;
    }
}
@media (max-width: 600px) {
    #scheduleTable thead {
        display: none;
    }
    #scheduleTable, #scheduleTable tbody, #scheduleTable tr, #scheduleTable td {
        display: block;
        width: 100%;
    }
    #scheduleTable tr {
        border-bottom: 1px solid #21262D;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    #scheduleTable td {
        text-align: left;
        padding: 0.25rem 0;
    }
    /* Left align matchup cell contents when stacked for mobile */
    #scheduleTable td.text-center {
        text-align: left !important;
    }
    #scheduleTable .vs-cell,
    #scheduleTable .vs-col {
        display: none;
    }
}

@media (max-width: 600px) {
    .pitcher-header-top {
        margin-left: 0;
    }
    .pitcher-header .player-bio {
        margin-left: 0;
    }
    .pitcher-header .last-start-box {
        margin-right: 0;
        display: none;
    }
    main {
        padding: 1rem 10px;
    }
    .pitcher-header,
    .recent-performance-container,
    .schedule-card,
    .ps-filter-box,
    .ps-chart-box {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 600px) {
    #prop-line-box.prop-line-box,
    #hit-rate.hit-rate-box,
    #opp-rank-box.rank-box {
        width: 100%;
        min-width: 0;
        font-size: 0.7rem;
        column-gap: 0.4rem;
        padding: 0.4rem;
    }
    #prop-line-box .label,
    #hit-rate .label,
    #opp-rank-box .label {
        font-size: 0.55rem;
    }
    #prop-line-box .value,
    #hit-rate .value,
    #opp-rank-box .value {
        font-size: 0.8rem;
    }
    .prop-logo-box img {
        width: 22px;
        height: 22px;
    }
    #opp-rank-label {
        font-size: 0.55rem;
    }
}

@media (max-width: 480px) {
    main {
        padding: 1rem 5px;
    }
    .pitcher-header,
    .recent-performance-container,
    .schedule-card,
    .ps-filter-box,
    .ps-chart-box {
        padding-left: 5px;
        padding-right: 5px;
    }
}

/* Pitcher Search Page Polish */
.schedule-card .performance-table {
    border: none;
}

.schedule-card .schedule-row {
    border-bottom: 1px solid #30363D;
    transition: background-color 0.2s ease-in-out;
}

.schedule-card .schedule-row:hover {
    background-color: #1C2128;
}

.schedule-card .sp-name {
    color: #58A6FF;
}

.pitcher-header .player-details {
    align-items: flex-start;
}

.pitcher-header .last-start-box {
    margin-top: 0;
}

.recent-performance-container .performance-table th {
    background-color: #0D1117;
}

.game-info-row {
    border-color: #21262D;
}

.team-ranking-line .stat-item {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.team-ranking-line .stat-item .stat-label {
    color: #8B949E;
}