/**
 * video-interaction-engine.css
 * Styles for VideoInteractionEngine overlays
 * Popup, Quiz, Commercial, CTA, Pause Point
 */

/* ============================================
   OVERLAY CONTAINER
   ============================================ */
.vie-overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.vie-overlay-container * {
    pointer-events: auto;
}

/* ============================================
   POSITIONING SYSTEM
   ============================================ */
.vie-pos-top-left {
    position: absolute;
    top: 16px;
    left: 16px;
}

.vie-pos-top-center {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
}

.vie-pos-top-right {
    position: absolute;
    top: 16px;
    right: 16px;
}

.vie-pos-center-left {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
}

.vie-pos-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.vie-pos-center-right {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
}

.vie-pos-bottom-left {
    position: absolute;
    bottom: 60px; /* Above video controls */
    left: 16px;
}

.vie-pos-bottom-center {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
}

.vie-pos-bottom-right {
    position: absolute;
    bottom: 60px;
    right: 16px;
}

/* ============================================
   POPUP STYLES
   ============================================ */
.vie-popup {
    max-width: 400px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.vie-popup.vie-visible {
    opacity: 1;
    transform: translateY(0);
}

.vie-popup.vie-pos-bottom-center.vie-visible {
    transform: translateX(-50%) translateY(0);
}

.vie-popup.vie-pos-top-center.vie-visible {
    transform: translateX(-50%) translateY(0);
}

.vie-popup.vie-hiding {
    opacity: 0;
    transform: translateY(-20px);
}

.vie-popup-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
}

.vie-popup-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vie-popup-content {
    flex: 1;
    min-width: 0;
}

.vie-popup-author {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.8;
}

.vie-popup-message {
    font-size: 15px;
    line-height: 1.4;
}

.vie-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 4px;
    line-height: 1;
}

.vie-popup-close:hover {
    opacity: 1;
}

/* Popup Style Variants */
.vie-popup-coach-tip .vie-popup-inner {
    background: linear-gradient(135deg, rgba(0, 40, 50, 0.95) 0%, rgba(0, 60, 70, 0.95) 100%);
    border: 1px solid rgba(0, 204, 255, 0.3);
    color: #fff;
}

.vie-popup-coach-tip .vie-popup-icon {
    background: rgba(0, 204, 255, 0.2);
    color: #00CCFF;
}

.vie-popup-coach-tip .vie-popup-author {
    color: #00CCFF;
}

.vie-popup-coach-tip .vie-popup-close {
    color: #fff;
}

.vie-popup-highlight .vie-popup-inner {
    background: linear-gradient(135deg, rgba(50, 40, 0, 0.95) 0%, rgba(70, 55, 0, 0.95) 100%);
    border: 1px solid rgba(255, 200, 0, 0.3);
    color: #fff;
}

.vie-popup-highlight .vie-popup-icon {
    background: rgba(255, 200, 0, 0.2);
    color: #FFC800;
}

.vie-popup-highlight .vie-popup-author {
    color: #FFC800;
}

