/* Bold and Colorful Theme */
:root {
    --primary-color: #ff4081;
    --secondary-color: #3f51b5;
    --accent-color: #00e676;
    --text-color: #333;
    --background-color: #f5f7fa;
    --panel-bg: #ffffff;
    --shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.3);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Blurred Background */
.vep-blurred-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 999;
    animation: fadeIn 0.5s ease;
}

/* Floating Panel */
.vep-floating-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    height: auto;
    max-height: 90vh;
    background: var(--panel-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    animation: fadeIn 0.5s ease;
    box-sizing: border-box;
}

/* Ensure content takes full height and distributes space properly */
.vep-floating-panel > * {
    flex-shrink: 0;
    width: 100%;
    margin-bottom: 15px;
}

.vep-floating-panel > *:last-child {
    margin-bottom: 0;
}

/* Responsive Adjustments for Phone */
@media (max-width: 576px) {
    .vep-floating-panel {
        width: 95%;
        max-width: 350px;
        padding: 15px;
        max-height: 95vh;
    }

    .vep-floating-panel h2 {
        font-size: 18px;
        padding: 8px;
        margin-bottom: 10px;
    }

    .vep-video-name {
        font-size: 12px;
        padding: 6px 10px;
        margin-bottom: 10px;
    }

    .vep-progress-bar {
        gap: 4px;
        padding: 4px;
        margin-bottom: 10px;
    }

    .vep-progress-segment {
        height: 8px;
    }

    .vep-timer {
        font-size: 14px;
        padding: 6px;
        margin-bottom: 10px;
    }

    .vep-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .vep-previous-btn,
    .vep-continue-btn {
        width: 100%;
        padding: 10px;
    }
    
    .vep-previous-btn {
        order: 2; /* Move Previous button below Continue button on mobile */
    }
    
    .vep-continue-btn {
        order: 1; /* Move Continue button above Previous button on mobile */
    }

    .vep-ad-field {
        width: 100%;
        height: auto;
        min-height: 200px;
        padding: 5px;
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .vep-video-frame .video-js {
        height: 180px;
    }
}

/* Tablet layout */
@media (min-width: 577px) and (max-width: 991px) {
    .vep-floating-panel {
        width: 90%;
        max-width: 450px;
        padding: 20px;
    }
    
    .vep-buttons {
        flex-direction: row;
    }
    
    .vep-video-frame .video-js {
        height: 220px;
    }
}

/* Desktop layout */
@media (min-width: 992px) {
    .vep-floating-panel {
        width: 85%;
        max-width: 500px;
        padding: 25px;
    }
    
    .vep-buttons {
        flex-direction: row;
    }
    
    .vep-video-frame .video-js {
        height: 250px;
    }
}

.vep-floating-panel h2 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 2%; /* 2% of panel width */
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow);
    padding: 10px;
    border-radius: var(--border-radius);
    width: 100%;
    text-align: center;
}

/* Video Name */
.vep-video-name {
    background: var(--secondary-color);
    color: #fff;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2%; /* 2% of panel width */
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
}

/* Progress Bar */
.vep-progress-bar {
    width: 100%;
    display: flex;
    gap: 8px;
    margin-bottom: 2%; /* 2% of panel width */
    box-shadow: var(--shadow);
    padding: 5px;
    border-radius: var(--border-radius);
}

.vep-progress-bar-inner {
    display: flex;
    width: 100%;
    gap: 8px;
}

