/* ===================================================================
   Lenell TV — Premium Neon/Glassmorphism Video Styles
   =================================================================== */

:root {
    --player-glow: #ec4899;
}

/* Base Adjustments */
body {
    background-color: #03000a;
}

/* Header Tweaks */
.watch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.region-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.region-selector-wrapper label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #cbd5e1;
}

#region-select {
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

#region-select option {
    background: #0f0a1c;
    color: #fff;
    padding: 10px;
}

/* Layout Grid */
.watch-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 1024px) {
    .watch-grid {
        grid-template-columns: 1fr;
    }
}

/* Theater/Player Section */
.theater-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.player-container {
    background: rgba(15, 10, 25, 0.6);
    border: 1px solid rgba(236, 72, 153, 0.2);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-container:hover {
    border-color: rgba(236, 72, 153, 0.4);
    box-shadow: 0 8px 32px 0 rgba(236, 72, 153, 0.1);
}

.iframe-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: radial-gradient(circle, #180d28 0%, #03000a 100%);
    z-index: 3;
    cursor: pointer;
    transition: opacity 0.4s ease;
}

.player-placeholder.hidden {
    opacity: 0;
    pointer-events: none;
}

.placeholder-content {
    padding: 2rem;
}

.play-btn-large {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff;
    border-radius: 50%;
    font-size: 2rem;
    padding-left: 5px; /* Offset to visually center triangle */
    margin-bottom: 1.5rem;
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.player-placeholder:hover .play-btn-large {
    transform: scale(1.1);
    box-shadow: 0 0 35px rgba(236, 72, 153, 0.8);
}

.player-placeholder h3 {
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.player-placeholder p {
    font-size: 0.95rem;
    color: #94a3b8;
}

/* Player Meta Details */
.player-info {
    padding: 1.5rem;
}

.video-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.video-meta-top h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.4;
}

.video-meta-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.meta-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.meta-badge.channel {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #c084fc;
}

.meta-badge.views {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #cbd5e1;
}

.meta-badge.duration {
    background: rgba(236, 72, 153, 0.15);
    border: 1px solid rgba(236, 72, 153, 0.3);
    color: #f472b6;
}

/* Control Buttons */
.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.20);
    transform: translateY(-2px);
}

.icon-btn.active {
    background: rgba(236, 72, 153, 0.2);
    border-color: #ec4899;
    color: #ec4899;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
}

/* Custom URL Input Container */
.custom-link-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.2rem;
}

.custom-link-container .input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.custom-link-container input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.custom-link-container input:focus {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.custom-link-container .input-icon {
    font-size: 1.4rem;
}

.custom-link-container button {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.input-tip {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.6rem;
    margin-left: 2.2rem;
}

/* Sidebar Sections */
.sidebar-section {
    display: flex;
    flex-direction: column;
}

.sidebar-card {
    background: rgba(15, 10, 25, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
}

.sidebar-header {
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.sidebar-header .subtitle {
    font-size: 0.85rem;
    color: #8b5cf6;
    margin: 0.2rem 0 0 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: 480px;
    padding-right: 0.3rem;
}

/* Sidebar scrollbar styling */
.video-list::-webkit-scrollbar {
    width: 6px;
}
.video-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 3px;
}
.video-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.video-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Video Card Tiles (Sidebar & Browse Grid) */
.video-card-tile {
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-card-tile:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

.video-card-tile.active {
    background: rgba(236, 72, 153, 0.08);
    border-color: rgba(236, 72, 153, 0.4);
}

.video-card-tile.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #ec4899;
}

.thumbnail-container {
    position: relative;
    width: 100px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
    flex-shrink: 0;
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-duration {
    position: absolute;
    bottom: 3px;
    right: 4px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
}

.card-details {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    min-width: 0; /* Ensures text-overflow ellipsis works */
}

.card-details h4 {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    margin: 0 0 0.3rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-details .card-channel {
    font-size: 0.75rem;
    color: #c084fc;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-details .card-views {
    font-size: 0.7rem;
    color: #64748b;
    margin: 0;
}

/* Curated Browse Grid */
.browse-section {
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.browse-header {
    margin-bottom: 1.5rem;
}

.browse-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.4rem 0;
}

.browse-header p {
    color: #94a3b8;
    margin: 0;
}

/* Custom Tabs styling */
.category-tabs {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.category-tabs::-webkit-scrollbar {
    height: 4px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.tab-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Custom Large video card for Browse Grid */
.browse-card-tile {
    display: flex;
    flex-direction: column;
    background: rgba(15, 10, 25, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.browse-card-tile:hover {
    background: rgba(15, 10, 25, 0.5);
    border-color: rgba(236, 72, 153, 0.25);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.05);
}

.browse-card-tile .thumbnail-large-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.browse-card-tile .thumbnail-large-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.browse-card-tile .card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.browse-card-tile h4 {
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.browse-card-tile .channel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.browse-card-tile .card-channel {
    font-size: 0.8rem;
    color: #c084fc;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.browse-card-tile .card-views {
    font-size: 0.75rem;
    color: #64748b;
}

/* Theater/Cinema mode dim overlay */
#lights-off-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 0, 8, 0.95);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#lights-off-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Target Elements lifted above cinema overlay */
#shared-nav, .theater-section, #video-player, .player-container {
    position: relative;
}

body.lights-inactive #shared-nav,
body.lights-inactive .theater-section,
body.lights-inactive .player-container {
    z-index: auto;
}

body.lights-active #shared-nav {
    z-index: 1001; /* Stay above but maybe darkened or hidden */
}

body.lights-active .player-container {
    z-index: 1000;
    box-shadow: 0 0 60px rgba(236, 72, 153, 0.3);
    border-color: rgba(236, 72, 153, 0.6);
}

body.lights-active .watch-header,
body.lights-active .custom-link-container,
body.lights-active .sidebar-section,
body.lights-active .browse-section,
body.lights-active footer,
body.lights-active .background-orb {
    z-index: 1;
}

/* Media Query Tweaks for Phones */
@media (max-width: 640px) {
    .watch-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .region-selector-wrapper {
        width: 100%;
        justify-content: space-between;
    }
    
    .custom-link-container .input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .custom-link-container .input-icon {
        display: none;
    }
    
    .custom-link-container .input-tip {
        margin-left: 0;
    }
    
    .video-meta-top {
        flex-direction: column;
    }
    
    #lights-btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .player-info {
        padding: 1rem;
    }
}
