/* Netflix-Style IPTV Player CSS */

:root {
    --netflix-black: #141414;
    --netflix-dark: #000000;
    --netflix-red: #e50914;
    --netflix-gray: #808080;
    --netflix-light: #ffffff;
    --netflix-overlay: rgba(0, 0, 0, 0.7);
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Arial', sans-serif;
    background-color: var(--netflix-dark);
    color: var(--netflix-light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    padding: 1rem 2rem;
    transition: background var(--transition-speed);
}

.navbar.scrolled {
    background: var(--netflix-black);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1800px;
    margin: 0 auto;
    gap: 1rem;
}

.nav-logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--netflix-red), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.nav-center {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-container input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    color: var(--netflix-light);
    font-size: 0.9rem;
}

.search-container input:focus {
    outline: none;
    border-color: var(--netflix-red);
    background: rgba(255, 255, 255, 0.15);
}

.search-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--netflix-gray);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.playlist-selector select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--netflix-light);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.playlist-selector select:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-nav {
    background: var(--netflix-red);
    color: var(--netflix-light);
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-nav:hover {
    background: #ff0a16;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

/* Main Container */
.main-container {
    margin-top: 80px;
}

/* Video Section */
.video-section {
    position: relative;
    height: 70vh;
    min-height: 500px;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.8));
}

/* Content Section Updates */
.filters-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
}

.category-filters select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--netflix-light);
    padding: 0.6rem 1rem;
    border-radius: 4px;
    min-width: 200px;
}

/* Mobile adjustments for new layout */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
    }
    
    .nav-center {
        order: 3;
        margin: 1rem 0 0 0;
        max-width: 100%;
    }
    
    .search-container input {
        padding: 0.8rem 1rem 0.8rem 2.5rem;
    }
    
    .filters-header {
        justify-content: center;
    }
    
    .category-filters select {
        min-width: 150px;
    }
}

/* Channels Section */
.channels-section {
    margin-top: 1rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--netflix-light);
}

.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.2rem;
    padding: 1rem 0;
}

/* Simplified placeholder loading */
.loading-placeholder {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.2rem;
}

.placeholder-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    height: 200px;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.4; }
    to { opacity: 0.8; }
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

#video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    outline: none;
}

/* Channel Overlay */
.channel-overlay {
    position: absolute;
    bottom: 80px; /* Move above controls */
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    transform: translateY(100%);
    transition: transform var(--transition-speed);
    z-index: 10;
}

.video-wrapper:hover .channel-overlay {
    transform: translateY(0);
}

.channel-meta h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.channel-meta p {
    font-size: 1.2rem;
    color: var(--netflix-gray);
    margin-bottom: 1rem;
}

.channel-stats {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.channel-stats span {
    color: var(--netflix-light);
}

.separator {
    color: var(--netflix-gray);
}

#channel-resolution {
    background: var(--netflix-red);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
}

.spinner-netflix {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(229, 9, 20, 0.3);
    border-top: 4px solid var(--netflix-red);
    border-radius: 50%;
    animation: spin-netflix 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin-netflix {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Player Controls Overlay */
.player-controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-speed);
    z-index: 20;
}

.video-wrapper:hover .player-controls-overlay {
    opacity: 1;
}

/* Persistent controls on mobile */
@media (max-width: 768px) {
    .player-controls-overlay {
        opacity: 1;
        padding: 1rem;
    }
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--netflix-light);
    padding: 0.8rem 1.2rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.control-btn:hover {
    background: var(--netflix-red);
    border-color: var(--netflix-red);
    transform: scale(1.1);
}

.control-btn.main-play {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    padding: 0;
    justify-content: center;
}

.progress-container {
    flex: 1;
    max-width: 600px;
    margin: 0 2rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--netflix-red);
    width: 0%;
    transition: width 0.1s linear;
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 30px;
}

.volume-btn {
    background: none;
    border: none;
    color: var(--netflix-light);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color var(--transition-speed);
}

.volume-btn:hover {
    color: var(--netflix-red);
}

.volume-slider {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--netflix-light);
    cursor: pointer;
}

/* Categories Section */
.categories-section {
    padding: 3rem 2rem;
    background: var(--netflix-black);
}

.categories-container {
    max-width: 1800px;
    margin: 0 auto;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.category-header h2 {
    font-size: 2rem;
    font-weight: 600;
}

.search-container {
    position: relative;
    width: 300px;
}

.search-container input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    color: var(--netflix-light);
    font-size: 0.9rem;
}

