/* Quiz MRO Public Styles */

/* CSS Variables for customization */
:root {
    --quiz-primary: #007cba;
    --quiz-secondary: #50575e;
    --quiz-background: #ffffff;
    --quiz-text: #1e1e1e;
    --quiz-button: #007cba;
    --quiz-button-text: #ffffff;
    --quiz-font-heading: Arial, sans-serif;
    --quiz-font-body: Arial, sans-serif;
    
    /* Additional variables */
    --quiz-border-radius: 12px;
    --quiz-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --quiz-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
    --quiz-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --quiz-max-width: 800px;
    --quiz-spacing: 2rem;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
}

.quiz-mro-body {
    margin: 0;
    padding: 0;
    font-family: var(--quiz-font-body);
    background: linear-gradient(135deg, var(--quiz-background) 0%, #f8f9fa 100%);
    color: var(--quiz-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-mro-container {
    width: 100%;
    max-width: var(--quiz-max-width);
    margin: 0 auto;
    padding: var(--quiz-spacing);
}

/* Quiz container */
.quiz-mro-quiz {
    background: var(--quiz-background);
    border-radius: var(--quiz-border-radius);
    box-shadow: var(--quiz-shadow);
    overflow: hidden;
    transition: var(--quiz-transition);
    position: relative;
}

.quiz-mro-quiz::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--quiz-primary), var(--quiz-secondary));
}

/* Quiz header */
.quiz-header {
    padding: 3rem 2rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 124, 186, 0.05) 0%, rgba(0, 124, 186, 0.02) 100%);
    border-bottom: 1px solid rgba(0, 124, 186, 0.1);
}

.quiz-title {
    font-family: var(--quiz-font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--quiz-primary);
    margin: 0 0 1rem 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quiz-description {
    font-size: 1.2rem;
    color: var(--quiz-secondary);
    margin: 0 0 2rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Progress bar */
.quiz-progress {
    max-width: 400px;
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 124, 186, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--quiz-primary), var(--quiz-secondary));
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: 0.9rem;
    color: var(--quiz-secondary);
    font-weight: 600;
    text-align: center;
    display: block;
}

/* Quiz questions */
.quiz-questions {
    position: relative;
    min-height: 400px;
}

