/* BOTB Voting Interface Styles v15 */

/* =========================================
   VOTING PAGE LAYOUT
   ========================================= */
.voting-page {
    padding: var(--space-lg) 0;
    max-width: 1200px;
    margin: 0 auto;
}

.voting-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.voting-title {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.voting-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Voting Status Banner */
.voting-status-banner {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
}

.voting-status-banner.open {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.voting-status-banner.closed {
    background: rgba(255, 152, 0, 0.15);
    color: var(--warning);
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.voting-status-banner .status-icon {
    font-size: 1.1rem;
}

/* =========================================
   MATCHUP VOTING LAYOUT
   ========================================= */
.voting-matchup {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-xl);
    align-items: start;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.voting-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 120px;
}

.voting-vs-text {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.voting-vs-round {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: var(--space-sm);
}

/* =========================================
   ARTIST VOTING CARD
   ========================================= */
.voting-artist-card {
    position: relative;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.voting-artist-card.selected {
    background: rgba(var(--primary-rgb), 0.05);
}

.voting-artist-card.selected::before {
    content: 'YOUR PICK';
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    background: var(--primary);
    color: var(--text-inverse);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    z-index: 30;
}

.voting-artist-info {
    padding: var(--space-lg);
}

.voting-song-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    line-height: 1.2;
}

.voting-artist-name {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

/* =========================================
   SCORE SLIDER
   ========================================= */
.score-slider-container {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.score-slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.score-slider-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.score-slider-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 40px;
    text-align: right;
}

.score-slider-value.unrated {
    color: var(--text-muted);
    font-size: 1.25rem;
}

.score-slider-wrapper {
    position: relative;
    padding: 0 12px;
}

.score-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    margin: 0;
}

.score-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all var(--transition-fast);
}

.score-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.score-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: var(--radius-full);
    cursor: pointer;
    border: none;
}

.score-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 12px;
    margin-top: var(--space-sm);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.score-labels span {
    width: 20px;
    text-align: center;
}

.score-labels span:first-child {
    text-align: left;
}

.score-labels span:last-child {
    text-align: right;
}

/* =========================================
   PICK WINNER BUTTON
   ========================================= */
.pick-winner-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md);
    margin-top: var(--space-md);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pick-winner-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.pick-winner-btn:active {
    transform: scale(0.98);
}

.pick-winner-btn.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 4px 12px var(--vhs-glow);
}

.pick-winner-btn .pick-icon {
    width: 18px;
    height: 18px;
}

/* Hide the card "YOUR PICK" badge when using button */
.voting-artist-card.selected::before {
    display: none;
}

/* =========================================
   SUBMIT VOTE
   ========================================= */
.voting-submit {
    text-align: center;
    margin-top: var(--space-2xl);
    padding: var(--space-xl);
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 2px solid var(--border);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.voting-instructions {
    font-size: 0.95rem;
}

.voting-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-2xl);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--primary);
    color: var(--text-inverse);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.voting-submit-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--vhs-glow);
}

.voting-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Validation message */
.voting-validation-msg {
    color: var(--error);
    font-size: 0.9rem;
}

/* Warning callout */
.voting-warning-msg {
    display: inline-block;
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    text-align: left;
}

.voting-warning-msg::before {
    content: '\26a0 ';
}

/* =========================================
   MATCHUP LIST (Current Voting)
   ========================================= */
.matchup-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-lg);
}