.vep-progress-segment {
    flex: 1;
    height: 12px;
    background: #e0e0e0;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

.vep-progress {
    height: 100%;
    background: var(--accent-color);
    transition: width 0.1s linear;
}

/* Video Frame */
.vep-video-frame {
    width: 100%;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.vep-video-frame .video-js {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* Responsive video player controls */
.vep-video-frame .vjs-control-bar {
    font-size: 14px;
}

@media (max-width: 576px) {
    .vep-video-frame .vjs-control-bar {
        font-size: 12px;
        display: flex;
        flex-wrap: wrap;
    }
    
    .vep-video-frame .vjs-big-play-button {
        width: 80px !important;
        height: 50px !important;
    }
    
    .vep-video-frame .vjs-big-play-button .vjs-icon-placeholder:before {
        width: 24px !important;
        height: 24px !important;
    }
}

/* Redesign the play button */
.vep-video-frame .vjs-big-play-button {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100px !important;
    height: 60px !important;
    border-radius: 15px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    transition: var(--transition) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Ensure play button hides when playing and shows when paused */
.vep-video-frame .vjs-playing .vjs-big-play-button {
    display: none !important;
}

.vep-video-frame .vjs-paused .vjs-big-play-button {
    display: flex !important;
}

/* Bold play icon (outline) with thinner stroke and rounded edges */
.vep-video-frame .vjs-big-play-button .vjs-icon-placeholder:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px !important;
    height: 30px !important;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cG9seWdvbiBwb2ludHM9IjUgNSA1IDE5IDE5IDEyIDUgNSI+PC9wb2x5Z29uPjwvc3ZnPg==');
    background-size: contain;
    background-repeat: no-repeat;
}

/* Hover effect for play button */
.vep-video-frame .vjs-big-play-button:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4) !important;
    transform: translate(-50%, -50%) scale(1.1) !important;
}

/* Timer */
.vep-timer {
    margin-bottom: 2%; /* 2% of panel width */
    color: var(--text-color);
    font-weight: 500;
    font-size: 16px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: var(--shadow);
    padding: 10px;
    border-radius: var(--border-radius);
    width: 100%;
    text-align: center;
}

.vep-timer-count {
    color: var(--primary-color);
    font-weight: 700;
}

/* Buttons Container */
.vep-buttons {
    display: flex;
    width: 100%;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    padding: 10px;
    border-radius: var(--border-radius);
    gap: 10px;
}

/* Continue Button */
.vep-continue-btn {
    flex: 7;
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    min-height: 44px; /* Ensure minimum touch target size */
    background: var(--primary-color);
    padding-right: 30px;
}

/* Previous Button */
.vep-previous-btn {
    flex: 3;
    padding: 12px 20px;
    padding-left: 30px;
    border: none;
    border-radius: var(--border-radius);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    min-height: 44px;
    background: var(--secondary-color);
}

/* When previous button is not present, make continue button full width */
.vep-buttons:not(:has(.vep-previous-btn)) .vep-continue-btn {
    flex: 1;
    width: 100%;
}

/* Previous Button Icon */
.vep-previous-btn::before {
    content: '';
    position: absolute;
    left: 15px;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48bGluZSB4MT0iMTkiIHkxPSIxMiIgeDI9IjUiIHkyPSIxMiI+PC9saW5lPjxwb2x5bGluZSBwb2ludHM9IjEyIDE5IDUgMTIgMTIgNSI+PC9wb2x5bGluZT48L3N2Zz4=');
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

/* Continue Button Arrow Icon */
.vep-continue-btn::before {
    content: '';
    position: absolute;
    right: 15px;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48bGluZSB4MT0iNSIgeTE9IjEyIiB4Mj0iMTkiIHkyPSIxMiI+PC9saW5lPjxwb2x5bGluZSBwb2ludHM9IjEyIDUgMTkgMTIgMTIgMTkiPjwvcG9seWxpbmU+PC9zdmc+');
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

/* Disabled state */
.vep-continue-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #888;
}

/* Ad clicked state */
.vep-continue-btn.vep-ad-clicked {
    background: var(--accent-color);
    transform: scale(1.05);
}

.vep-continue-btn.vep-ad-clicked::before {
    transform: translateX(3px);
}

/* Pulse animation for continue button */
.vep-continue-btn:not(:disabled) {
    animation: pulse 2s infinite;
}

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

.vep-continue-btn:not(:disabled):hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-hover);
}

.vep-continue-btn:not(:disabled):active {
    transform: translateY(1px);
}

/* Ad Field */
.vep-ad-field {
    width: 100%;
    min-height: 250px;
    background: #f5f5f5;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    padding: 5px;
    text-align: center;
    color: #666;
}

.vep-ad-field:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Make sure Google ads display properly */
.vep-ad-field div[id^="div-gpt-ad"] {
    width: 100% !important;
    height: 100% !important;
    min-height: 250px;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Make sure Google ads are clickable */
.vep-ad-field iframe {
    pointer-events: auto !important;
}

/* Overlay effect for ad field */
.vep-ad-field::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.vep-ad-field:hover::after {
    opacity: 1;
}

@media (max-width: 576px) {
    .vep-buttons {
        padding: 8px;
    }
    
    .vep-continue-btn {
        padding: 10px;
        font-size: 14px;
    }
    
    .vep-ad-field {
        min-height: 200px;
    }
}

/* Completed Panel */
.vep-completed-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease;
}

.vep-completed-content {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: var(--shadow);
}

.vep-completed-heading {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.vep-completed-message {
    color: var(--text-color);
    font-size: 18px;
    font-weight: 500;
}

.vep-completed-timer {
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
}

.vep-completed-timer-count {
    color: var(--primary-color);
    font-weight: 700;
}

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

.vep-fake-click {
    position: fixed;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: clickPulse 0.3s ease-out;
}

@keyframes clickPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.vep-fake-click.fully-invisible {
    opacity: 0;
}

.vep-fake-click.semi-transparent-50 {
    opacity: 0.5;
}

.vep-fake-click.semi-transparent-25 {
    opacity: 0.25;
}

/* Ad required indicator */
.vep-ad-required {
    animation: adPulse 1.5s infinite ease-in-out;
    box-shadow: 0 0 0 3px var(--accent-color);
}

.vep-ad-required::before {
    content: 'Click Here First';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
}

@keyframes adPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 230, 118, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
    }
}

/* Ad highlight effect when continue is clicked before ad */
.vep-ad-highlight {
    animation: adHighlight 1s ease-in-out;
}

@keyframes adHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 64, 129, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(255, 64, 129, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 64, 129, 0);
    }
}