.vie-popup-warning .vie-popup-inner {
    background: linear-gradient(135deg, rgba(50, 20, 20, 0.95) 0%, rgba(70, 25, 25, 0.95) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fff;
}

.vie-popup-warning .vie-popup-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.vie-popup-warning .vie-popup-author {
    color: #fca5a5;
}

.vie-popup-info .vie-popup-inner {
    background: rgba(30, 30, 35, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #fff;
}

.vie-popup-info .vie-popup-icon {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.vie-popup-celebration .vie-popup-inner {
    background: linear-gradient(135deg, rgba(20, 50, 30, 0.95) 0%, rgba(25, 70, 40, 0.95) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #fff;
}

.vie-popup-celebration .vie-popup-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.vie-popup-celebration .vie-popup-author {
    color: #86efac;
}

/* ============================================
   QUIZ STYLES
   ============================================ */
.vie-quiz {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.vie-quiz.vie-visible {
    opacity: 1;
}

.vie-quiz.vie-hiding {
    opacity: 0;
}

.vie-quiz-modal {
    background: #1a1a1a;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.vie-quiz-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #00CCFF 0%, #0099CC 100%);
    color: #000;
}

.vie-quiz-icon {
    display: flex;
}

.vie-quiz-label {
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vie-quiz-points {
    margin-left: auto;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.vie-quiz-question {
    padding: 24px 20px 16px;
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    line-height: 1.4;
}

.vie-quiz-answers {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vie-quiz-answer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vie-quiz-answer:hover:not(:disabled) {
    background: #333;
    border-color: #00CCFF;
}

.vie-quiz-answer:disabled {
    cursor: default;
}

.vie-quiz-answer.vie-selected {
    border-color: #00CCFF;
    background: rgba(0, 204, 255, 0.1);
}

.vie-quiz-answer.vie-correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
}

.vie-quiz-answer.vie-incorrect {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.vie-answer-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #3a3a3a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.vie-quiz-answer.vie-correct .vie-answer-letter {
    background: #22c55e;
    color: #000;
}

.vie-quiz-answer.vie-incorrect .vie-answer-letter {
    background: #ef4444;
    color: #fff;
}

.vie-answer-text {
    flex: 1;
}

.vie-quiz-feedback {
    padding: 0 20px 16px;
    text-align: center;
}

.vie-correct-text {
    color: #22c55e;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.vie-incorrect-text {
    color: #ef4444;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.vie-quiz-actions {
    padding: 0 20px 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.vie-quiz-skip {
    background: #333;
    border: none;
    color: #888;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.vie-quiz-skip:hover {
    background: #444;
    color: #fff;
}

.vie-quiz-continue {
    background: linear-gradient(135deg, #00CCFF 0%, #0099CC 100%);
    border: none;
    color: #000;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.vie-quiz-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 204, 255, 0.3);
}

/* ============================================
   COMMERCIAL STYLES
   ============================================ */
.vie-commercial {
    max-width: 400px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.vie-commercial.vie-visible {
    opacity: 1;
    transform: translateY(0);
}

.vie-commercial.vie-pos-bottom-center.vie-visible {
    transform: translateX(-50%) translateY(0);
}

.vie-commercial.vie-hiding {
    opacity: 0;
    transform: translateY(-20px);
}

.vie-commercial-inner {
    background: rgba(20, 20, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.vie-commercial-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vie-sponsor-name {
    color: #aaa;
}

.vie-commercial-content {
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.vie-commercial-content:hover {
    background: rgba(255, 255, 255, 0.05);
}

.vie-commercial-content img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
}

.vie-commercial-text {
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
}

.vie-commercial-actions {
    padding: 10px 14px;
    display: flex;
    justify-content: flex-end;
}

.vie-commercial-skip {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #888;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.vie-commercial-skip:disabled {
    cursor: default;
    opacity: 0.6;
}

.vie-commercial-skip:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.vie-skip-ready {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   CTA STYLES
   ============================================ */
.vie-cta {
    max-width: 320px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.vie-cta.vie-visible {
    opacity: 1;
    transform: translateY(0);
}

.vie-cta.vie-hiding {
    opacity: 0;
    transform: translateY(-20px);
}

.vie-cta-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.vie-cta-primary {
    background: linear-gradient(135deg, rgba(0, 40, 50, 0.95) 0%, rgba(0, 50, 60, 0.95) 100%);
    border: 1px solid rgba(0, 204, 255, 0.3);
}

.vie-cta-message {
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    padding-right: 20px;
}

.vie-cta-button {
    background: linear-gradient(135deg, #00CCFF 0%, #0099CC 100%);
    border: none;
    color: #000;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.vie-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 204, 255, 0.3);
}

.vie-cta-dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.vie-cta-dismiss:hover {
    color: #fff;
}

/* ============================================
   PAUSE POINT STYLES
   ============================================ */
.vie-pause-point {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vie-pause-point.vie-visible {
    opacity: 1;
}

.vie-pause-point.vie-hiding {
    opacity: 0;
}

.vie-pause-inner {
    text-align: center;
    color: #fff;
}

.vie-pause-icon {
    margin-bottom: 16px;
}

.vie-pause-icon svg {
    width: 64px;
    height: 64px;
    color: #00CCFF;
}

.vie-pause-message {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 24px;
    max-width: 400px;
}

.vie-pause-resume {
    background: linear-gradient(135deg, #00CCFF 0%, #0099CC 100%);
    border: none;
    color: #000;
    padding: 14px 32px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.vie-pause-resume:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 204, 255, 0.4);
}

.vie-pause-countdown {
    font-size: 16px;
    color: #888;
}

.vie-countdown-num {
    color: #00CCFF;
    font-weight: 600;
}

/* ============================================
   MODAL OVERLAY BASE
   ============================================ */
.vie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
}

/* ============================================
   MOBILE ADJUSTMENTS
   ============================================ */
@media (max-width: 600px) {
    .vie-popup {
        max-width: calc(100% - 32px);
        left: 16px !important;
        right: 16px !important;
        transform: none !important;
    }
    
    .vie-popup.vie-pos-bottom-center,
    .vie-popup.vie-pos-top-center {
        left: 16px !important;
        right: 16px !important;
    }
    
    .vie-popup.vie-pos-bottom-center.vie-visible,
    .vie-popup.vie-pos-top-center.vie-visible {
        transform: translateY(0) !important;
    }
    
    .vie-popup-inner {
        padding: 12px 14px;
    }
    
    .vie-popup-message {
        font-size: 14px;
    }
    
    .vie-quiz-modal {
        max-width: calc(100% - 32px);
        margin: 16px;
    }
    
    .vie-quiz-question {
        font-size: 16px;
        padding: 20px 16px 12px;
    }
    
    .vie-quiz-answer {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .vie-commercial {
        max-width: calc(100% - 32px);
        left: 16px !important;
        right: 16px !important;
    }
    
    .vie-cta {
        max-width: calc(100% - 32px);
    }
}
