/**
 * SportsIQ Quiz Pro - Premium Frontend Styles (Updated)
 */

:root {
    --primary-color: #FF4B2B;
    --secondary-color: #FF416C;
    --gradient-primary: linear-gradient(135deg, #FF4B2B, #FF416C);
    --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.10);
    --shadow-hover: 0 25px 80px rgba(255, 75, 43, 0.15);
    --shadow-btn: 0 8px 25px rgba(255, 75, 43, 0.3);
    --border-radius: 16px;
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.sportsiq-quiz-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    max-width: 820px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Quiz Card */
.quiz-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
    position: relative;
}

.quiz-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

/* Card Body */
.quiz-card-body {
    padding: 32px 36px;
}

/* Title */
.quiz-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a202c;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-icon {
    font-size: 32px;
}

/* Question */
.quiz-question-wrapper {
    margin-bottom: 28px;
}

.question-number {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #FF4B2B;
    background: rgba(255, 75, 43, 0.1);
    padding: 4px 12px;
    border-radius: 50px;
    margin-bottom: 10px;
}

.quiz-question {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.6;
    margin: 0;
}

/* Options Grid */
.quiz-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0 0 28px 0;
}

.quiz-option {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    user-select: none;
}

.quiz-option:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateX(4px);
}

.quiz-option.selected {
    border-color: #FF4B2B;
    background: rgba(255, 75, 43, 0.05);
    box-shadow: 0 0 0 4px rgba(255, 75, 43, 0.1);
}

.quiz-option.correct {
    border-color: #48bb78;
    background: rgba(72, 187, 120, 0.1);
    box-shadow: 0 0 0 4px rgba(72, 187, 120, 0.15);
}

.quiz-option.wrong {
    border-color: #fc8181;
    background: rgba(252, 129, 129, 0.1);
    box-shadow: 0 0 0 4px rgba(252, 129, 129, 0.15);
}

.quiz-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.quiz-option.disabled:hover {
    transform: none;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    background: #ffffff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    transition: var(--transition-smooth);
}

.quiz-option.selected .option-letter {
    background: var(--gradient-primary);
    color: #ffffff;
    border-color: #FF4B2B;
}

.quiz-option.correct .option-letter {
    background: #48bb78;
    color: #ffffff;
    border-color: #48bb78;
}

.quiz-option.wrong .option-letter {
    background: #fc8181;
    color: #ffffff;
    border-color: #fc8181;
}

.option-text {
    font-weight: 500;
    color: #2d3748;
    flex: 1;
}

.option-check {
    margin-left: auto;
    opacity: 0;
    transition: var(--transition-smooth);
    color: #48bb78;
}

.quiz-option.selected .option-check {
    opacity: 1;
}

/* Submit Button */
.quiz-submit-btn {
    width: 100%;
    padding: 18px 32px;
    background: var(--gradient-primary);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.quiz-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.quiz-submit-btn:hover:not(:disabled)::before {
    left: 100%;
}

.quiz-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn);
}

.quiz-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.quiz-submit-btn .btn-icon {
    transition: var(--transition-smooth);
}

.quiz-submit-btn:hover:not(:disabled) .btn-icon {
    transform: translateX(6px);
}

/* ===== Modal ===== */
.sportsiq-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sportsiq-modal-container {
    width: 100%;
    max-width: 540px;
    padding: 20px;
    animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slideUp {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.sportsiq-modal {
    background: #ffffff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

/* Modal Header */
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}

.modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-icon {
    font-size: 24px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.modal-status {
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 50px;
    font-size: 14px;
}

.modal-status.correct {
    background: #e6ffe6;
    color: #2e7d32;
}

.modal-status.wrong {
    background: #ffe6e6;
    color: #c62828;
}

/* Modal Body */
.modal-body {
    padding: 30px 24px;
}

.result-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 10px;
}

.result-status.correct {
    background: #f0fff4;
    border-left: 4px solid #48bb78;
}

.result-status.wrong {
    background: #fff5f5;
    border-left: 4px solid #fc8181;
}

.result-icon {
    font-size: 32px;
}

.result-message {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

/* Result Details */
.result-details {
    background: #f7fafc;
    border-radius: 10px;
    padding: 16px 20px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    color: #718096;
    font-weight: 500;
    font-size: 14px;
}

.detail-value {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.detail-value.correct-answer {
    color: #48bb78;
}

.detail-value.user-answer.wrong {
    color: #fc8181;
}

.detail-value.user-answer.correct {
    color: #48bb78;
}

/* Modal Footer */
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}

.modal-close-btn-secondary {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}

.modal-close-btn-secondary:hover {
    background: #edf2f7;
}

.modal-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--gradient-primary);
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition-smooth);
}

.modal-next-btn:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-btn);
    color: #ffffff;
}

.modal-next-btn i {
    transition: var(--transition-smooth);
}

.modal-next-btn:hover i {
    transform: translateX(4px);
}

/* Responsive */
@media (max-width: 768px) {
    .quiz-card-body {
        padding: 24px 20px;
    }
    
    .quiz-title {
        font-size: 22px;
    }
    
    .quiz-question {
        font-size: 17px;
    }
    
    .quiz-options-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .quiz-submit-btn {
        font-size: 16px;
        padding: 16px 24px;
    }
    
    .sportsiq-modal-container {
        padding: 12px;
    }
    
    .modal-header {
        padding: 16px 18px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .modal-body {
        padding: 20px 18px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 10px;
        padding: 14px 18px;
    }
    
    .modal-footer .modal-close-btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .modal-footer .modal-next-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .quiz-title {
        font-size: 19px;
        flex-wrap: wrap;
    }
    
    .quiz-option {
        padding: 14px 16px;
        gap: 10px;
    }
    
    .option-letter {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .modal-title {
        font-size: 16px;
    }
    
    .result-message {
        font-size: 16px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .quiz-card {
        background: #1a202c;
    }
    
    .quiz-title {
        color: #f7fafc;
    }
    
    .quiz-question {
        color: #e2e8f0;
    }
    
    .quiz-option {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .quiz-option:hover {
        background: #374151;
        border-color: #6b7280;
    }
    
    .option-text {
        color: #e2e8f0;
    }
    
    .option-letter {
        background: #374151;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .sportsiq-modal {
        background: #1a202c;
    }
    
    .modal-header {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .modal-title {
        color: #f7fafc;
    }
    
    .result-details {
        background: #2d3748;
    }
    
    .detail-item {
        border-color: #4a5568;
    }
    
    .detail-label {
        color: #a0aec0;
    }
    
    .detail-value {
        color: #e2e8f0;
    }
    
    .result-status.correct {
        background: rgba(72, 187, 120, 0.15);
    }
    
    .result-status.wrong {
        background: rgba(252, 129, 129, 0.15);
    }
    
    .modal-footer {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .modal-close-btn-secondary {
        background: #374151;
        border-color: #4a5568;
        color: #a0aec0;
    }
    
    .modal-close-btn-secondary:hover {
        background: #4a5568;
    }
}
/* Hide progress text completely */
.quiz-progress-bar .progress-text {
    display: none !important;
}

/* Ensure progress bar still shows without text */
.quiz-progress-bar {
    height: 8px;
    margin: 20px 0 28px 0;
    position: relative;
    overflow: visible;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary, linear-gradient(135deg, #FF4B2B, #FF416C));
    border-radius: 50px;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 0%;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: #FF4B2B;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 75, 43, 0.5);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.6; }
}