/* Lucrative Interactive VideoQuiz - Frontend Styles */

.livq-quiz-container {
    position: relative;
    max-width: 100%;
    margin: 20px 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.livq-video-wrapper {
    position: relative;
    width: 100%;
}

.livq-video-wrapper iframe,
.livq-video-wrapper video {
    width: 100%;
    height: 400px;
    border: none;
    border-radius: 10px 10px 0 0;
}

/* Plyr Video Player Integration */
.livq-video-wrapper {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.livq-video-player {
    width: 100%;
    height: 400px;
}

/* Responsive Video Settings */
.livq-video-wrapper.livq-responsive {
    max-width: 100%;
}

/* Ensure percentage widths work properly */
.livq-video-wrapper {
    display: block;
    margin: 0 auto;
}

/* Center video when using percentage widths */
.livq-video-wrapper[style*="width:"] {
    margin-left: auto;
    margin-right: auto;
}

.livq-video-wrapper.livq-aspect-ratio {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* Default 16:9 */
}

.livq-video-wrapper.livq-aspect-ratio[data-aspect-ratio="4:3"] {
    padding-bottom: 75%;
}

.livq-video-wrapper.livq-aspect-ratio[data-aspect-ratio="21:9"] {
    padding-bottom: 42.86%;
}

.livq-video-wrapper.livq-aspect-ratio[data-aspect-ratio="1:1"] {
    padding-bottom: 100%;
}

.livq-video-wrapper.livq-aspect-ratio .livq-video-player,
.livq-video-wrapper.livq-aspect-ratio iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Quiz Container Settings */
.livq-quiz-container {
    margin: 0 auto;
    position: relative;
}

.livq-quiz-container.livq-align-center {
    margin-left: auto;
    margin-right: auto;
}

.livq-quiz-container.livq-align-left {
    margin-left: 0;
    margin-right: auto;
}

.livq-quiz-container.livq-align-right {
    margin-left: auto;
    margin-right: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .livq-video-wrapper {
        height: 250px !important;
    }
    
    .livq-video-wrapper.livq-aspect-ratio {
        padding-bottom: 56.25%;
    }
    
    /* Force full width on mobile for better experience */
    .livq-quiz-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
}

/* Custom Plyr Styling */
.plyr {
    border-radius: 10px;
}

.plyr--video {
    background: #000;
}

.plyr__control--overlaid {
    background: rgba(102, 126, 234, 0.9);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.plyr__control--overlaid:hover {
    background: rgba(102, 126, 234, 1);
    transform: scale(1.1);
}

.plyr__progress__played {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.plyr__volume__progress {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.plyr__menu__container .plyr__control[role="menuitemradio"][aria-checked="true"]::before {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Video Notice */
.livq-video-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.livq-notice-content h3 {
    margin: 0 0 15px 0;
    color: #856404;
    font-size: 1.2em;
}

.livq-notice-content p {
    margin: 0 0 15px 0;
    color: #856404;
    line-height: 1.5;
}

.livq-notice-actions {
    margin-top: 20px;
}

.livq-notice-actions .button {
    margin-right: 15px;
}

.livq-help-text {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
}

/* Quiz Overlay */
.livq-quiz-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.livq-quiz-modal {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: livq-modal-appear 0.3s ease-out;
}

@keyframes livq-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.livq-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.livq-quiz-header h3 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.livq-close-quiz {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.livq-close-quiz:hover {
    background: rgba(255,255,255,0.2);
}

.livq-quiz-content {
    padding: 25px;
}

.livq-question-container {
    margin-bottom: 20px;
}

.livq-question-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #212529;
    margin-bottom: 20px;
    line-height: 1.4;
}

.livq-question-options {
    list-style: none;
    margin: 0;
    padding: 0;
}

.livq-question-options li {
    margin-bottom: 12px;
}

.livq-option {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.livq-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.livq-option.selected {
    border-color: #667eea;
    background: #e3f2fd;
}

.livq-option input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.2);
}

.livq-option input[type="checkbox"] {
    margin-right: 15px;
    transform: scale(1.2);
}

.livq-option label {
    cursor: pointer;
    margin: 0;
    flex: 1;
    font-weight: 500;
    color: #495057;
}

.livq-quiz-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

.livq-quiz-footer button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.livq-skip-question {
    background: #6c757d;
    color: white;
}

.livq-skip-question:hover {
    background: #5a6268;
}

.livq-submit-answer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.livq-submit-answer:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.livq-submit-answer:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Results Overlay */
.livq-results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.livq-results-modal {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: livq-modal-appear 0.3s ease-out;
}

.livq-results-header {
    text-align: center;
    padding: 30px 25px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.livq-results-header h3 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
}

.livq-results-content {
    padding: 25px;
    text-align: center;
}

.livq-score-display {
    margin-bottom: 20px;
}

.livq-score {
    font-size: 3em;
    font-weight: 700;
    color: #667eea;
}

.livq-total {
    font-size: 2em;
    color: #6c757d;
}

.livq-completion-message {
    font-size: 1.1em;
    color: #495057;
    line-height: 1.5;
    margin-bottom: 20px;
}

.livq-results-footer {
    display: flex;
    gap: 15px;
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

.livq-results-footer button {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.livq-restart-quiz {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.livq-restart-quiz:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.livq-close-results {
    background: #6c757d;
    color: white;
}

.livq-close-results:hover {
    background: #5a6268;
}

/* Progress Bar */
.livq-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #e9ecef;
    z-index: 10001;
}

.livq-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

/* Question Feedback */
.livq-question-feedback {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
}

.livq-question-feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.livq-question-feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.livq-question-feedback .explanation {
    margin-top: 10px;
    font-style: italic;
    opacity: 0.8;
}

.livq-question-feedback .correct-answer {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    border-left: 4px solid #28a745;
    font-weight: 500;
}

.livq-question-feedback.incorrect .correct-answer {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
}

.livq-countdown-timer {
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    text-align: center;
    font-size: 14px;
    color: #666;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.livq-countdown-number {
    font-weight: bold;
    color: #007cba;
    font-size: 16px;
}

/* Disabled form state */
.livq-question-container.livq-submitted {
    opacity: 0.7;
    pointer-events: none;
}

.livq-question-container.livq-submitted input[type="radio"],
.livq-question-container.livq-submitted input[type="checkbox"] {
    opacity: 0.6;
    cursor: not-allowed;
}

.livq-question-container.livq-submitted .livq-submit-btn {
    background: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

.livq-question-container.livq-submitted .livq-skip-btn {
    background: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* Loading States */
.livq-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6c757d;
}

.livq-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: livq-spin 1s linear infinite;
    margin-right: 15px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .livq-quiz-modal,
    .livq-results-modal {
        margin: 10px;
        max-width: none;
    }
    
    .livq-quiz-header,
    .livq-results-header {
        padding: 15px 20px;
    }
    
    .livq-quiz-content,
    .livq-results-content {
        padding: 20px;
    }
    
    .livq-quiz-footer,
    .livq-results-footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .livq-quiz-footer button,
    .livq-results-footer button {
        width: 100%;
    }
    
    .livq-option {
        padding: 12px 15px;
    }
    
    .livq-score {
        font-size: 2.5em;
    }
    
    .livq-total {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .livq-quiz-overlay,
    .livq-results-overlay {
        padding: 10px;
    }
    
    .livq-quiz-modal,
    .livq-results-modal {
        margin: 0;
    }
    
    .livq-video-wrapper iframe,
    .livq-video-wrapper video {
        height: 250px;
    }
}

/* Accessibility */
.livq-quiz-container:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.livq-option:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .livq-quiz-container {
        border: 2px solid #000;
    }
    
    .livq-option {
        border-width: 3px;
    }
    
    .livq-option.selected {
        border-color: #000;
        background: #000;
        color: #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .livq-quiz-modal,
    .livq-results-modal {
        animation: none;
    }
    
    .livq-option,
    .livq-quiz-footer button,
    .livq-results-footer button {
        transition: none;
    }
}

/* ========================================
   QUIZ THEMES
   ======================================== */

/* Default Theme (already defined above) */
.livq-theme-default {
    /* Uses the default styles already defined */
}

/* Modern Theme */
.livq-theme-modern .livq-quiz-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.livq-theme-modern .livq-video-wrapper {
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}

.livq-theme-modern .livq-quiz-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(102, 126, 234, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.livq-theme-modern .livq-quiz-header {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
    backdrop-filter: blur(10px);
}

.livq-theme-modern .livq-quiz-content {
    background: rgba(255, 255, 255, 0.95);
    margin: 0 20px 20px 20px;
    border-radius: 15px;
    padding: 25px;
}

.livq-theme-modern .livq-option {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.livq-theme-modern .livq-option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.livq-theme-modern .livq-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.livq-theme-modern .livq-submit-answer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    border: none;
}

.livq-theme-modern .livq-submit-answer:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.livq-theme-modern .livq-results-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(102, 126, 234, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.livq-theme-modern .livq-results-header {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
    backdrop-filter: blur(10px);
}

.livq-theme-modern .livq-results-content {
    background: rgba(255, 255, 255, 0.95);
    margin: 0 20px 20px 20px;
    border-radius: 15px;
    padding: 25px;
}

/* Minimal Theme */
.livq-theme-minimal .livq-quiz-container {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.livq-theme-minimal .livq-video-wrapper {
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.livq-theme-minimal .livq-quiz-modal {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
}

.livq-theme-minimal .livq-quiz-header {
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.livq-theme-minimal .livq-quiz-header h3 {
    color: #495057;
    font-weight: 500;
}

.livq-theme-minimal .livq-option {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.livq-theme-minimal .livq-option:hover {
    border-color: #6c757d;
    background: #f8f9fa;
}

.livq-theme-minimal .livq-option.selected {
    border-color: #495057;
    background: #f8f9fa;
    color: #495057;
}

.livq-theme-minimal .livq-submit-answer {
    background: #6c757d;
    border-radius: 4px;
    border: none;
    color: white;
}

.livq-theme-minimal .livq-submit-answer:hover {
    background: #5a6268;
    transform: none;
    box-shadow: none;
}

.livq-theme-minimal .livq-skip-question {
    background: #ffffff;
    border: 1px solid #dee2e6;
    color: #6c757d;
    border-radius: 4px;
}

.livq-theme-minimal .livq-skip-question:hover {
    background: #f8f9fa;
    border-color: #6c757d;
}

.livq-theme-minimal .livq-results-modal {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
}

.livq-theme-minimal .livq-results-header {
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
}

.livq-theme-minimal .livq-results-header h3 {
    color: #495057;
    font-weight: 500;
}

.livq-theme-minimal .livq-results-content {
    background: #ffffff;
}

.livq-theme-minimal .livq-score {
    color: #495057;
}

.livq-theme-minimal .livq-total {
    color: #6c757d;
}

.livq-theme-minimal .livq-completion-message {
    color: #6c757d;
}

.livq-theme-minimal .livq-restart-quiz {
    background: #6c757d;
    border-radius: 4px;
    border: none;
    color: white;
}

.livq-theme-minimal .livq-restart-quiz:hover {
    background: #5a6268;
    transform: none;
    box-shadow: none;
}

.livq-theme-minimal .livq-close-results {
    background: #ffffff;
    border: 1px solid #dee2e6;
    color: #6c757d;
    border-radius: 4px;
}

.livq-theme-minimal .livq-close-results:hover {
    background: #f8f9fa;
    border-color: #6c757d;
}

/* Theme-specific responsive adjustments */
@media (max-width: 768px) {
    .livq-theme-modern .livq-quiz-content,
    .livq-theme-modern .livq-results-content {
        margin: 0 10px 10px 10px;
        padding: 20px;
    }
    
    .livq-theme-minimal .livq-quiz-content,
    .livq-theme-minimal .livq-results-content {
        padding: 20px;
    }
}
