/**
 * Theme Name: IPTV Streaming Hub
 * Theme URI: https://github.com/iptv-org/iptv
 * Author: IPTV Org
 * Author URI: https://github.com/iptv-org
 * Description: Netflix-like IPTV streaming platform with auto-updating playlists
 * Version: 1.0.0
 * License: MIT
 * License URI: https://github.com/iptv-org/iptv/blob/master/LICENSE
 * Text Domain: iptv-streaming-hub
 * Domain Path: /languages
 * Requires at least: 5.8
 * Requires PHP: 7.4
 */

:root {
    --primary: #e50914;
    --primary-dark: #b20710;
    --secondary: #221f1f;
    --bg-dark: #141414;
    --bg-darker: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #808080;
    --accent: #f5a623;
    --border-color: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Header & Navigation ===== */
.iptv-header {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 1.5rem 0;
    backdrop-filter: blur(4px);
}

.iptv-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.iptv-logo {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-decoration: none;
}

a.iptv-logo:hover {
    opacity: 0.9;
}

.iptv-logo-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.iptv-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.iptv-nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.iptv-nav-link:hover::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* Search Wrapper */
.iptv-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.iptv-search-box {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    color: var(--text-primary);
    width: 280px;
    transition: all 0.3s ease;
}

.iptv-search-box:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.3);
}

.iptv-search-box::placeholder {
    color: var(--text-secondary);
}

/* ===== Hero Section ===== */
.iptv-hero {
    height: 80vh;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--secondary) 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.iptv-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 50%, rgba(229, 9, 20, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(245, 166, 35, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.iptv-hero-content {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    margin-bottom: 3rem;
}

.iptv-hero-featured {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.iptv-featured-info h1 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.iptv-featured-info p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
    line-height: 1.7;
}

.iptv-featured-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.iptv-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
}

.iptv-meta-item strong {
    color: var(--primary);
}

.iptv-hero-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.iptv-btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.iptv-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--text-primary);
    box-shadow: 0 5px 20px rgba(229, 9, 20, 0.4);
}

.iptv-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(229, 9, 20, 0.6);
}

.iptv-btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
}

.iptv-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.iptv-btn-small {
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
}

.iptv-featured-image {
    position: relative;
    height: 500px;
}

.iptv-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

/* Hero Placeholder (when no logo) */
.iptv-hero-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    text-align: center;
    padding: 2rem;
}

.iptv-hero-initial {
    font-size: 6rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    line-height: 1;
    margin-bottom: 1rem;
}

.iptv-hero-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ===== Main Content ===== */
.iptv-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== Section ===== */
.iptv-section {
    margin-bottom: 4rem;
}

.iptv-section-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 1rem;
}

.iptv-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 2px;
}

.iptv-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

/* Country Filter Section */
.iptv-country-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.iptv-country-filters .iptv-filter-btn {
    font-size: 0.9rem;
}

.iptv-country-filters .iptv-filter-btn .count {
    opacity: 0.7;
    font-size: 0.8rem;
}

.iptv-filter-btn {
    padding: 0.75rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.iptv-filter-btn:hover,
.iptv-filter-btn.active {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 5px 20px rgba(229, 9, 20, 0.3);
}

/* ===== Channel Grid ===== */
.iptv-channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.iptv-channel-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.iptv-channel-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--secondary);
}

.iptv-channel-card:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(229, 9, 20, 0.4);
    z-index: 10;
}

.iptv-channel-image {
    width: 100%;
    height: 200px;
    background-color: var(--bg-darker);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.iptv-channel-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    background-color: var(--bg-darker);
}

.iptv-channel-placeholder {
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.iptv-channel-initial {
    font-size: 2.5rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.iptv-channel-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--bg-darker);
}

.iptv-channel-info {
    padding: 1rem;
    background-color: var(--secondary);
}

.iptv-channel-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
}

.iptv-channel-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    gap: 0.5rem;
}

