/**
 * Polls & Predictions Styles
 * Fan voting, predictions, and leaderboards
 */

/* Fan Engagement Section - Side by Side Layout */
.fan-engagement-section {
    position: relative;
    padding: var(--space-8) var(--space-6);
    max-width: var(--container-2xl);
    margin: 0 auto;
    background: var(--neutral-white);
}

.engagement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    align-items: start;
}

.engagement-column {
    min-height: 400px;
}

.section-header-engagement {
    margin-bottom: var(--space-5);
}

.section-header-engagement h2 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--neutral-950);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.section-header-engagement .arrow {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-light);
    color: var(--brand-gold-900);
}

/* Poll Card */
.poll-card {
    background: var(--neutral-white);
    border: 2px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    transition: all 0.3s ease;
    overflow: hidden; /* Prevent content from overflowing */
}

.poll-card:hover {
    border-color: var(--brand-gold-900);
    box-shadow: 0 4px 12px rgba(255, 184, 28, 0.15);
}

.poll-header {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--neutral-200);
}

.poll-question {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--brand-navy-900);
    margin: 0 0 var(--space-2) 0;
    line-height: var(--line-height-snug);
}

.poll-time-left {
    font-size: var(--font-size-xs);
    color: var(--neutral-600);
    font-weight: var(--font-weight-medium);
}

.poll-badge {
    background: #FFB81C;
    color: #041E42;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.poll-badge.live {
    background: #28a745;
    color: white;
}

.poll-badge.ended {
    background: #6c757d;
    color: white;
}

/* Poll Options */
.poll-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.poll-option {
    width: 100%;
    max-width: 100%;
    position: relative;
    background: var(--neutral-100);
    border: 2px solid var(--neutral-300);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--neutral-900);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    word-wrap: break-word;
}

.poll-option:hover {
    border-color: var(--brand-gold-900);
    background: var(--neutral-white);
    transform: translateX(4px);
}

.poll-option.result {
    cursor: default;
    border-color: var(--neutral-300);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.poll-option.result.selected {
    border-color: var(--brand-gold-900);
    background: linear-gradient(135deg, rgba(255, 184, 28, 0.1) 0%, rgba(255, 184, 28, 0.05) 100%);
}

.option-content {
    width: 100%;
}

.option-text {
    display: block;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-2);
}

.option-percentage-bar {
    width: 100%;
    height: 8px;
    background: var(--neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-2);
}

.option-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-gold-900) 0%, var(--brand-gold-600) 100%);
    transition: width 0.5s ease;
}

.option-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-percentage {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--brand-navy-900);
}

.option-check {
    color: var(--brand-gold-900);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
}

.poll-option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.poll-option-text {
    font-size: 16px;
    font-weight: 500;
    color: #041E42;
}

.poll-option-percentage {
    font-size: 18px;
    font-weight: 700;
    color: #041E42;
}

.poll-option-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,184,28,0.2) 0%, rgba(255,184,28,0.05) 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
    z-index: 1;
}

.poll-option-votes {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

/* Poll Footer */
.poll-footer {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--neutral-200);
}

.poll-votes-text {
    font-size: var(--font-size-sm);
    color: var(--brand-gold-900);
    font-weight: var(--font-weight-semibold);
}

.poll-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #666;
}

.poll-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.poll-stat svg {
    width: 16px;
    height: 16px;
}

.poll-action-btn {
    background: #FFB81C;
    color: #041E42;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.poll-action-btn:hover:not(:disabled) {
    background: #e5a519;
    transform: translateY(-2px);
}

.poll-action-btn:disabled {
    background: #ddd;
    color: #999;
    cursor: not-allowed;
}

