/**
 * Modal Quiz Styles
 * CSS for modal quiz player
 */

/* Quiz Wrapper */
.kqr-modal-quiz-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Ensure responsive base */
* {
    box-sizing: border-box;
}

.kqr-modal-quiz-wrapper,
.kqr-quiz-container,
.kqr-quiz-card {
    max-width: 100%;
}

.kqr-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kqr-points-display {
    font-size: 18px;
    font-weight: 600;
}

.kqr-points-label {
    margin-right: 8px;
    color: #555;
}

.kqr-points-value {
    color: #0073aa;
    font-size: 24px;
}

.kqr-start-quiz-btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #0073aa;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

.kqr-start-quiz-btn:hover {
    background: #005a87;
}

.kqr-start-quiz-btn:active {
    transform: scale(0.98);
}

/* Modal Overlay */
.kqr-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.kqr-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 700px;
    animation: slideDown 0.3s ease;
}

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

/* Modal Header */
.kqr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 12px 12px 0 0;
}

.kqr-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    flex: 1;
}

.kqr-modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 15px;
    transition: transform 0.2s ease;
}

.kqr-modal-close:hover {
    transform: scale(1.2);
}

/* Modal Body */
.kqr-modal-body {
    padding: 25px;
}

#kqr-modal-description {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #333;
}

#kqr-modal-description p {
    margin: 0 0 10px 0;
}

.kqr-modal-meta {
    margin-bottom: 20px;
    padding: 12px;
    background: #f0f7ff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.kqr-current-points {
    font-size: 16px;
    color: #0073aa;
    font-weight: 600;
}

/* Modal Options */
.kqr-modal-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.kqr-modal-option {
    padding: 15px 20px;
    font-size: 1rem;
    text-align: left;
    color: #222;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    touch-action: manipulation;
}

.kqr-modal-option:hover:not(:disabled) {
    color: #222;
    background: #f0f7ff;
    border-color: #0073aa;
    transform: translateX(5px);
}

.kqr-modal-option:active:not(:disabled) {
    transform: translateX(5px) scale(0.98);
}

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

.kqr-modal-option.kqr-correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
    font-weight: 600;
}

.kqr-modal-option.kqr-incorrect {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Feedback */
.kqr-modal-feedback {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    display: none;
}

.kqr-modal-feedback.kqr-feedback-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.kqr-modal-feedback.kqr-feedback-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.kqr-modal-feedback.kqr-feedback-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading */
.kqr-modal-loading {
    text-align: center;
    padding: 30px;
    display: none;
}

.kqr-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Body class when modal is open */
body.kqr-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .kqr-modal-quiz-wrapper {
        width: 100%;
        padding: 12px;
        margin: 8px 0;
    }

    .kqr-modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .kqr-modal-header {
        padding: 15px 20px;
    }

    .kqr-modal-header h3 {
        font-size: 1.125rem;
    }

    .kqr-modal-body {
        padding: 16px;
    }

    .kqr-modal-option {
        padding: 14px 16px;
        font-size: 1rem;
        min-height: 48px;
        margin-bottom: 8px;
    }

    .kqr-quiz-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .kqr-start-quiz-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 1rem;
    }

    button,
    input,
    select {
        font-size: 1rem;
        padding: 10px 14px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .kqr-modal-quiz-wrapper {
        padding: 10px;
        margin: 6px 0;
    }

    .kqr-modal-content {
        width: 98%;
        margin: 2% auto;
    }

    .kqr-modal-header {
        padding: 12px 16px;
    }

    .kqr-modal-body {
        padding: 12px;
    }

    .kqr-points-display {
        font-size: 1rem;
    }

    .kqr-points-value {
        font-size: 1.25rem;
    }

    .kqr-modal-option {
        padding: 16px;
        font-size: 1rem;
        min-height: 52px;
    }

    /* Increase spacing between touch targets */
    .kqr-modal-options {
        gap: 16px;
    }
}
