/**
 * Quiz System Styles
 * Beautiful and modern styling for the quiz widget
 */

/* Quiz Widget Container */
.quiz-widget-container {
    max-width: 600px;
    margin: 30px auto;
    background: linear-gradient(135deg, #1B3A5F 0%, #1b507c 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow: hidden;
}

.quiz-widget-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="2"/></g></svg>') repeat;
    pointer-events: none;
}

.quiz-widget-container > * {
    position: relative;
    z-index: 1;
}

/* Quiz Header */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.quiz-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
}

.quiz-title i {
    color: #ffd700;
    font-size: 28px;
}

.quiz-points-display {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.points-label {
    font-size: 14px;
    opacity: 0.9;
    margin-right: 8px;
}

.points-value {
    font-size: 16px;
    color: #ffd700;
    font-weight: 700;
}

/* Loading State */
.quiz-loading {
    text-align: center;
    padding: 50px 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 200, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.quiz-loading.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.quiz-loading.fade-in {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.quiz-loading .loading-spinner {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Outer spinning ring - thick golden ring */
.quiz-loading .loading-spinner::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    border: 8px solid rgba(255, 200, 0, 0.1);
    border-top: 8px solid #ffc800;
    border-right: 8px solid #ffa500;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
    box-shadow: 
        0 0 25px rgba(255, 200, 0, 0.5),
        inset 0 0 10px rgba(255, 200, 0, 0.1);
    transform-origin: center center;
}

/* Inner white circle */
.quiz-loading .loading-spinner::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 
        inset 0 2px 6px rgba(0, 0, 0, 0.1),
        0 6px 20px rgba(0, 0, 0, 0.15);
    z-index: 2;
    border: 2px solid rgba(255, 200, 0, 0.1);
}

/* Center dot - golden dot */
.quiz-loading .loading-spinner .spinner-dot {
    background: linear-gradient(135deg, #ffc800, #ffa500);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    box-shadow: 
        0 0 20px rgba(255, 200, 0, 0.8),
        0 0 40px rgba(255, 200, 0, 0.4);
    z-index: 3;
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

/* Pulse animation for center dot */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 20px rgba(255, 200, 0, 0.8),
            0 0 40px rgba(255, 200, 0, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 
            0 0 25px rgba(255, 200, 0, 1),
            0 0 50px rgba(255, 200, 0, 0.6);
    }
}
  
  

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

.quiz-loading p {
    font-size: 18px;
    font-weight: 500;
    color: #ffffff;
    margin: 0;
    text-align: center;
    letter-spacing: 0.5px;
    animation: textFade 2s ease-in-out infinite alternate;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@keyframes textFade {
    0% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* Quiz Question */
.quiz-question-container {
    animation: fadeInUp 0.5s ease-out;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-question-container.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.quiz-question-container.fade-in {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.quiz-question h4 {
    font-size: 20px;
    line-height: 1.4;
    margin: 0 0 15px 0;
    color: #ffffff;
    font-weight: 600;
    text-align: center;
}

.attempt-indicator {
    text-align: center;
    font-size: 12px;
    color: rgba(215, 215, 215, 0.8);
    margin-bottom: 25px;
    font-weight: 500;
}

/* Quiz Options */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.quiz-option {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.quiz-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.quiz-option:hover::before {
    left: 100%;
}

.quiz-option:hover {
    background: rgba(255, 255, 255, 0.321);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.quiz-option.selecting {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.2);
}

.quiz-option.selected {
    background: rgba(12, 40, 62, 0.796);
    border-color: #ffd700;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.option-letter {
    width: 35px;
    height: 35px;
    background: linear-gradient(90deg, #ffc800, #FFA500);
    color: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    margin-right: 15px;
    flex-shrink: 0;
}

.quiz-option.selected .option-letter {
    background: #fff;
    color: #667eea;
}

.option-text {
    flex: 1;
    font-size: 16px;
    line-height: 1.4;
}

/* Quiz Actions */
.quiz-actions {
    text-align: center;
}

.quiz-submit-btn {
    background: linear-gradient(90deg, #ffc800, #FFA500);
    color: #333;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.quiz-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}

.quiz-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Quiz Result */
.quiz-result {
    text-align: center;
    padding: 20px;
    animation: fadeInUp 0.5s ease-out;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-result.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.quiz-result.fade-in {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.result-icon i {
    font-size: 60px;
    margin-bottom: 20px;
}

.result-icon .correct {
    color: #10b981;
}

.result-icon .incorrect {
    color: #ef4444;
}

.result-message h4 {
    font-size: 22px;
    margin: 0 0 20px 0;
    font-weight: 600;
    color: #ffffff;
}

.result-points {
    margin: 20px 0;
}

.points-earned {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #10b981;
}

.points-earned i {
    color: #00ffb0;
    font-size: 20px;
}

.points-missed {
    background: rgb(255 0 0 / 29%);
    border: 1px solid #aa5454;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.total-points {
    font-size: 16px;
    opacity: 0.9;
}

.result-actions {
    margin-top: 25px;
}

.quiz-new-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 30px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.quiz-new-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Continue Section */
.continue-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.continue-section h4 {
    font-size: 18px;
    margin: 0 0 20px 0;
    color: white;
    font-weight: 600;
}

.continue-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.continue-yes-btn,
.continue-no-btn {
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.continue-yes-btn {
    background: linear-gradient(45deg, #10b981, #34d399);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.continue-yes-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.continue-no-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.continue-no-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Completion Actions */
.completion-actions {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.completion-actions .dashboard-button {
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.completion-actions .dashboard-button-primary {
    background: linear-gradient(45deg, #3b82f6, #60a5fa);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.completion-actions .dashboard-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.completion-actions .dashboard-button-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.completion-actions .dashboard-button-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.completion-message {
    font-size: 16px;
    margin-top: 15px;
    opacity: 0.9;
    font-weight: 500;
}

/* Completed State */
.quiz-result.completed {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.quiz-result.completed .result-icon i {
    color: white;
}

/* Login Required State */
.quiz-login-required {
    margin: 20px auto;
    max-width: 650px;
    padding: 0 15px;
}

.quiz-login-card {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 15px;
    padding: 25px 30px;
    color: white;
    box-shadow: 0 10px 30px rgba(30, 60, 114, 0.25);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.quiz-login-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.quiz-trophy-icon {
    font-size: 40px;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    animation: trophy-glow 2s ease-in-out infinite alternate;
}

@keyframes trophy-glow {
    0% { text-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
    100% { text-shadow: 0 0 25px rgba(255, 215, 0, 0.9); }
}

.quiz-login-text h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    color: white;
}

.quiz-login-text p {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
    font-weight: 400;
    line-height: 1.4;
}

.quiz-login-text p strong {
    color: #ffd700;
    font-weight: 700;
}

.quiz-login-right {
    flex-shrink: 0;
}

.quiz-signin-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quiz-signin-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.6);
    text-decoration: none;
    color: white;
    background: linear-gradient(45deg, #20c997, #28a745);
}

.quiz-signin-btn i {
    font-size: 18px;
}

/* Responsive Design for Login Card */
@media (max-width: 768px) {
    .quiz-login-card {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 25px 20px;
    }
    
    .quiz-login-left {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .quiz-trophy-icon {
        font-size: 35px;
    }
    
    .quiz-login-text h3 {
        font-size: 22px;
    }
    
    .quiz-signin-btn {
        padding: 14px 28px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .quiz-login-required {
        margin: 15px 10px;
    }
    
    .quiz-login-card {
        padding: 20px 15px;
    }
    
    .quiz-trophy-icon {
        font-size: 30px;
    }
    
    .quiz-login-text h3 {
        font-size: 20px;
    }
    
    .quiz-login-text p {
        font-size: 15px;
    }
    
    .quiz-signin-btn {
        padding: 12px 24px;
        font-size: 15px;
        width: 100%;
        justify-content: center;
    }
}

/* Quiz Authentication Popup */
.quiz-auth-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.quiz-auth-modal {
    position: relative;
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: quiz-popup-appear 0.3s ease-out;
}

@keyframes quiz-popup-appear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.quiz-auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e9ecef;
}

.quiz-auth-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.quiz-auth-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.quiz-auth-close:hover {
    background: #f8f9fa;
    color: #dc3545;
}

.quiz-auth-content {
    padding: 25px;
    padding-bottom: 30px;
}

.quiz-form-group {
    margin-bottom: 20px;
}

.quiz-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
    text-align: left;
}

.quiz-form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: white;
    text-align: left;
}

.quiz-form-group input::placeholder {
    color: #adb5bd;
    font-style: normal;
    opacity: 1;
    font-weight: 400;
}

.quiz-form-group input:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.15);
    background: white;
}

.quiz-auth-submit-btn {
    width: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    color: #2c3e50;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.25);
    text-transform: none;
    letter-spacing: 0;
}

.quiz-auth-submit-btn:hover {
    background: linear-gradient(90deg, #FFA500, #FFD700);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

.quiz-auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.quiz-auth-switch {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    position: relative;
    z-index: 10;
}

.quiz-auth-switch p {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
}

.quiz-auth-switch a {
    color: #FFA500;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.quiz-auth-switch a:hover {
    color: #FFD700;
    text-decoration: underline;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.quiz-auth-loading {
    text-align: center;
    padding: 50px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.quiz-auth-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

.quiz-auth-loading .loading-spinner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #FFD700, #FFA500, #FFD700);
    position: relative;
    margin: 0 auto 25px;
    animation: spin 1.2s linear infinite;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    transform-origin: center center;
}

.quiz-auth-loading .loading-spinner::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quiz-auth-loading .loading-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #FFD700;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

.quiz-auth-loading .loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.quiz-auth-loading .loading-dot {
    width: 8px;
    height: 8px;
    background: #FFD700;
    border-radius: 50%;
    animation: loadingDots 1.4s ease-in-out infinite both;
}

.quiz-auth-loading .loading-dot:nth-child(1) { animation-delay: -0.32s; }
.quiz-auth-loading .loading-dot:nth-child(2) { animation-delay: -0.16s; }
.quiz-auth-loading .loading-dot:nth-child(3) { animation-delay: 0s; }

.quiz-auth-loading p {
    margin: 0;
    color: #475569;
    font-size: 16px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.quiz-auth-loading .loading-subtitle {
    margin-top: 8px;
    color: #64748b;
    font-size: 14px;
    font-weight: 400;
    opacity: 0.8;
}

/* Enhanced animations */
@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

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

.quiz-auth-success {
    text-align: center;
    padding: 40px 20px;
}

.quiz-auth-success .success-icon {
    font-size: 60px;
    color: #FFD700;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    animation: success-glow 2s ease-in-out infinite alternate;
}

@keyframes success-glow {
    0% { text-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
    100% { text-shadow: 0 0 25px rgba(255, 215, 0, 0.9); }
}

.quiz-auth-success h4 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #2c3e50;
    font-weight: 700;
}

.quiz-auth-success p {
    margin: 0;
    color: #6c757d;
    font-size: 16px;
}

.quiz-auth-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #f5c6cb;
    position: relative;
    z-index: 10;
}

.quiz-auth-error i {
    font-size: 18px;
}

/* Fix overlay text issues */
.quiz-auth-form {
    position: relative;
    z-index: 5;
    background: white;
    padding: 10px 0;
}

.quiz-auth-form input {
    position: relative;
    z-index: 6;
}

/* Prevent text selection issues */
.quiz-auth-modal * {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* OTP Verification Styles */
.otp-info {
    text-align: center;
    margin-bottom: 25px;
}

.otp-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    animation: otp-icon-pulse 2s ease-in-out infinite;
}

.otp-icon i {
    font-size: 36px;
    color: #fff;
    text-shadow: none;
}

@keyframes otp-icon-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    }
}

.otp-info h4 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.otp-info p {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 5px 0;
}

.masked-email {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 15px 0;
}

.otp-digit {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.otp-digit:focus {
    border-color: #FFD700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.15);
    background: white;
}

.otp-digit.filled {
    border-color: #28a745;
    background: #f8fff9;
}

.otp-digit.error {
    border-color: #dc3545;
    background: #fff8f8;
    animation: shake 0.5s ease-in-out;
}

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

.otp-resend {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.otp-resend p {
    font-size: 13px;
    color: #6c757d;
    margin: 0 0 10px 0;
}

.resend-btn {
    background: none;
    border: none;
    color: #FFA500;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px 0;
}

.resend-btn:hover:not(:disabled) {
    color: #FFD700;
    text-decoration: underline;
}

.resend-btn:disabled {
    color: #adb5bd;
    cursor: not-allowed;
}

.resend-countdown {
    color: #6c757d;
    font-weight: normal;
}

/* Responsive Design for Popup */
@media (max-width: 480px) {
    .quiz-auth-modal {
        width: 95%;
        margin: 10px;
        max-height: 90vh;
    }
    
    .quiz-auth-header {
        padding: 20px 20px 15px;
    }
    
    .quiz-auth-header h3 {
        font-size: 18px;
    }
    
    .quiz-auth-content {
        padding: 20px;
        padding-bottom: 25px;
    }
    
    .quiz-form-group input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 16px;
    }
    
    .quiz-form-group label {
        font-size: 13px;
    }
    
    .quiz-auth-submit-btn {
        font-size: 14px;
        padding: 12px;
    }
    
    .quiz-auth-switch p {
        font-size: 12px;
    }
    
    .otp-inputs {
        gap: 8px;
    }
    
    .otp-digit {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .otp-icon {
        width: 70px;
        height: 70px;
        margin: 0 auto 15px;
    }
    
    .otp-icon i {
        font-size: 30px;
    }
    
    .otp-info h4 {
        font-size: 18px;
    }
    
    .otp-info p {
        font-size: 13px;
    }
}

/* Error State */
.quiz-error {
    text-align: center;
    padding: 40px 20px;
    animation: fadeInUp 0.5s ease-out;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-error.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.quiz-error.fade-in {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.error-icon i {
    font-size: 50px;
    color: #ef4444;
    margin-bottom: 20px;
}

.error-message {
    font-size: 16px;
    margin-bottom: 25px;
    opacity: 0.9;
}

.quiz-retry-btn {
    background: rgba(239, 68, 68, 0.8);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-retry-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: translateY(-1px);
}

/* Completed State */
.quiz-completed {
    text-align: center;
    padding: 40px 20px;
    animation: fadeInUp 0.5s ease-out;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-completed.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.quiz-completed.fade-in {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.completed-icon i {
    font-size: 60px;
    color: #10b981;
    margin-bottom: 20px;
}

.completed-message h4 {
    font-size: 22px;
    margin: 0 0 15px 0;
    font-weight: 600;
    color: #ffffff;
}

.completed-message p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 25px;
    line-height: 1.5;
}

.completed-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

.stat-label {
    opacity: 0.9;
}

.stat-value {
    font-weight: 700;
    color: #ffd700;
    font-size: 18px;
}

/* Quiz Info */
.quiz-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.info-item i {
    color: #ffd700;
    font-size: 16px;
}

/* Login Required State */
.quiz-login-required {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.quiz-login-required p {
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

.quiz-login-required a {
    color: #ffd700;
    text-decoration: none;
    font-weight: 600;
}

.quiz-login-required a:hover {
    text-decoration: underline;
}

/* Celebration Animation */
@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.quiz-widget-container.celebration {
    animation: celebrate 0.6s ease-in-out 3;
}

.quiz-widget-container.celebration::after {
    content: '🎉';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    animation: bounce 1s ease-in-out infinite;
}

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

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Celebration animation for correct answers */
@keyframes celebration {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(5deg);
    }
    50% {
        transform: scale(1.05) rotate(-5deg);
    }
    75% {
        transform: scale(1.1) rotate(3deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.quiz-widget-container.celebration {
    animation: celebration 0.6s ease-in-out;
}

/* Quiz option selection animation */
.quiz-option {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.quiz-option.selected {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

/* Quiz button animations */
.quiz-submit-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quiz-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.quiz-submit-btn:hover:not(:disabled)::before {
    left: 100%;
}

.quiz-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.quiz-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.quiz-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.quiz-submit-btn.enabled {
    animation: buttonPulse 0.6s ease-out;
}

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

/* Submit button loading state - just disable button */
.quiz-submit-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Confetti animation for celebrations */
@keyframes confettiFall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(400px) rotate(720deg);
        opacity: 0;
    }
}

.confetti-piece {
    position: absolute;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quiz-widget-container {
        margin: 20px 15px;
        padding: 20px;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .quiz-title {
        font-size: 20px;
    }
    
    .quiz-question h4 {
        font-size: 18px;
    }
    
    .quiz-options {
        gap: 12px;
    }
    
    .quiz-option {
        padding: 12px 15px;
    }
    
    .option-letter {
        width: 30px;
        height: 30px;
        font-size: 14px;
        margin-right: 12px;
    }
    
    .option-text {
        font-size: 15px;
    }
    
    .quiz-submit-btn {
        padding: 12px 30px;
        font-size: 14px;
    }
    
    .quiz-info {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .quiz-widget-container {
        margin: 15px 10px;
        padding: 15px;
    }
    
    .quiz-title {
        font-size: 18px;
    }
    
    .quiz-question h4 {
        font-size: 16px;
    }
    
    .option-text {
        font-size: 14px;
    }
    
    .quiz-submit-btn {
        padding: 10px 25px;
        font-size: 13px;
    }
    
    .continue-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .continue-yes-btn,
    .continue-no-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .completion-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .completion-actions .dashboard-button {
        width: 100%;
        padding: 12px 20px;
        font-size: 13px;
    }
}
