/* Awards Page Styles */

/* Intro Section */
.awards-intro {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg, #1a1a2e);
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color, #333);
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text-secondary, #b0b0b0);
    margin-bottom: 1rem;
}

.voting-status {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.deadline-label {
    color: var(--text-secondary, #b0b0b0);
}

.deadline-value {
    color: var(--gold, #ffd700);
    font-weight: 600;
}

.login-prompt {
    margin-top: 1rem;
}

.login-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #4a90d9, #357abd);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.4);
}

/* Filter Section */
.filter-section {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--card-bg, #1a1a2e);
    border-radius: 12px;
    border: 1px solid var(--border-color, #333);
}

.filter-label {
    font-size: 1rem;
    color: var(--text-secondary, #b0b0b0);
    font-weight: 600;
}

.scope-filter {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    background: var(--dark-bg, #0f0f1e);
    border: 2px solid var(--border-color, #333);
    border-radius: 8px;
    color: var(--text-primary, #fff);
    cursor: pointer;
    min-width: 200px;
    transition: border-color 0.2s;
}

.scope-filter:hover {
    border-color: var(--gold, #ffd700);
}

.scope-filter:focus {
    outline: none;
    border-color: var(--gold, #ffd700);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

/* Awards Section */
.awards-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    color: var(--text-primary, #fff);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent, #4a90d9);
}

.promo-section .section-title {
    color: var(--gold, #ffd700);
}

/* Awards Grid */
.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* Award Card */
.award-card {
    background: var(--card-bg, #1a1a2e);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color, #333);
    transition: border-color 0.2s, transform 0.2s;
}

.award-card:hover {
    border-color: var(--accent, #4a90d9);
}

.award-card.has-votes {
    border-color: var(--success, #4caf50);
}

.award-header {
    margin-bottom: 1rem;
}

.award-name {
    font-size: 1.2rem;
    color: var(--text-primary, #fff);
    margin-bottom: 0.25rem;
}

.award-description {
    font-size: 0.9rem;
    color: var(--text-secondary, #b0b0b0);
    margin: 0;
}

/* Vote Slots */
.award-votes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.vote-slot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.vote-slot:hover {
    background: rgba(255, 255, 255, 0.08);
}

.vote-slot.filled {
    background: rgba(74, 144, 217, 0.1);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #ffd700, #b8860b);
    color: #1a1a1a;
}

.rank-badge.silver {
    background: linear-gradient(135deg, #c0c0c0, #808080);
    color: #1a1a1a;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
    color: #fff;
}

.vote-selection {
    flex: 1;
    min-width: 0;
}

.vote-selection .placeholder {
    color: var(--text-secondary, #b0b0b0);
    font-style: italic;
}

.vote-selection .selected-name {
    color: var(--text-primary, #fff);
    font-weight: 500;
}

.vote-selection .selected-promo {
    font-size: 0.8rem;
    color: var(--text-secondary, #b0b0b0);
    margin-left: 0.5rem;
}

.vote-selection .clear-vote {
    background: none;
    border: none;
    color: var(--danger, #f44336);
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.vote-selection .clear-vote:hover {
    opacity: 1;
}

/* Award Actions */
.award-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-standings,
.btn-save {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-standings {
    background: transparent;
    border: 1px solid var(--border-color, #333);
    color: var(--text-secondary, #b0b0b0);
}

.btn-standings:hover {
    border-color: var(--accent, #4a90d9);
    color: var(--accent, #4a90d9);
}

.btn-save {
    background: var(--accent, #4a90d9);
    border: none;
    color: white;
}

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

.btn-save:not(:disabled):hover {
    background: var(--accent-hover, #357abd);
}

.btn-save.saved {
    background: var(--success, #4caf50);
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg, #1a1a2e);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-wide {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #333);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary, #fff);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary, #b0b0b0);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary, #fff);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Search Modal */
.search-input-container {
    margin-bottom: 1rem;
}

#wrestler-search {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 1rem;
}

#wrestler-search:focus {
    outline: none;
    border-color: var(--accent, #4a90d9);
}

.search-filters {
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary, #b0b0b0);
}

.filter-toggle input[type="checkbox"] {
    accent-color: var(--accent, #4a90d9);
}

.promotion-dropdown {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color, #333);
    border-radius: 6px;
    color: var(--text-primary, #fff);
    font-size: 0.9rem;
    cursor: pointer;
}

.promotion-dropdown:focus {
    outline: none;
    border-color: var(--accent, #4a90d9);
}

.promotion-dropdown option {
    background: var(--card-bg, #1a1a2e);
    color: var(--text-primary, #fff);
}

/* Suggestion Chips */
.suggestions-container {
    display: none; /* Hidden by default, shown by JS when suggestions load */
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--border-color, #333);
}

.suggestions-label {
    font-size: 0.85rem;
    color: var(--text-secondary, #b0b0b0);
    margin: 0 0 0.5rem 0;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    background: rgba(74, 144, 217, 0.15);
    border: 1px solid rgba(74, 144, 217, 0.3);
    border-radius: 20px;
    color: var(--text-primary, #fff);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:hover {
    background: rgba(74, 144, 217, 0.3);
    border-color: var(--accent, #4a90d9);
    transform: translateY(-1px);
}

.suggestion-chip .chip-change {
    font-size: 0.75rem;
    color: var(--success, #4caf50);
    font-weight: 600;
}

.suggestion-loading {
    color: var(--text-secondary, #b0b0b0);
    font-size: 0.85rem;
    font-style: italic;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: rgba(74, 144, 217, 0.1);
}

.search-result-item .wrestler-name {
    color: var(--text-primary, #fff);
    font-weight: 500;
}

.search-result-item .wrestler-alias {
    color: var(--text-secondary, #b0b0b0);
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.search-result-item .wrestler-rating {
    color: var(--text-secondary, #b0b0b0);
    font-size: 0.9rem;
}

.search-no-results {
    text-align: center;
    color: var(--text-secondary, #b0b0b0);
    padding: 2rem;
}

/* Match Search Modal */
#match-search {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 1rem;
}

#match-search:focus {
    outline: none;
    border-color: var(--accent, #4a90d9);
}

.search-hint {
    color: var(--text-secondary, #b0b0b0);
    font-size: 0.85rem;
    margin: 0.5rem 0 1rem 0;
}

.match-result {
    display: block;
    padding: 0.75rem;
}

.match-result .match-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.match-result .match-description {
    color: var(--text-primary, #fff);
    font-weight: 500;
    line-height: 1.3;
}

.match-result .match-meta {
    color: var(--text-secondary, #b0b0b0);
    font-size: 0.8rem;
}

#match-search-results {
    max-height: 350px;
    overflow-y: auto;
}

/* Freetext, Match, and Voted Suggestions */
.freetext-suggestions-container,
.match-suggestions-container,
.voted-suggestions-container {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--border-color, #333);
}

.freetext-chips,
.match-chips,
.voted-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.freetext-chip,
.match-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.9rem;
    background: rgba(74, 144, 217, 0.15);
    border: 1px solid rgba(74, 144, 217, 0.3);
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
    line-height: 1.3;
}

.voted-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 20px;
    color: var(--text-primary, #fff);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.voted-chip:hover {
    background: rgba(76, 175, 80, 0.3);
    border-color: var(--success, #4caf50);
    transform: translateY(-1px);
}

.freetext-chip:hover,
.match-chip:hover {
    background: rgba(74, 144, 217, 0.3);
    border-color: var(--accent, #4a90d9);
}

.chip-votes {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: var(--text-secondary, #b0b0b0);
    margin-left: 0.5rem;
}

/* Freetext Modal */
.freetext-hint {
    color: var(--text-secondary, #b0b0b0);
    margin-bottom: 1rem;
}

#freetext-input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 1rem;
}

#freetext-input:focus {
    outline: none;
    border-color: var(--accent, #4a90d9);
}

.btn-submit-freetext {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--accent, #4a90d9);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit-freetext:hover {
    background: var(--accent-hover, #357abd);
}

/* Standings Modal */
.standings-info {
    margin-bottom: 1rem;
    color: var(--text-secondary, #b0b0b0);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
}

.standings-table th,
.standings-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
}

.standings-table th {
    color: var(--text-secondary, #b0b0b0);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color, #333);
}

.standings-table td {
    color: var(--text-primary, #fff);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.standings-table .rank-col {
    width: 40px;
    text-align: center;
}

.standings-table .votes-col {
    width: 50px;
    text-align: center;
}

.standings-table .score-col {
    width: 60px;
    text-align: center;
    font-weight: 600;
    color: var(--gold, #ffd700);
}

.standings-table tbody tr:first-child td {
    background: rgba(255, 215, 0, 0.1);
}

.standings-table tbody tr:nth-child(2) td {
    background: rgba(192, 192, 192, 0.05);
}

.standings-table tbody tr:nth-child(3) td {
    background: rgba(205, 127, 50, 0.05);
}

.scoring-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #b0b0b0);
    text-align: center;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .awards-grid {
        grid-template-columns: 1fr;
    }

    .vote-slot {
        padding: 0.5rem;
    }

    .rank-badge {
        width: 32px;
        height: 32px;
        font-size: 0.7rem;
    }

    .award-actions {
        flex-direction: column;
    }

    .btn-standings,
    .btn-save {
        width: 100%;
        text-align: center;
    }

    .modal-content {
        max-height: 90vh;
        margin: 0.5rem;
    }
}

/* Loading State */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent, #4a90d9);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================================================
   Results Mode Styles (Post-Voting) - Award Show Experience
   ============================================================================= */

.awards-intro.results-mode {
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.15) 0%,
        rgba(30, 30, 50, 0.9) 50%,
        rgba(255, 215, 0, 0.15) 100%);
    border: 2px solid var(--gold, #ffd700);
    padding: 2.5rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.awards-intro.results-mode::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 215, 0, 0.1),
        transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(50%); }
}

.trophy-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: trophy-glow 2s ease-in-out infinite alternate;
}

@keyframes trophy-glow {
    from {
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
        transform: scale(1);
    }
    to {
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.8));
        transform: scale(1.05);
    }
}

.results-header {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gold, #ffd700);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.results-subheader {
    font-size: 1.1rem;
    color: var(--text-secondary, #b0b0b0);
    margin: 0.5rem 0 1.5rem 0;
    font-style: italic;
    letter-spacing: 0.1em;
}

.btn-show-my-votes {
    padding: 0.6rem 1.5rem;
    background: transparent;
    border: 1px solid var(--text-secondary, #666);
    border-radius: 20px;
    color: var(--text-secondary, #b0b0b0);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-show-my-votes:hover {
    border-color: var(--accent, #4a90d9);
    color: var(--accent, #4a90d9);
}

.btn-show-my-votes.active {
    background: rgba(74, 144, 217, 0.1);
    border-color: var(--accent, #4a90d9);
    color: var(--accent, #4a90d9);
}

/* Award Cards in Results Mode */
.award-card.results-mode {
    border: 1px solid rgba(255, 215, 0, 0.2);
    background: linear-gradient(145deg,
        rgba(30, 30, 50, 0.95),
        rgba(20, 20, 35, 0.95));
    transition: all 0.3s ease;
}

.award-card.results-mode:hover {
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.award-card.results-mode .award-header {
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    margin-bottom: 1rem;
}

.award-card.results-mode .award-name {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary, #b0b0b0);
    font-weight: 600;
}

/* Winner Display - The Star of the Show */
.winner-display {
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.15) 0%,
        rgba(255, 200, 0, 0.05) 50%,
        rgba(255, 215, 0, 0.15) 100%);
    border-radius: 12px;
    margin-bottom: 1rem;
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.winner-display::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold, #ffd700), transparent);
}

.winner-trophy {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.winner-name {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.winner-points {
    display: block;
    font-size: 0.85rem;
    color: var(--gold, #ffd700);
    font-weight: 500;
}

.winner-display.no-winner {
    background: rgba(100, 100, 100, 0.1);
    border-color: rgba(100, 100, 100, 0.2);
}

.winner-display.no-winner .winner-name {
    color: var(--text-secondary, #888);
    font-size: 1rem;
    font-weight: 400;
}

/* Your Votes Section (Read-only, Hidden by Default) */
.your-votes-section {
    padding: 0.75rem;
    background: rgba(74, 144, 217, 0.05);
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid rgba(74, 144, 217, 0.15);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.your-votes-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #888);
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.your-votes-section .vote-slot {
    cursor: default;
    pointer-events: none;
    padding: 0.5rem;
}

.your-votes-section .vote-slot:hover {
    background: transparent;
}

.your-votes-section .award-votes {
    margin-bottom: 0;
}

.your-votes-section .rank-badge {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
}

/* Action Buttons in Results Mode */
.award-card.results-mode .award-actions {
    justify-content: center;
    margin-top: auto;
}

.award-card.results-mode .btn-standings {
    background: transparent;
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--gold, #ffd700);
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.award-card.results-mode .btn-standings:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--gold, #ffd700);
}

/* Section Titles in Results Mode */
.results-mode ~ .awards-section .section-title,
.results-mode ~ * .section-title {
    text-align: center;
    font-size: 1.25rem;
    letter-spacing: 0.1em;
    position: relative;
    display: inline-block;
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .results-header {
        font-size: 1.75rem;
        letter-spacing: 0.1em;
    }

    .trophy-icon {
        font-size: 3rem;
    }

    .winner-name {
        font-size: 1.3rem;
    }

    .winner-trophy {
        font-size: 2rem;
    }
}

/* Accessibility: Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .awards-intro.results-mode::before {
        animation: none;
    }

    .trophy-icon {
        animation: none;
    }

    .your-votes-section {
        animation: none;
    }

    .loading-spinner {
        animation: none;
    }
}