/* Responsive columns based on matchup count */
.matchup-list.count-1 {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.matchup-list.count-2 {
    grid-template-columns: repeat(2, 1fr);
}

.matchup-list.count-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* For 4+ matchups, use flexible auto-fill */
.matchup-list.count-many {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.matchup-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.matchup-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.matchup-card-header {
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.matchup-round-badge {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
}

.matchup-card-body {
    display: flex;
    align-items: center;
    padding: var(--space-md);
}

.matchup-artist-mini {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.matchup-artist-mini img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.matchup-artist-mini-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.matchup-vs-mini {
    padding: 0 var(--space-md);
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-muted);
}

.matchup-card-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.matchup-voted-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--success);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.matchup-vote-btn {
    padding: var(--space-sm) var(--space-lg);
}

/* =========================================
   TABLET RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
    .voting-matchup {
        gap: var(--space-lg);
    }

    .voting-vs {
        padding-top: 80px;
    }

    .voting-vs-text {
        font-size: 2rem;
    }

    .voting-song-title {
        font-size: 1.2rem;
    }
}

/* =========================================
   MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .voting-page {
        padding: var(--space-md) 0;
    }

    .voting-matchup {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-md);
        padding: 0 var(--space-sm);
    }

    .voting-vs {
        display: none;
    }

    .voting-artist-card {
        border-width: 2px;
        border-radius: var(--radius-lg);
    }

    .voting-artist-card.selected::before {
        top: var(--space-sm);
        left: var(--space-sm);
        font-size: 0.6rem;
        padding: 2px 6px;
    }

    .voting-artist-info {
        padding: var(--space-md);
    }

    .voting-song-title {
        font-size: 1rem;
        margin-bottom: 2px;
    }

    .voting-artist-name {
        font-size: 0.85rem;
        margin-bottom: var(--space-sm);
    }

    .score-slider-container {
        padding: var(--space-sm);
        margin-top: var(--space-sm);
    }

    .score-slider-label {
        margin-bottom: var(--space-xs);
    }

    .score-slider-title {
        font-size: 0.7rem;
    }

    .score-slider-value {
        font-size: 1.25rem;
    }

    .score-slider::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }

    .score-slider-wrapper {
        padding: 0 10px;
    }

    .score-labels {
        padding: 0 10px;
        font-size: 0.65rem;
    }

    .pick-winner-btn {
        padding: var(--space-sm);
        margin-top: var(--space-sm);
        font-size: 0.8rem;
    }

    .voting-submit {
        margin-top: var(--space-xl);
        padding: var(--space-lg);
        margin-left: var(--space-sm);
        margin-right: var(--space-sm);
    }

    .voting-instructions {
        font-size: 0.85rem;
    }

    .voting-submit-btn {
        padding: var(--space-md) var(--space-xl);
        font-size: 1rem;
    }

    /* Matchup list mobile */
    .matchup-list,
    .matchup-list.count-1,
    .matchup-list.count-2,
    .matchup-list.count-3,
    .matchup-list.count-many {
        grid-template-columns: 1fr;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .voting-matchup {
        gap: var(--space-sm);
    }

    .voting-song-title {
        font-size: 0.9rem;
    }

    .voting-artist-name {
        font-size: 0.75rem;
        margin-bottom: var(--space-xs);
    }

    .voting-artist-info {
        padding: var(--space-sm);
    }

    .score-slider-container {
        padding: var(--space-xs);
    }

    .score-slider-title {
        font-size: 0.65rem;
    }

    .score-slider-value {
        font-size: 1.1rem;
    }

    .score-labels {
        margin-top: var(--space-xs);
    }

    .pick-winner-btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.75rem;
        gap: var(--space-xs);
    }

    .pick-winner-btn .pick-icon {
        width: 14px;
        height: 14px;
    }
}

/* =========================================
   ARTIST PLACEHOLDER
   ========================================= */
.artist-placeholder {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--text-inverse);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

/* =========================================
   MATCHUP CARD STYLES (Current voting list)
   ========================================= */
.matchup-song-mini-title {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
}

.matchup-artist-mini-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.matchup-round-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.matchup-number {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Voted card styling */
.matchup-card.voted {
    border-color: var(--voted-border);
}

.matchup-card.voted:hover {
    border-color: var(--voted-border-hover);
}

.matchup-voted-badge .icon {
    width: 14px;
    height: 14px;
}

/* Voted song name highlight */
.matchup-song-mini-title.voted-choice {
    color: var(--voted-text);
}

/* Light mode voted colors */
:root, [data-theme="light"] {
    --voted-border: #22c55e;
    --voted-border-hover: #16a34a;
    --voted-text: #16a34a;
    --voted-badge-bg: #22c55e;
    --voted-badge-text: #ffffff;
}

/* Dark mode voted colors */
[data-theme="dark"] {
    --voted-border: #4ade80;
    --voted-border-hover: #22c55e;
    --voted-text: #4ade80;
    --voted-badge-bg: #22c55e;
    --voted-badge-text: #0A0A12;
}

/* =========================================
   COMPLETED MATCHUP STYLES
   ========================================= */
.matchup-card.completed {
    border-color: var(--border);
    background: var(--surface);
}

.matchup-final-badge {
    background: var(--accent-gold);
    color: #000;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.matchup-artist-mini.winner {
    position: relative;
}

.matchup-artist-mini.loser {
    opacity: 0.6;
}

.matchup-song-mini-title.winner-text {
    color: var(--accent-gold);
}

.winner-trophy {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.matchup-score {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

.matchup-artist-mini.winner .matchup-score {
    color: var(--accent-gold);
    font-weight: 600;
}

/* Results body layout */
.matchup-results-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
}

.result-artist {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.result-artist.winner {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--accent-gold);
}

.result-artist.loser {
    opacity: 0.6;
}

.result-artist-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
    min-width: 0;
}

.result-art-group {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-song-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.result-artist-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.result-artist-img.has-song-art {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--surface);
}

.result-artist-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.result-song-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-artist.winner .result-song-title {
    color: var(--accent-gold);
}

.result-artist-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.winner-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-gold);
    flex-shrink: 0;
    margin-left: var(--space-sm);
}

.result-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    margin-left: var(--space-md);
}

.result-votes {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.result-artist.winner .result-votes {
    color: var(--accent-gold);
}

.result-pct {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.result-score {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.result-artist.winner .result-score {
    background: rgba(255, 215, 0, 0.2);
    color: var(--accent-gold);
}

/* Vote comparison bar */
.vote-comparison-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.vote-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.vote-bar-fill.artist1 {
    background: var(--primary);
}

.vote-bar-fill.artist2 {
    background: var(--text-muted);
}

.vote-bar-fill.winner {
    background: var(--accent-gold);
}
