/* Golf (PGA Tour) Page Styles */

.tournament-status-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 8px;
    margin-top: 0.5rem;
}
.status-completed {
    background: rgba(34, 224, 122, 0.12);
    color: var(--color-accent);
    border: 1px solid rgba(34, 224, 122, 0.25);
}
.status-in_progress, .status-active {
    background: rgba(255, 193, 7, 0.12);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.25);
}
.status-upcoming {
    background: rgba(46, 125, 50, 0.12);
    color: #2e7d32;
    border: 1px solid rgba(46, 125, 50, 0.25);
}
.status-cancelled {
    background: rgba(244, 67, 54, 0.12);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.25);
}

/* ── Golf Player Picker (dropdown-based comparison) ── */
.golf-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.golf-player-picker {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    padding: 10px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-foreground);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    appearance: auto;
}

.golf-player-picker:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-accent-subtle);
}

.golf-player-picker option {
    background: var(--color-surface);
    color: var(--color-foreground);
}

.golf-picker-vs {
    color: var(--color-muted);
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* ── Comparison Legend ── */
/* (detail/legend styles are now in components.css — keep only golf-specific overrides here) */

/* ── Hole Images Gallery ─────────────────────────────────────────── */
.hole-images-section {
    margin-top: 1.5rem;
    width: 100%;
}

.hole-images-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-secondary, #9ca3af);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hole-images-row-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.hole-images-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    transition: transform 0.35s ease;
    will-change: transform;
}

.hole-image-card {
    position: relative;
    flex: 0 0 auto;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s;
}

.hole-image-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

.hole-image {
    display: block;
    width: auto;
    height: 100%;
    max-height: 220px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.hole-number {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    line-height: 1.4;
}

/* ── Hole Image Navigation Arrows ────────────────────────────────── */
.hole-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    z-index: 2;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
    padding: 0;
    line-height: 1;
}

.hole-nav-arrow:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.75);
}

.hole-nav-arrow:disabled {
    opacity: 0.25;
    cursor: default;
}

.hole-nav-left {
    left: 8px;
}

.hole-nav-right {
    right: 8px;
}

/* ── Overflow protection (all widths — prevents content cut-off on iPad/tablet) ── */
.page {
    overflow-x: hidden;
}

.driver-card {
    min-width: 0;
    overflow: hidden;
}

.card-section {
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stat-table {
    min-width: 0;
}

/* ── Player Table ─────────────────────────────────────────────── */
.golf-players-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1rem;
}

.golf-players-toolbar .section-heading {
    margin-bottom: 0;
}

.golf-search-wrapper {
    flex-shrink: 0;
}

.golf-search-input {
    padding: 8px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-foreground);
    font-size: 0.9rem;
    font-family: inherit;
    min-width: 220px;
    transition: border-color 0.2s;
}

.golf-search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-accent-subtle);
}

.golf-search-input::placeholder {
    color: var(--color-muted-2);
}

.golf-players-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-brown-surface);
    border: 1px solid var(--color-brown-border);
    border-radius: 12px;
    overflow: hidden;
}

.golf-players-table thead th {
    background: var(--color-brown-subtle);
    color: var(--color-muted-2);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid var(--color-brown-border);
}

.golftbl-flag { width: 36px; text-align: center; }
.golftbl-score { width: 100px; text-align: center; }
.golftbl-stat { width: 90px; text-align: center; }
.golftbl-expand { width: 44px; text-align: center; }

.golf-player-row {
    cursor: pointer;
    transition: background 0.15s;
}

.golf-player-row:hover {
    background: rgba(34, 224, 122, 0.06);
}

.golf-player-row td {
    padding: 10px 12px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-foreground);
    vertical-align: middle;
}

.golf-player-row .clovera-score {
    font-size: 0.85em;
    margin-left: 0;
}

.golf-player-name-text {
    font-weight: 600;
}

.golftbl-sg-total,
.golftbl-birdie-pct {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--color-foreground);
}

/* Expand button */
.golf-expand-btn {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s, background 0.15s, color 0.15s;
    padding: 0;
    line-height: 1;
}

.golf-expand-btn:hover {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
}

.golf-player-row.expanded .golf-expand-btn {
    transform: rotate(90deg);
}

/* Detail row */
.golf-player-detail {
    background: rgba(0, 0, 0, 0.18);
}

.golf-player-detail td {
    border-bottom: 1px solid var(--color-border);
}

.golftbl-detail-cell {
    padding: 0 !important;
}

.golf-detail-content {
    padding: 16px 20px;
}

.golf-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.golf-detail-player-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-foreground);
}

.golf-detail-content .stat-category {
    margin-bottom: 0.75rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 10px 14px;
}

.golf-detail-content .stat-category:last-child {
    margin-bottom: 0;
}

.golf-detail-content .stat-category-header {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-muted-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    list-style: none;
    margin-bottom: 6px;
}

.golf-detail-content .stat-category-header::-webkit-details-marker {
    display: none;
}

.golf-detail-content .stat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.golf-detail-content .stat-table td {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.golf-detail-content .stat-table td:first-child {
    color: var(--color-muted);
}

.golf-detail-content .stat-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--color-foreground);
}

/* ── Responsive: mobile ── */
@media (max-width: 600px) {
    .page {
        padding: 24px 12px 64px;
    }

    .driver-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .driver-identity {
        flex-wrap: wrap;
        min-width: 0;
    }

    .driver-name {
        font-size: 1rem;
        min-width: 0;
    }

    .golf-picker-row {
        flex-direction: column;
        gap: 8px;
    }

    .golf-player-picker {
        max-width: 100%;
        min-width: 0;
    }

    .section-heading {
        font-size: 1rem;
    }

    .golf-players-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .golf-search-input {
        min-width: 0;
        width: 100%;
    }

    .golf-players-table {
        font-size: 0.82rem;
    }

    .golftbl-stat {
        display: none;
    }

    .golf-players-table thead .golftbl-stat {
        display: none;
    }

    .golf-detail-content {
        padding: 12px 14px;
    }
}
