/* 
 * File: /pages/includes/youtube_playlist/styles.css
 * Description: CSS styles for YouTube playlist player with responsive design and dark theme
 * Version: 2025.07.11.14.30.00
 */

/* Variables */
:root {
    --bg-color: rgba(18, 18, 18, 0.2);
    --text-color: #ffffff;
    --hover-color: rgba(255, 255, 255, 0.1);
    --player-height: 400px;
    --accent-color: #ff0000;
    --border-radius: 8px;
    --transition-speed: 0.2s;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Container and Layout */
.youtube_container {
    max-width: 1024px;
    margin: 0 auto;
    height: 100vh;
    overflow-y: auto;
    scroll-padding-top: var(--player-height);
    padding: 0 20px;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
}

.main-player {
    position: sticky;
    top: 0;
    width: 100%;
    background: var(--bg-color);
    z-index: 100;
    padding: 0px 0;
    height: auto;
    backdrop-filter: blur(10px);
    border-bottom: 0px solid rgba(255, 255, 255, 0.1);
border-radius:10px!important;
box-shadow:-20px 20px 20px rgba(0,0,0,.5) 
}

.content-wrapper {
    padding-top: 20px;
}

/* Video Description */
.video-description {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 0px 0;
    border: 0px solid rgba(255, 255, 255, 0.1);
}

/* Playlist Grid */
#playlist-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding-right: 10px;
    margin-bottom: 40px;
}

/* Loading State */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #aaa;
}

/* Error State */
.error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* Playlist Items */
.playlist-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.playlist-item:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.playlist-item:active {
    transform: translateY(0);
}

.thumbnail-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
}

.playlist-item:hover .thumbnail {
    transform: scale(1.05);
}

/* Video Info */
.video-info {
    padding: 15px;
}

.video-title {
    font-size: 16px;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2em;
    text-align: left;
    font-weight: 600;
}

.video-meta {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 10px;
    text-align: left;
}

#current-title {
    font-size: 24px;
    text-align: left;
    margin-bottom: 15px;
    font-weight: 700;
}

#current-desc {
    font-size: 14px;
    color: #fff;
    line-height: 1.5;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.9;
}

.video-desc {
    font-size: 12px;
    color: #999;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: left;
    opacity: 0.8;
}

/* Scrollbar Styling */
.youtube_container::-webkit-scrollbar {
    width: 8px;
}

.youtube_container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.youtube_container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.youtube_container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* IFrame */
iframe {
    border: none;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--border-radius);
}

/* Media Queries */

/* Mobile - Extra Small Devices */
@media screen and (max-width: 576px) {
    .youtube_container {
        padding: 0 10px;
    }

    #playlist-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .video-info {
        padding: 10px;
    }

    .video-title {
        font-size: 14px;
        -webkit-line-clamp: 3;
    }

    .video-desc {
        font-size: 11px;
        -webkit-line-clamp: 2;
    }

    .video-meta {
        display: none;
    }

    #current-title {
        font-size: 18px;
    }

    :root {
        --player-height: 250px;
    }
}

/* Tablet - Small Devices */
@media screen and (min-width: 577px) and (max-width: 768px) {
    #playlist-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    #current-title {
        font-size: 20px;
    }

    :root {
        --player-height: 300px;
    }
}

/* Laptop - Medium Devices */
@media screen and (min-width: 769px) and (max-width: 992px) {
    #playlist-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .video-desc {
        -webkit-line-clamp: 2;
    }
}

/* Desktop - Large Devices */
@media screen and (min-width: 993px) and (max-width: 1200px) {
    .youtube_container {
        max-width: 960px;
    }
}

/* Extra Large Devices */
@media screen and (min-width: 1201px) {
    .youtube_container {
        max-width: 1140px;
    }
}

/* Accessibility Features */
@media (prefers-reduced-motion: reduce) {
    .playlist-item {
        transition: none;
    }
    
    .thumbnail {
        transition: none;
    }
    
    .playlist-item:hover .thumbnail {
        transform: none;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: rgba(18, 18, 18, 0.95);
        --text-color: #ffffff;
        --hover-color: rgba(255, 255, 255, 0.1);
    }
}

@media (forced-colors: active) {
    .playlist-item {
        border: 2px solid currentColor;
    }
}

/* Focus states for keyboard navigation */
.playlist-item:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .main-player {
        position: relative;
    }

    body {
        background: white;
        color: black;
    }

    #playlist-grid {
        display: block;
    }

    .playlist-item {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
}