.quiz-question {
    padding: 3rem 2rem;
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Question content */
.question-number {
    font-size: 0.9rem;
    color: var(--quiz-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    text-align: center;
}

.question-title {
    font-family: var(--quiz-font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: var(--quiz-text);
    margin: 0 0 1rem 0;
    text-align: center;
    line-height: 1.3;
}

.question-description {
    font-size: 1.1rem;
    color: var(--quiz-secondary);
    margin: 0 0 2rem 0;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Question media */
.question-media {
    text-align: center;
    margin: 2rem 0;
}

.question-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--quiz-border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: var(--quiz-transition);
}

.question-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.question-video {
    max-width: 100%;
    height: auto;
    border-radius: var(--quiz-border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Question answers */
.question-answers {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

.answer-option {
    transition: var(--quiz-transition);
}

.answer-button {
    width: 100%;
    background: #fff;
    border: 2px solid rgba(0, 124, 186, 0.2);
    border-radius: var(--quiz-border-radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--quiz-transition);
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.answer-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 124, 186, 0.1), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.answer-button:hover {
    border-color: var(--quiz-primary);
    box-shadow: var(--quiz-shadow-hover);
    transform: translateY(-2px);
}

.answer-button:hover::before {
    left: 100%;
}

.answer-button:active {
    transform: translateY(0);
}

.answer-button.selected {
    border-color: var(--quiz-primary);
    background: linear-gradient(135deg, var(--quiz-primary), var(--quiz-secondary));
    color: var(--quiz-button-text);
    box-shadow: var(--quiz-shadow-hover);
}

.answer-button.selected .answer-title,
.answer-button.selected .answer-description {
    color: var(--quiz-button-text);
}

/* Answer media */
.answer-media {
    flex-shrink: 0;
}

.answer-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Answer content */
.answer-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.answer-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--quiz-text);
    line-height: 1.3;
}

.answer-description {
    font-size: 0.95rem;
    color: var(--quiz-secondary);
    line-height: 1.4;
}

/* Question navigation */
.question-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 124, 186, 0.1);
}

.nav-button {
    background: var(--quiz-button);
    color: var(--quiz-button-text);
    border: none;
    border-radius: 50px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--quiz-transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.nav-button:hover:not(:disabled) {
    background: var(--quiz-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.4);
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.nav-spacer {
    flex: 1;
}

/* Quiz completion */
.quiz-completion {
    padding: 4rem 2rem;
    text-align: center;
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.completion-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--quiz-primary), var(--quiz-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    color: white;
    font-size: 3rem;
    box-shadow: var(--quiz-shadow);
    animation: pulse 2s infinite;
}

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

.completion-title {
    font-family: var(--quiz-font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--quiz-primary);
    margin: 0 0 1rem 0;
}

.completion-message {
    font-size: 1.2rem;
    color: var(--quiz-secondary);
    margin: 0 0 3rem 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.completion-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.restart-quiz-btn {
    background: transparent;
    color: var(--quiz-primary);
    border: 2px solid var(--quiz-primary);
    border-radius: 50px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--quiz-transition);
}

.restart-quiz-btn:hover {
    background: var(--quiz-primary);
    color: var(--quiz-button-text);
    transform: translateY(-2px);
    box-shadow: var(--quiz-shadow-hover);
}

/* Loading states */
.quiz-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 124, 186, 0.2);
    border-top: 4px solid var(--quiz-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error states */
.quiz-error {
    padding: 3rem 2rem;
    text-align: center;
    color: #d63384;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.retry-button {
    background: #d63384;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--quiz-transition);
}

.retry-button:hover {
    background: #b02a5b;
    transform: translateY(-2px);
}

/* Responsive design */
@media (max-width: 768px) {
    :root {
        --quiz-spacing: 1rem;
    }
    
    .quiz-mro-container {
        padding: 1rem;
    }
    
    .quiz-header {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .quiz-title {
        font-size: 2rem;
    }
    
    .quiz-description {
        font-size: 1rem;
    }
    
    .quiz-question {
        padding: 2rem 1.5rem;
    }
    
    .question-title {
        font-size: 1.5rem;
    }
    
    .question-description {
        font-size: 1rem;
    }
    
    .answer-button {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .answer-image {
        width: 60px;
        height: 60px;
    }
    
    .question-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-button {
        width: 100%;
        justify-content: center;
    }
    
    .completion-title {
        font-size: 2rem;
    }
    
    .completion-message {
        font-size: 1rem;
    }
    
    .completion-actions {
        flex-direction: column;
    }
    
    .restart-quiz-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .quiz-title {
        font-size: 1.75rem;
    }
    
    .question-title {
        font-size: 1.25rem;
    }
    
    .answer-button {
        padding: 0.75rem;
    }
    
    .answer-title {
        font-size: 1rem;
    }
    
    .answer-description {
        font-size: 0.9rem;
    }
    
    .nav-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .answer-button {
        border-width: 3px;
    }
    
    .answer-button:hover {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .progress-fill::after {
        animation: none;
    }
    
    .completion-icon {
        animation: none;
    }
}

/* Print styles */
@media print {
    .quiz-mro-quiz {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .question-navigation,
    .completion-actions {
        display: none;
    }
    
    .quiz-question {
        page-break-inside: avoid;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .quiz-mro-body {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }
    
    .quiz-mro-quiz {
        background: #2d2d2d;
        color: #ffffff;
    }
    
    .answer-button {
        background: #3a3a3a;
        border-color: rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }
    
    .answer-button:hover {
        background: #4a4a4a;
    }
}

