/*
 * TV Frame Video Styles
 * Frames a video inside a vintage TV overlay
 */

.tv-video-section {
    background: transparent;
    padding: 0;
    margin: 0;
    overflow-x: hidden; /* Prevent horizontal scroll while allowing centered overflow */
}

.tv-video-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    overflow: visible; /* Allow TV to extend for proper centering */
    width: 100%;
}

.tv-video-header {
    text-align: center;
    margin-bottom: 10px;
}

/* Hide or minimize header on mobile to reduce space */
@media screen and (max-width: 768px) {
    .tv-video-header {
        margin-bottom: 5px;
    }
    
    .tv-video-header .section-title {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .tv-video-header .section-description {
        font-size: 16px;
    }
}

.tv-video-header .section-title {
    font-size: 36px;
    font-weight: 700;
    color: #252525;
    margin-bottom: 15px;
    line-height: 1.2;
}

.tv-video-header .section-description {
    font-size: 18px;
    color: #666;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

.tv-video-container {
    position: relative;
    max-width: 1178px; /* Increased by 15% from 1024px */
    margin: 0 auto;
    padding: 0;
    overflow: visible; /* Allow 115% width to extend beyond */
}

.tv-video-wrapper {
    position: relative;
    width: 115%; /* Increased by 15% */
    max-width: 1178px;
    left: 50%;
    transform: translateX(-50%);
    padding-bottom: 64%; /* 1024x656 aspect ratio (antenna removed) */
    background: transparent;
    overflow: hidden; /* Clip effects that go outside bounds */
}

.tv-video-wrapper video,
.tv-video-wrapper iframe {
    position: absolute;
    top: 13.5%; /* Shifted up 1% from 14.5% */
    left: 8.85%; /* Shifted right 0.15% from 8.7% */
    width: 67.2%; /* Increased by 0.5% from 66.9% (66.9 × 1.005 = 67.2345) */
    height: 65.2%; /* Increased by 0.5% from 64.9% (64.9 × 1.005 = 65.2245) */
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    object-fit: cover; /* Fill container without black bars */
    z-index: 1;
}

.tv-frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
    z-index: 5; /* Above vintage effects (3-4) */
}

/* Responsive adjustments */
/* Tablet - Medium devices */
@media screen and (max-width: 1024px) {
    .tv-video-section {
        padding: 8vh 0 !important;
        margin: 0 auto !important;
        min-height: 0 !important;
        height: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-video-section .container {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .tv-video-wrapper {
        width: 100% !important; /* Override 115% to fit properly on tablets */
        max-width: 100% !important;
        margin: 0 auto !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important; /* Reset desktop transform */
        padding-bottom: 64% !important; /* Match TV frame aspect ratio */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-video-container {
        padding: 0 20px;
        margin: 0 auto !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-video-wrapper video,
    .tv-video-wrapper iframe {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-frame-overlay {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Tablet - Small tablets and large phones */
@media screen and (max-width: 768px) {
    .tv-video-section {
        padding: 6vh 0 !important;
        margin: 0 auto !important;
        min-height: 0 !important;
        height: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-video-section .container {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .tv-video-container {
        margin: 0 auto !important;
        padding: 0 15px !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-video-wrapper {
        width: 100% !important; /* Override 115% to fit properly */
        max-width: 100% !important;
        margin: 0 auto !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important; /* Reset desktop transform */
        padding-bottom: 64% !important; /* Match TV frame aspect ratio */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-video-wrapper video,
    .tv-video-wrapper iframe {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-frame-overlay {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-video-wrapper video,
    .tv-video-wrapper iframe {
        top: 13.5%;
        left: 8.85%;
        width: 67.2%;
        height: 65.2%;
        object-fit: cover;
    }
    
    /* No-frame mode on mobile: use standard video aspect ratio */
    .tv-video-wrapper.no-frame {
        padding-bottom: 56.25%; /* 16:9 aspect ratio */
    }
    
    .tv-video-wrapper.no-frame video,
    .tv-video-wrapper.no-frame iframe {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

@media screen and (max-width: 480px) {
    .tv-video-section {
        padding: 5vh 0 !important;
        margin: 0 auto !important;
        min-height: 0 !important;
        height: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-video-section .container {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .tv-video-container {
        margin: 0 auto !important;
        padding: 0 10px !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-video-wrapper {
        width: 100% !important; /* Override 115% to fit properly */
        max-width: 100% !important;
        margin: 0 auto !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important; /* Reset desktop transform */
        padding-bottom: 64% !important; /* Match TV frame aspect ratio */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-video-wrapper video,
    .tv-video-wrapper iframe {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-frame-overlay {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .tv-video-wrapper video,
    .tv-video-wrapper iframe {
        top: 13.5%;
        left: 8.85%;
        width: 67.2%;
        height: 65.2%;
        object-fit: cover;
    }
    
    /* No-frame mode on mobile: use standard video aspect ratio */
    .tv-video-wrapper.no-frame {
        padding-bottom: 56.25%; /* 16:9 aspect ratio */
    }
    
    .tv-video-wrapper.no-frame video,
    .tv-video-wrapper.no-frame iframe {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

/* Optional: Add vintage TV effect */
.tv-video-wrapper::before {
    content: '';
    position: absolute;
    top: 13.5%; /* Match video top position */
    left: 8.85%; /* Match video left position */
    width: 67.2%; /* Match video width */
    height: 65.2%; /* Match video height */
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    z-index: 2; /* Above video (1) but below frame (5) */
    pointer-events: none;
    opacity: 0.1;
}

/* Optional: Add scan line effect */
@keyframes scanline {
    0% {
        transform: translateY(calc(65.2vh - 20px)); /* Start at bottom of video */
    }
    100% {
        transform: translateY(0); /* End at top of video */
    }
}

.tv-video-wrapper.vintage-effect::after {
    content: '';
    position: absolute;
    top: 13.5%; /* Match video top position */
    left: 8.85%; /* Match video left position */
    width: 67.2%; /* Match video width */
    height: 20px;
    max-height: 20px;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    z-index: 3; /* Above video (1) but below frame (5) */
    pointer-events: none;
    overflow: hidden;
    /* Animation controlled by JavaScript class */
}

.tv-video-wrapper.vintage-effect.scanning::after {
    animation: scanline 8s linear forwards;
}

/* TV Mute/Unmute Button */
.tv-mute-button {
    position: absolute;
    bottom: 8%;
    right: 8%;
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid #888;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.tv-mute-button:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: #aaa;
    transform: scale(1.1);
}

.tv-mute-button:active {
    transform: scale(0.95);
}

.tv-mute-button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Responsive button sizing */
@media screen and (max-width: 768px) {
    .tv-mute-button {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 10%;
        right: 10%;
    }
}

@media screen and (max-width: 480px) {
    .tv-mute-button {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* No Frame Mode - Video Only */
.tv-video-wrapper.no-frame {
    background: transparent;
}

.tv-video-wrapper.no-frame video,
.tv-video-wrapper.no-frame iframe {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    object-fit: cover; /* Fill container without black bars */
}

/* Hide the frame overlay when no-frame is active */
.tv-video-wrapper.no-frame .tv-frame-overlay {
    display: none;
}

/* Adjust control positioning for no-frame mode */
.tv-video-wrapper.no-frame .tv-mute-button {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.tv-video-wrapper.no-frame .tv-mute-button:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
}

.tv-video-wrapper.no-frame .tv-playlist-controls {
    bottom: 20px;
    left: 20px;
}

.tv-video-wrapper.no-frame .tv-nav-button {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.tv-video-wrapper.no-frame .tv-nav-button:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
}

.tv-video-wrapper.no-frame .tv-playlist-counter {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* TV Playlist Navigation Controls */
.tv-playlist-controls {
    position: absolute;
    bottom: 8%;
    left: 8%;
    z-index: 5;
    display: flex;
    gap: 10px;
    align-items: center;
}

.tv-nav-button {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid #888;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.tv-nav-button:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: #aaa;
    transform: scale(1.1);
}

.tv-nav-button:active {
    transform: scale(0.95);
}

.tv-nav-button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.tv-nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.tv-nav-button:disabled:hover {
    transform: none;
    border-color: #888;
}

/* Playlist counter display */
.tv-playlist-counter {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #888;
    border-radius: 20px;
    padding: 8px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: Arial, sans-serif;
    white-space: nowrap;
}

/* Responsive playlist controls */
@media screen and (max-width: 768px) {
    .tv-playlist-controls {
        bottom: 10%;
        left: 5%;
        gap: 8px;
    }
    
    .tv-nav-button {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .tv-playlist-counter {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media screen and (max-width: 480px) {
    .tv-playlist-controls {
        bottom: 12%;
        left: 3%;
        gap: 6px;
    }
    
    .tv-nav-button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .tv-playlist-counter {
        font-size: 11px;
        padding: 5px 10px;
    }
}