.search-container input:focus {
    outline: none;
    border-color: var(--netflix-red);
}

.search-container i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--netflix-gray);
}

.category-filters select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--netflix-light);
    padding: 0.6rem 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

/* Channels Grid */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

/* Simplified channel card hover effect */
.channel-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease; /* Reduced animation time */
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
}

.channel-card:hover {
    transform: translateY(-5px); /* Simpler lift effect */
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--netflix-red);
}

.channel-thumbnail {
    position: relative;
    height: 160px;
    background: linear-gradient(45deg, #333, #555);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.channel-logo-img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.channel-placeholder {
    color: var(--netflix-gray);
    font-size: 3rem;
}

.channel-info {
    padding: 1rem;
}

.channel-name {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--netflix-gray);
}

.channel-group {
    background: rgba(229, 9, 20, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.channel-resolution-tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
}

.channel-card.active {
    border-color: var(--netflix-red);
    background: rgba(229, 9, 20, 0.1);
}

.channel-card.active::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    background: var(--netflix-red);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--netflix-red);
}

/* Loading Placeholders */
.loading-placeholder {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.placeholder-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    height: 220px;
    animation: pulse 1.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background: var(--netflix-black);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform var(--transition-speed);
    z-index: 1100;
    overflow-y: auto;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    font-size: 1.3rem;
    color: var(--netflix-red);
}

.close-btn {
    background: none;
    border: none;
    color: var(--netflix-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-speed);
}

.close-btn:hover {
    color: var(--netflix-red);
}

.sidebar-content {
    padding: 1.5rem;
}

.now-playing h4,
.quick-actions h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--netflix-gray);
}

.current-channel-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

#sidebar-channel-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.channel-details h5 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.channel-details p {
    font-size: 0.85rem;
    color: var(--netflix-gray);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 6px;
    color: var(--netflix-light);
    cursor: pointer;
    transition: all var(--transition-speed);
    text-align: left;
}

.action-btn:hover {
    background: rgba(229, 9, 20, 0.2);
    transform: translateX(5px);
}

/* Footer */
.main-footer {
    background: var(--netflix-dark);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-info h3 {
    font-size: 1.5rem;
    color: var(--netflix-red);
    margin-bottom: 0.5rem;
}

.developer-credits {
    text-align: right;
    color: var(--netflix-gray);
    font-size: 0.9rem;
}

.developer-credits i {
    color: var(--netflix-red);
}

/* Mobile Responsive Design */
@media (max-width: 1200px) {
    .channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1rem;
    }
    
    .control-buttons {
        gap: 0.5rem;
    }
    
    .control-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .search-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .filter-controls {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0.8rem 1rem;
    }
    
    .nav-logo h1 {
        font-size: 1.3rem;
    }
    
    .video-section {
        height: 50vh;
        min-height: 300px;
    }
    
    .channel-overlay {
        padding: 1rem;
        bottom: 70px;
    }
    
    .channel-meta h2 {
        font-size: 1.4rem;
    }
    
    .channel-meta p {
        font-size: 0.9rem;
    }
    
    .content-section {
        padding: 1rem;
    }
    
    .search-header {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }
    
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    
    .channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.8rem;
    }
    
    .channel-card {
        border-radius: 6px;
    }
    
    .channel-thumbnail {
        height: 120px;
    }
    
    .channel-info {
        padding: 0.8rem;
    }
    
    .channel-name {
        font-size: 0.9rem;
    }
    
    .sidebar {
        width: 280px;
    }
    
    .player-controls-overlay {
        flex-direction: column;
        gap: 0.8rem;
        padding: 0.8rem;
    }
    
    .progress-container {
        width: 100%;
        margin: 0;
    }
    
    .control-buttons {
        justify-content: center;
    }
    
    .volume-controls {
        justify-content: center;
        padding: 0.3rem 0.8rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .developer-credits {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.6rem;
    }
    
    .channel-thumbnail {
        height: 100px;
    }
    
    .channel-meta-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
    
    .channel-group {
        font-size: 0.7rem;
        padding: 0.1rem 0.4rem;
    }
    
    .channel-resolution-tag {
        font-size: 0.6rem;
        padding: 0.1rem 0.3rem;
    }
    
    .control-btn.main-play {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--netflix-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff0a16;
}