/**
 * Video Ad Placement - Bottom Left Corner (Desktop Only)
 * For agencies page - sticky video ad container
 */

/* Video Ad Container - Bottom Left Position */
.video-ad-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 360px; /* Reduced by 10% from 400px */
    max-width: calc(100vw - 40px);
    background: #000000;
    border: 2px solid #ffee00;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 999;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Minimized State */
.video-ad-container.minimized {
    width: 54px; /* Reduced by 10% from 60px */
    height: 54px;
    border-radius: 50%;
    bottom: 20px;
    left: 20px;
}

.video-ad-container.minimized .video-ad-content {
    display: none;
}

.video-ad-container.minimized .video-ad-controls {
    display: none;
}

.video-ad-container.minimized .video-ad-restore {
    display: flex;
}

/* Hidden State */
.video-ad-container.hidden {
    display: none;
}

/* Video Ad Header */
.video-ad-header {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ffee00;
}

.video-ad-label {
    color: #ffee00;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.video-ad-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Control Buttons */
.video-ad-btn {
    background: transparent;
    border: 1px solid #ffee00;
    color: #ffee00;
    width: 12px; /* Reduced by 50% from 24px */
    height: 12px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.5em; /* Further reduced to fit smaller button */
}

.video-ad-btn:hover {
    background: #ffee00;
    color: #000000;
    transform: scale(1.1);
}

.video-ad-btn:active {
    transform: scale(0.95);
}

/* Minimize Button */
.video-ad-minimize {
    /* Inherits from .video-ad-btn */
}

/* Close Button */
.video-ad-close {
    border-color: #ff4d4f;
    color: #ff4d4f;
}

.video-ad-close:hover {
    background: #ff4d4f;
    color: #ffffff;
}

/* Restore Button (shown when minimized) */
.video-ad-restore {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffee00 0%, #ffd700 100%);
    color: #000000;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.video-ad-restore:hover {
    transform: scale(1.05);
}

.video-ad-restore i {
    animation: pulse 2s infinite;
}

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

/* Video Ad Content Area */
.video-ad-content {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Video Element */
.video-ad-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Placeholder for when no video is loaded */
.video-ad-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
    color: #ffee00;
    text-align: center;
    padding: 20px;
}

.video-ad-placeholder.hidden {
    display: none;
}

.video-ad-placeholder i {
    font-size: 3em;
    margin-bottom: 10px;
    opacity: 0.5;
}

.video-ad-placeholder-text {
    font-size: 0.9em;
    opacity: 0.7;
    line-height: 1.4;
}

/* Ad Info Footer */
.video-ad-footer {
    background: #0a0a0a;
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7em;
    color: #888888;
    border-top: 1px solid #333333;
}

.video-ad-info {
    display: flex;
    gap: 8px;
    align-items: center;
}

.video-ad-sponsor {
    color: #ffee00;
    text-decoration: none;
    transition: color 0.2s ease;
}

.video-ad-sponsor:hover {
    color: #ffffff;
    text-decoration: underline;
}

.video-ad-duration {
    color: #666666;
}

/* Mute/Unmute Button */
.video-ad-sound {
    background: transparent;
    border: none;
    color: #888888;
    cursor: pointer;
    font-size: 0.6em; /* Reduced by 50% from 1.2em */
    padding: 2px; /* Reduced padding proportionally */
    transition: color 0.2s ease;
}

.video-ad-sound:hover {
    color: #ffee00;
}

.video-ad-sound.muted {
    color: #ff4d4f;
}

/* Draggable functionality */
.video-ad-container.draggable .video-ad-header {
    cursor: move;
    cursor: grab;
}

.video-ad-container.dragging .video-ad-header {
    cursor: grabbing;
}

/* Loading State */
.video-ad-content.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 238, 0, 0.3);
    border-top-color: #ffee00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Desktop Only - Hide on Mobile and Tablet */
@media screen and (max-width: 1024px) {
    .video-ad-container {
        display: none !important;
    }
}

/* Medium Desktop - Adjust size */
@media screen and (min-width: 1025px) and (max-width: 1366px) {
    .video-ad-container {
        width: 315px; /* Reduced by 10% from 350px */
        bottom: 15px;
        left: 15px;
    }
}

/* Large Desktop - Full size */
@media screen and (min-width: 1367px) {
    .video-ad-container {
        width: 360px; /* Reduced by 10% from 400px */
        bottom: 20px;
        left: 20px;
    }
}

/* Ultra-wide screens */
@media screen and (min-width: 1920px) {
    .video-ad-container {
        width: 405px; /* Reduced by 10% from 450px */
        bottom: 30px;
        left: 30px;
    }
}

/* Ensure video ad doesn't overlap with other fixed elements */
.video-ad-container {
    /* Stay below modals but above page content */
    z-index: 999;
}

/* Don't show when printing */
@media print {
    .video-ad-container {
        display: none !important;
    }
}

/* Accessibility - Focus States */
.video-ad-btn:focus,
.video-ad-sound:focus,
.video-ad-restore:focus {
    outline: 2px solid #ffee00;
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .video-ad-container,
    .video-ad-btn,
    .video-ad-restore {
        transition: none;
        animation: none;
    }

    .video-ad-restore i {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .video-ad-container {
        border-width: 3px;
    }

    .video-ad-btn {
        border-width: 2px;
        font-weight: bold;
    }
}

/* Video Controls Visibility */
.video-ad-player::-webkit-media-controls {
    display: flex !important;
}

.video-ad-player::-webkit-media-controls-panel {
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

/* Hover effect on container */
.video-ad-container:hover {
    box-shadow: 0 6px 25px rgba(255, 238, 0, 0.3);
}

/* Smooth entry animation */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.video-ad-container.animate-in {
    animation: slideInFromLeft 0.5s ease-out;
}

/* Ad Badge/Label */
.video-ad-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffee00;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.65em;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid #ffee00;
    z-index: 10;
    pointer-events: none;
}

/* Click-through prevention overlay (for ad compliance) */
.video-ad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 5;
    cursor: pointer;
}

.video-ad-overlay.disabled {
    pointer-events: none;
}