.iptv-channel-category {
    background: rgba(229, 9, 20, 0.2);
    color: var(--primary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.iptv-channel-views {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.iptv-channel-views .star {
    font-size: 0.7rem;
}

.iptv-channel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    text-align: center;
}

.iptv-channel-overlay-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.iptv-channel-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.iptv-play-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.iptv-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(229, 9, 20, 0.5);
}

/* ===== Carousel ===== */
.iptv-carousel {
    position: relative;
    margin-bottom: 2rem;
}

.iptv-carousel-container {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0 0 1rem 0;
}

.iptv-carousel-container::-webkit-scrollbar {
    height: 6px;
}

.iptv-carousel-container::-webkit-scrollbar-track {
    background: var(--secondary);
    border-radius: 10px;
}

.iptv-carousel-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.iptv-carousel-item {
    flex: 0 0 220px;
    height: 310px;
}

.iptv-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: var(--text-primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 10;
    transition: all 0.3s ease;
}

.iptv-carousel-btn:hover {
    background: var(--primary);
    box-shadow: 0 5px 20px rgba(229, 9, 20, 0.4);
}

.iptv-carousel-prev {
    left: 0;
}

.iptv-carousel-next {
    right: 0;
}

/* ===== Slider ===== */
.iptv-slider {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.iptv-slider-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(320px, 1fr);
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0 0 1rem 0;
}

.iptv-slider-track::-webkit-scrollbar {
    height: 6px;
}

.iptv-slider-track::-webkit-scrollbar-track {
    background: var(--secondary);
    border-radius: 10px;
}

.iptv-slider-track::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.iptv-slider-item {
    background: var(--secondary);
    border-radius: 12px;
    overflow: hidden;
    min-height: 240px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.25rem;
    align-items: stretch;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
}

.iptv-slider-media {
    background: linear-gradient(135deg, var(--bg-darker), var(--secondary));
    background-size: cover;
    background-position: center;
    min-height: 220px;
}

.iptv-slider-body {
    padding: 1.5rem 1.5rem 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.iptv-slider-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.iptv-slider-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.iptv-slider-btn {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: var(--text-primary);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.iptv-slider-btn:hover {
    background: var(--primary);
    box-shadow: 0 5px 20px rgba(229, 9, 20, 0.4);
}

/* ===== Footer ===== */
.iptv-footer {
    background-color: var(--secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    margin-top: 2rem;
    text-align: center;
}

.iptv-footer-copyright {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .iptv-hero-featured {
        grid-template-columns: 1fr;
    }

    .iptv-featured-info h1 {
        font-size: 2.5rem;
    }

    .iptv-channel-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .iptv-nav {
        gap: 1rem;
    }

    .iptv-search-box {
        width: 150px;
    }
}

@media (max-width: 768px) {
    .iptv-logo {
        font-size: 1.5rem;
    }

    .iptv-nav-link {
        font-size: 0.9rem;
    }

    .iptv-search-box {
        display: none;
    }

    .iptv-hero {
        height: 60vh;
    }

    .iptv-featured-info h1 {
        font-size: 1.8rem;
    }

    .iptv-featured-info p {
        font-size: 1rem;
    }

    .iptv-hero-buttons {
        flex-direction: column;
    }

    .iptv-channel-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .iptv-section-title {
        font-size: 1.5rem;
    }

    .iptv-slider-item {
        grid-template-columns: 1fr;
    }

    .iptv-slider-body {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .iptv-header-content {
        padding: 0 1rem;
    }

    .iptv-hero-content {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .iptv-featured-info h1 {
        font-size: 1.3rem;
    }

    .iptv-featured-info p {
        font-size: 0.9rem;
    }

    .iptv-hero-buttons {
        gap: 0.75rem;
    }

    .iptv-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.85rem;
    }

    .iptv-channel-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .iptv-section-title {
        font-size: 1.2rem;
    }

    .iptv-main {
        padding: 1rem;
    }

    .iptv-slider-track {
        grid-auto-columns: minmax(260px, 1fr);
    }
}

/* ===== Loading & Animation ===== */
.iptv-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
}

.iptv-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(229, 9, 20, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: iptv-spin 1s linear infinite;
}

@keyframes iptv-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Syncing/Loading States ===== */
.iptv-syncing-hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.iptv-sync-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--accent);
}

.iptv-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(229, 9, 20, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: iptv-spin 1s linear infinite;
}

.iptv-loading-spinner.large {
    width: 60px;
    height: 60px;
    border-width: 4px;
    margin-bottom: 1rem;
}

@keyframes iptv-spin {
    to {
        transform: rotate(360deg);
    }
}

.iptv-placeholder-hero {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    width: 100%;
    height: 400px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.iptv-placeholder-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.iptv-placeholder-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.iptv-placeholder-section {
    position: relative;
}

.iptv-blurred {
    filter: blur(8px);
    opacity: 0.5;
    pointer-events: none;
}

.iptv-placeholder-card {
    background: #2a2a2a;
    animation: iptv-pulse 2s ease-in-out infinite;
}

.iptv-placeholder-card .iptv-channel-image {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
}

.iptv-placeholder-card .iptv-slider-media {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
}

.iptv-placeholder-title {
    height: 16px;
    width: 80%;
    background: #3a3a3a;
    border-radius: 4px;
    margin-bottom: 8px;
}

.iptv-placeholder-meta {
    height: 12px;
    width: 50%;
    background: #3a3a3a;
    border-radius: 4px;
}

@keyframes iptv-pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }
}

/* ===== Utility Classes ===== */
.iptv-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.iptv-hidden {
    display: none !important;
}

.iptv-no-scroll {
    overflow: hidden;
}

.iptv-text-center {
    text-align: center;
}

.iptv-gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.iptv-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 2rem 0;
}