/* Predictions */
.prediction-card {
    background: linear-gradient(135deg, #041E42 0%, #1a3a5c 100%);
    color: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.prediction-title {
    font-size: 20px;
    font-weight: 600;
}

.prediction-icon {
    width: 32px;
    height: 32px;
    opacity: 0.8;
}

.prediction-matchup {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 24px 0;
}

.prediction-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1;
    cursor: pointer;
    padding: 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.prediction-team:hover {
    background: rgba(255,255,255,0.1);
}

.prediction-team.selected {
    background: rgba(255,184,28,0.3);
    border: 2px solid #FFB81C;
}

.prediction-team-logo {
    width: 60px;
    height: 60px;
}

.prediction-team-name {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.prediction-odds {
    font-size: 14px;
    opacity: 0.8;
}

.prediction-vs {
    font-size: 20px;
    font-weight: 700;
    color: #FFB81C;
}

.prediction-submit {
    width: 100%;
    background: #FFB81C;
    color: #041E42;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prediction-submit:hover:not(:disabled) {
    background: #e5a519;
    transform: translateY(-2px);
}

.prediction-submit:disabled {
    background: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.5);
    cursor: not-allowed;
}

/* Leaderboard */
.leaderboard-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.leaderboard-title {
    font-size: 20px;
    font-weight: 600;
    color: #041E42;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #FFB81C;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: #e9ecef;
}

.leaderboard-rank {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #041E42;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
    background: #FFB81C;
    color: #041E42;
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
    background: #c0c0c0;
    color: #041E42;
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
    background: #cd7f32;
    color: white;
}

.leaderboard-user {
    flex: 1;
}

.leaderboard-username {
    font-weight: 600;
    color: #041E42;
}

.leaderboard-record {
    font-size: 13px;
    color: #666;
}

.leaderboard-score {
    font-size: 20px;
    font-weight: 700;
    color: #041E42;
}

/* Empty State */
.polls-empty {
    text-align: center;
    padding: 60px 20px;
}

.polls-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    opacity: 0.3;
}

.polls-empty-text {
    font-size: 18px;
    color: #666;
    margin-bottom: 8px;
}

.polls-empty-subtext {
    font-size: 14px;
    color: #999;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .engagement-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
}

@media (max-width: 768px) {
    .fan-engagement-section {
        padding: var(--space-6) var(--space-4);
    }

    .engagement-grid {
        gap: var(--space-6);
    }

    .poll-card {
        padding: var(--space-4);
    }

    .poll-question {
        font-size: var(--font-size-base);
    }

    .poll-option {
        padding: var(--space-3);
        font-size: var(--font-size-sm);
    }

    .prediction-matchup {
        flex-direction: column;
        gap: 12px;
    }

    .prediction-vs {
        transform: rotate(90deg);
    }

    .leaderboard-item {
        padding: 10px;
        gap: 12px;
    }

    .leaderboard-rank {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .leaderboard-score {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .section-header-polls h2 {
        font-size: 24px;
    }

    .poll-card {
        padding: 16px 12px;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    .poll-options {
        gap: 12px;
    }

    .poll-option {
        padding: 12px 10px;
        font-size: 14px;
        margin: 0;
        box-sizing: border-box;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .poll-option:hover {
        transform: translateX(0); /* Disable transform on mobile to prevent overflow */
    }

    .poll-option-content {
        flex-wrap: wrap;
        gap: 8px;
    }

    .poll-option-text {
        font-size: 14px;
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }

    .option-text {
        font-size: 14px;
        word-break: break-word;
        line-height: 1.4;
    }

    .poll-stats {
        flex-direction: column;
        gap: 8px;
    }

    .prediction-card {
        padding: 20px 16px;
    }

    .prediction-team {
        padding: 12px;
    }

    .prediction-team-logo {
        width: 48px;
        height: 48px;
    }

    /* Ensure engagement column doesn't cause overflow */
    .engagement-column {
        overflow: hidden;
        box-sizing: border-box;
    }

    .engagement-content {
        padding: 12px;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .polls-column .engagement-content {
        padding: 12px 8px;
    }
}
