/**
 * Paidia Daily Trivia Quest Modal Styles
 * Matches Paidia design system with gamified aesthetics
 */

/* Modal Base */
.trivia-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trivia-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.trivia-modal-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.trivia-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.trivia-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.trivia-modal-content {
    padding: 40px 32px;
    color: #fff;
}

body.trivia-modal-open {
    overflow: hidden;
}

/* Setup Screen */
.trivia-setup-screen {
    text-align: center;
}

.trivia-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trivia-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 32px;
}

/* Mode Selection */
.trivia-mode-selection {
    margin-bottom: 32px;
}

.trivia-mode-selection h3,
.trivia-difficulty-selection h3,
.trivia-destination-filter h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px;
    text-align: left;
}

.optional-tag {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
}

.trivia-mode-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.trivia-mode-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.trivia-mode-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.trivia-mode-card.selected {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
    border-color: #8b5cf6;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.mode-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.mode-label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.mode-details {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

/* Difficulty Selection */
.trivia-difficulty-selection {
    margin-bottom: 32px;
}

.trivia-difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.trivia-difficulty-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #fff;
}

.trivia-difficulty-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.trivia-difficulty-btn.selected {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
    border-color: #8b5cf6;
}

.difficulty-icon {
    font-size: 28px;
}

.difficulty-label {
    font-size: 15px;
    font-weight: 600;
}

.difficulty-xp {
    font-size: 13px;
    color: #fbbf24;
}

/* Destination Filter (First Field) */
.trivia-destination-filter {
    margin-bottom: 40px;
    text-align: left;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
}

.trivia-search-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    transition: all 0.2s ease;
}

.trivia-search-input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(255, 255, 255, 0.08);
}

.trivia-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.trivia-destination-results {
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.trivia-destination-option {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.trivia-destination-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.trivia-destination-option.selected {
    background: rgba(139, 92, 246, 0.15);
    border-color: #8b5cf6;
}

.dest-icon {
    font-size: 20px;
}

.dest-title {
    font-size: 15px;
}

/* Locked Destination Display */
.trivia-destination-locked {
    margin-bottom: 32px;
    text-align: left;
}

.locked-destination {
    padding: 16px 20px;
    background: rgba(139, 92, 246, 0.15);
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.locked-destination .dest-icon {
    font-size: 24px;
}

.locked-destination .dest-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

/* Buttons */
.start-trivia-btn,
.paidia-btn-primary {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.start-trivia-btn:hover,
.paidia-btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.paidia-btn-secondary {
    width: 100%;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.paidia-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Question Screen */
.trivia-question-screen {
    position: relative;
}

.trivia-progress-bar {
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 16px;
    overflow: hidden;
}

.trivia-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6 0%, #ec4899 100%);
    transition: width 0.4s ease;
}

.trivia-progress-text {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.trivia-xp-tracker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
}

.xp-icon {
    font-size: 20px;
}

.xp-value {
    font-size: 18px;
    font-weight: 700;
    color: #fbbf24;
}

.xp-correct {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.trivia-question-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
}

.question-type-badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.trivia-question-text {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 20px;
}

.trivia-hint-btn {
    padding: 8px 16px;
    background: rgba(236, 72, 153, 0.15);
    border: 1px solid rgba(236, 72, 153, 0.3);
    border-radius: 8px;
    color: #ec4899;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.trivia-hint-btn:hover {
    background: rgba(236, 72, 153, 0.25);
}

.trivia-hint-text {
    padding: 12px 16px;
    background: rgba(236, 72, 153, 0.1);
    border-left: 3px solid #ec4899;
    border-radius: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.trivia-answer-section {
    margin: 20px 0;
}

.trivia-answer-input {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.trivia-answer-input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(255, 255, 255, 0.12);
}

.submit-answer-btn {
    width: 100%;
}

/* Related Chips */
.trivia-related-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chips-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.trivia-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    font-size: 13px;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.trivia-chip:hover {
    background: rgba(139, 92, 246, 0.25);
    transform: translateY(-1px);
}

.chip-icon {
    font-size: 16px;
}

/* Result Screen */
.trivia-result-screen {
    text-align: center;
    padding: 20px 0;
}

.result-icon-container {
    margin-bottom: 24px;
}

.result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
}

.result-icon.success {
    background: rgba(34, 197, 94, 0.2);
    border: 3px solid #22c55e;
    color: #22c55e;
}

.result-icon.failure {
    background: rgba(239, 68, 68, 0.2);
    border: 3px solid #ef4444;
    color: #ef4444;
}

.result-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 16px;
}

.trivia-result-screen.correct .result-title {
    color: #22c55e;
}

.trivia-result-screen.incorrect .result-title {
    color: #ef4444;
}

.correct-answer-display {
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
}

.correct-answer-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 8px;
}

.correct-answer-text {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.xp-awarded-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(251, 191, 36, 0.15);
    border: 2px solid rgba(251, 191, 36, 0.4);
    border-radius: 12px;
    margin-bottom: 24px;
}

.xp-awarded-display .xp-icon {
    font-size: 24px;
}

.xp-amount {
    font-size: 22px;
    font-weight: 700;
    color: #fbbf24;
}

.explore-related {
    margin-bottom: 24px;
}

.explore-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 8px;
}

.explore-link {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 8px;
    color: #8b5cf6;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.explore-link:hover {
    background: rgba(139, 92, 246, 0.3);
}

/* Summary Screen */
.trivia-summary-screen {
    text-align: center;
}

.summary-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 32px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #8b5cf6;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.bonus-prompt {
    margin-bottom: 32px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 16px;
}

.bonus-prompt h3 {
    font-size: 20px;
    margin: 0 0 8px;
}

.bonus-prompt p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 16px;
}

.summary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Bonus Question */
.trivia-bonus-screen {
    text-align: center;
}

.bonus-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
}

.bonus-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 32px;
}

.bonus-question-card {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 16px;
    padding: 24px;
}

/* Bonus Success */
.trivia-bonus-success {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.trivia-bonus-success h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 24px;
}

.coupon-display {
    padding: 24px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.15) 100%);
    border: 2px solid rgba(251, 191, 36, 0.4);
    border-radius: 16px;
    margin-bottom: 16px;
}

.coupon-code {
    font-size: 32px;
    font-weight: 700;
    font-family: monospace;
    color: #fbbf24;
    margin-bottom: 8px;
}

.coupon-discount {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
}

.coupon-instructions {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .trivia-modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .trivia-modal-content {
        padding: 32px 20px;
    }
    
    .trivia-mode-cards,
    .trivia-difficulty-buttons,
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .mode-icon {
        font-size: 32px;
    }
    
    .trivia-question-text {
        font-size: 18px;
    }
    
    .summary-actions {
        grid-template-columns: 1fr;
    }
}
