/* 500 Words Quiz - Modern Card Design */

.words-quiz-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Quiz Screens */
.quiz-screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.quiz-screen.active {
    display: block;
}

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

/* Start Screen */
.start-screen {
    text-align: center;
    padding: 40px 20px;
}

.quiz-logo {
    margin-bottom: 30px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.quiz-title {
    font-size: 32px;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 10px 0;
}

.quiz-subtitle {
    font-size: 16px;
    color: #6B7280;
    margin: 0 0 40px 0;
}

.quiz-stats {
    display: flex;
    justify-content: space-around;
    margin: 40px 0;
    gap: 20px;
}

.stat-item {
    flex: 1;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
}

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

/* Buttons */
.quiz-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.quiz-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.quiz-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.quiz-btn.primary:active {
    transform: translateY(0);
}

.quiz-btn.secondary {
    background: white;
    color: #4F46E5;
    border: 2px solid #E5E7EB;
}

.quiz-btn.secondary:hover {
    background: #F9FAFB;
    border-color: #4F46E5;
}

/* Quiz Main Screen */
.quiz-screen-main {
    padding: 20px 0;
}

/* Progress Bar */
.quiz-progress {
    margin-bottom: 30px;
}

.progress-bar {
    height: 8px;
    background: #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #6B7280;
    font-weight: 500;
}

/* Card Container */
.card-container {
    perspective: 1000px;
    margin-bottom: 30px;
}

.quiz-card {
    background: white;
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    min-height: 400px;
}

.quiz-card.swipe-left {
    animation: swipeLeft 0.5s ease forwards;
}

.quiz-card.swipe-right {
    animation: swipeRight 0.5s ease forwards;
}

@keyframes swipeLeft {
    to {
        transform: translateX(-150%) rotate(-20deg);
        opacity: 0;
    }
}

@keyframes swipeRight {
    to {
        transform: translateX(150%) rotate(20deg);
        opacity: 0;
    }
}

.card-header {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.card-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 700;
}

/* Question Styles */
.card-question {
    text-align: center;
    margin-bottom: 40px;
}

.question-arabic {
    font-size: 56px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 15px;
    line-height: 1.2;
    direction: rtl;
    font-family: 'Traditional Arabic', 'Arabic Typesetting', 'Times New Roman', serif;
}

.question-translit {
    font-size: 24px;
    color: #6B7280;
    font-style: italic;
    margin-bottom: 20px;
}

.question-prompt {
    font-size: 16px;
    color: #9CA3AF;
    font-weight: 500;
}

/* Options */
.card-options {
    display: grid;
    gap: 12px;
}

.option-btn {
    padding: 18px 24px;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #1F2937;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
    width: 100%;
}

.option-btn:hover {
    border-color: #667eea;
    background: #F0F4FF;
    transform: translateX(4px);
}

.option-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.option-btn.correct {
    border-color: #10B981;
    background: #D1FAE5;
    color: #065F46;
    animation: pulse 0.5s ease;
}

.option-btn.incorrect {
    border-color: #EF4444;
    background: #FEE2E2;
    color: #991B1B;
    animation: shake 0.5s ease;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Navigation */
.quiz-navigation {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Results Screen */
.results-screen {
    text-align: center;
    padding: 40px 20px;
}

.results-animation {
    margin-bottom: 40px;
}

.results-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.results-svg {
    transform: rotate(-90deg);
}

.results-score {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    font-size: 48px;
    font-weight: 700;
    color: #4F46E5;
    line-height: 1;
}

.score-total {
    font-size: 20px;
    color: #6B7280;
}

.results-title {
    font-size: 32px;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 10px 0;
}

.results-message {
    font-size: 16px;
    color: #6B7280;
    margin: 0 0 40px 0;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.result-stat {
    padding: 20px;
    border-radius: 16px;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.result-stat.correct {
    border-top: 4px solid #10B981;
}

.result-stat.incorrect {
    border-top: 4px solid #EF4444;
}

.result-stat.accuracy {
    border-top: 4px solid #F59E0B;
}

.result-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.result-label {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 5px;
}

.result-value {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937;
}

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* Responsive Design */
@media (max-width: 640px) {
    .words-quiz-container {
        padding: 15px;
        margin: 20px auto;
    }
    
    .quiz-title {
        font-size: 24px;
    }
    
    .quiz-stats {
        flex-direction: column;
    }
    
    .question-arabic {
        font-size: 40px;
    }
    
    .question-translit {
        font-size: 18px;
    }
    
    .quiz-card {
        padding: 30px 20px;
        min-height: 350px;
    }
    
    .results-stats {
        grid-template-columns: 1fr;
    }
    
    .results-circle {
        width: 160px;
        height: 160px;
    }
    
    .score-number {
        font-size: 36px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #E5E7EB;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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