/* Global Styles */
:root {
    --primary-color: #e50914;
    --secondary-color: #b81d24;
    --dark-color: #141414;
    --light-color: #f4f4f4;
    --gray-color: #757575;
    --dark-gray: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #000;
    color: #fff;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--light-color);
}

img {
    width: 100%;
    height: auto;
}

/* Header Styles */
.main-header {
    background-color: rgba(0, 0, 0, 0.9);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--dark-gray);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    width: auto;
}

.site-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.search-container {
    display: flex;
    align-items: center;
    width: 40%;
}

#searchInput {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 4px 0 0 4px;
    background-color: var(--dark-gray);
    color: white;
    font-size: 1rem;
}

#searchBtn {
    padding: 0.8rem 1.2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#searchBtn:hover {
    background-color: var(--secondary-color);
}

/* Main Content Styles */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.category-card {
    background-color: var(--dark-gray);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    text-align: center;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.category-img {
    height: 100px;
    background-color: var(--gray-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-img i {
    font-size: 3rem;
    color: var(--light-color);
}

.category-name {
    padding: 1rem;
    font-weight: 600;
}

/* Streams Grid */
.streams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stream-card {
    background-color: var(--dark-gray);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
}

.stream-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.stream-img {
    height: 140px;
    background-color: var(--gray-color);
    position: relative;
    overflow: hidden;
}

.stream-img img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.live-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.views-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.stream-info {
    padding: 1rem;
}

.stream-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stream-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--gray-color);
}

/* Category Page Styles */
.category-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--dark-gray);
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    background: none;
    border: none;
    color: var(--gray-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.search-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-filters select, .search-filters button {
    padding: 0.8rem 1rem;
    border-radius: 4px;
    border: none;
    background-color: var(--dark-gray);
    color: white;
    font-size: 1rem;
}

.search-filters button {
    background-color: var(--primary-color);
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-filters button:hover {
    background-color: var(--secondary-color);
}

/* Watch Page Styles */
.watch-content {
    max-width: 1000px;
}

.stream-header {
    margin-bottom: 2rem;
    text-align: center;
}

.stream-header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.countdown {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

.stream-sources {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.source-btn {
    padding: 1rem;
    background-color: var(--dark-gray);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s;
}

.source-btn:hover {
    background-color: var(--primary-color);
}

/* Player Page Styles */
.player-content {
    max-width: 1000px;
}

.player-content h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.player-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Footer Styles */
.main-footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--dark-gray);
    margin-top: 2rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .search-container {
        width: 100%;
    }

    .categories-grid, .streams-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .category-img {
        height: 80px;
    }

    .stream-img {
        height: 100px;
    }

    .tab-btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 1rem;
    }

    .main-content {
        padding: 0 1rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .search-filters {
        flex-direction: column;
    }

    .search-filters select, .search-filters button {
        width: 100%;
    }
}

/* Live TV Section Styles */
.live-tv-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--primary-color);
}

.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.channel-card {
    background-color: var(--dark-gray);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.channel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.channel-img {
    height: 100px;
    background-color: var(--gray-color);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-img img {
    height: 80%;
    width: auto;
    object-fit: contain;
}

.live-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.channel-info {
    padding: 1rem;
}

.channel-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.95rem;
}

.channel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--gray-color);
}

.channel-country, .channel-category {
    background-color: rgba(117, 117, 117, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: var(--gray-color);
}

.loading-spinner i {
    font-size: 2rem;
    color: var(--primary-color);
}

/* Error and No Results Messages */
.error-message, .no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    grid-column: 1 / -1;
    text-align: center;
    color: var(--gray-color);
}

.error-message i {
    font-size: 2rem;
    color: var(--primary-color);
}

.no-results i {
    font-size: 2rem;
    color: var(--gray-color);
}

/* Filters */
.tv-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tv-filters select, .tv-filters button {
    padding: 0.8rem 1rem;
    border-radius: 4px;
    border: none;
    background-color: var(--dark-gray);
    color: white;
    font-size: 1rem;
    min-width: 150px;
}

.tv-filters button {
    background-color: var(--primary-color);
    cursor: pointer;
    transition: background-color 0.3s;
}

.tv-filters button:hover {
    background-color: var(--secondary-color);
}

/* Responsive Styles for Live TV */
@media (max-width: 768px) {
    .channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .channel-img {
        height: 80px;
    }
}

@media (max-width: 480px) {
    .channels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tv-filters {
        flex-direction: column;
    }
    
    .tv-filters select, .tv-filters button {
        width: 100%;
    }
}