/* ========================================
   QUIZ MODAL - FULL STYLE
   Sıfırdan yazılmış, kompakt, animasyonlu
======================================== */

/* Modal Container */
.quiz-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.quiz-modal.show {
    opacity: 1;
    visibility: visible;
}

/* Backdrop */
.quiz-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

/* Modal Content */
.quiz-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    margin: 5vh auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.quiz-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px 20px 0 0;
}

.quiz-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: white;
    font-weight: 700;
}

.quiz-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.quiz-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Body - KOMPAKT, NO SCROLL */
.quiz-modal-body {
    padding: 16px 20px;
    overflow: hidden;
}

/* ========================================
   LOADING
======================================== */
.quiz-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    min-height: 300px;
}

.quiz-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.quiz-loading p {
    color: #666;
    font-size: 15px;
}

/* ========================================
   QUIZ CONTENT - KOMPAKT
======================================== */
.quiz-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Progress Bar */
.quiz-progress {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.4s ease;
}

.quiz-progress-text {
    text-align: center;
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

/* Score */
.quiz-score {
    text-align: center;
    font-size: 15px;
    color: #333;
    font-weight: 600;
}

#score-display {
    color: #667eea;
    font-size: 18px;
}

/* ========================================
   TIMER - KÜÇÜK VE ŞIK
======================================== */
.timer-container {
    display: flex;
    justify-content: center;
    margin: 8px 0;
}

.timer-circle {
    position: relative;
    width: 55px;
    height: 55px;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: #f0f0f0;
    stroke-width: 5;
}

.timer-progress {
    fill: none;
    stroke: #667eea;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

/* ========================================
   QUESTION
======================================== */
.quiz-question {
    text-align: center;
    margin: 8px 0;
}

.quiz-question h4 {
    font-size: 17px;
    line-height: 1.5;
    color: #2d3748;
    margin: 0;
    font-weight: 600;
}

/* ========================================
   OPTIONS - KOMPAKT
======================================== */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.quiz-option:hover:not(:disabled) {
    border-color: #667eea;
    background: #f7faff;
    transform: translateX(4px);
}

.quiz-option:active:not(:disabled) {
    transform: scale(0.98);
}

.quiz-option:disabled {
    cursor: not-allowed;
}

.option-letter {
    width: 32px;
    height: 32px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    font-size: 15px;
    color: #2d3748;
    line-height: 1.4;
}

/* ========================================
   CORRECT / WRONG ANIMATIONS
======================================== */
.quiz-option.correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: #059669 !important;
    animation: correctPulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-option.correct .option-letter {
    background: #047857 !important;
}

.quiz-option.correct .option-text {
    color: white !important;
}

.quiz-option.wrong {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border-color: #dc2626 !important;
    animation: wrongShake 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-option.wrong .option-letter {
    background: #b91c1c !important;
}

.quiz-option.wrong .option-text {
    color: white !important;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

/* ========================================
   RESULTS - KOMPAKT
======================================== */
.quiz-results {
    padding: 24px 16px;
    text-align: center;
}

.quiz-results-icon {
    font-size: 60px;
    margin-bottom: 16px;
    animation: resultBounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes resultBounce {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.2); }
    60% { transform: scale(0.95); }
}

.quiz-results h3 {
    font-size: 24px;
    color: #2d3748;
    margin: 0 0 20px 0;
    font-weight: 700;
}

.quiz-results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    padding: 14px 10px;
    background: #f8fafc;
    border-radius: 10px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.quiz-results-message {
    font-size: 16px;
    color: #475569;
    margin-bottom: 24px;
    padding: 14px;
    background: #f0f9ff;
    border-radius: 8px;
    font-weight: 500;
}

.quiz-results-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #334155;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

/* ========================================
   ERROR STATE
======================================== */
.quiz-error {
    padding: 50px 20px;
    text-align: center;
}

.quiz-error i {
    font-size: 50px;
    color: #ef4444;
    margin-bottom: 16px;
}

.quiz-error p {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 20px;
}

/* ========================================
   MOBILE RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .quiz-modal-content {
        width: 95%;
        margin: 2.5vh auto;
    }
    
    .quiz-modal-header {
        padding: 14px 16px;
    }
    
    .quiz-modal-header h3 {
        font-size: 16px;
    }
    
    .quiz-modal-body {
        padding: 14px 16px;
    }
    
    .timer-circle {
        width: 50px;
        height: 50px;
    }
    
    .timer-text {
        font-size: 18px;
    }
    
    .quiz-question h4 {
        font-size: 16px;
    }
    
    .quiz-option {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .option-letter {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .option-text {
        font-size: 14px;
    }
    
    .quiz-results h3 {
        font-size: 22px;
    }
    
    .quiz-results-stats {
        gap: 10px;
    }
    
    .stat {
        padding: 12px 8px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .quiz-results-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .quiz-modal-content {
        width: 98%;
        max-height: 95vh;
    }
    
    .quiz-question h4 {
        font-size: 15px;
    }
    
    .option-text {
        font-size: 13px;
    }
}

