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

:root {
    --primary-color: #0d1117;
    --secondary-color: #161b22;
    --accent-color: #21262d;
    --highlight-color: #58a6ff;
    --text-color: #c9d1d9;
    --text-secondary: #8b949e;
    --card-bg: #161b22;
    --card-hover: #1c2128;
    --border-color: #30363d;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--secondary-color);
    padding: 15px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid var(--highlight-color);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
}

.header-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 50%;
    max-width: 50%;
    box-sizing: border-box;
}

header h1 {
    font-size: 1.6em;
    margin: 0;
    color: var(--highlight-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    white-space: nowrap;
    line-height: 1.2;
    font-weight: 700;
}


/* Navigation */
.categories-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.search-bar-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 5px;
}

.search-bar-inline input {
    padding: 8px 15px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-color);
    font-size: 0.9em;
    outline: none;
    transition: all 0.3s ease;
    width: 200px;
}

.search-bar-inline input:focus {
    border-color: var(--highlight-color);
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.3);
    width: 250px;
}

.search-bar-inline button {
    padding: 8px 15px;
    background: var(--highlight-color);
    border: none;
    border-radius: 20px;
    color: var(--text-color);
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-bar-inline button:hover {
    background: #ff6b9d;
    transform: scale(1.05);
}

.category-btn {
    background: var(--card-bg);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-btn:hover {
    background: var(--card-hover);
    border-color: var(--highlight-color);
    transform: translateY(-2px);
}

.category-btn.active {
    background: var(--highlight-color);
    border-color: var(--highlight-color);
    box-shadow: 0 4px 8px rgba(233, 69, 96, 0.3);
}

.category-btn,
a.category-btn {
    text-decoration: none;
    display: inline-block;
}

a.category-btn:hover {
    text-decoration: none;
}

/* Main Container */
.main-container {
    padding: 30px 20px;
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.welcome-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-hover) 100%);
    border-radius: 12px;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    max-width: 700px;
    width: 100%;
    transition: all 0.3s ease;
}

.welcome-card:hover {
    border-color: var(--highlight-color);
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.2);
}

.welcome-card i {
    font-size: 2.5em;
    color: var(--highlight-color);
    margin-bottom: 15px;
    display: block;
    opacity: 0.9;
}

.welcome-card h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 600;
}

.welcome-card p {
    font-size: 1em;
    color: var(--text-secondary);
    margin: 0;
}

/* Channels Section */
.channels-section {
    margin-top: 40px;
}

.channels-section h2 {
    font-size: 2em;
    margin-bottom: 25px;
    text-align: center;
    color: var(--highlight-color);
}

.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.channel-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.channel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(233, 69, 96, 0.1), transparent);
    transition: left 0.5s ease;
}

.channel-card:hover::before {
    left: 100%;
}

.channel-card:hover {
    transform: translateY(-5px);
    border-color: var(--highlight-color);
    box-shadow: 0 8px 16px rgba(233, 69, 96, 0.3);
    background: var(--card-hover);
}

.channel-card.active {
    border-color: var(--highlight-color);
    background: var(--card-hover);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
}

.channel-logo {
    margin-bottom: 10px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-logo-img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    border-radius: 8px;
}

.channel-logo-icon,
.channel-logo-fallback {
    font-size: 2.5em;
    color: var(--highlight-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
}

.channel-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--highlight-color);
    color: var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.channel-card:hover .channel-badge {
    opacity: 1;
}

.channel-category {
    font-size: 0.85em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.channel-card.hidden {
    display: none;
}

/* Footer */
footer {
    background: var(--secondary-color);
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
    border-top: 2px solid var(--border-color);
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.footer-links a:hover {
    color: var(--highlight-color);
    transform: translateY(-2px);
}

footer p a {
    color: var(--highlight-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

footer p a:hover {
    color: #ff6b9d;
    text-decoration: underline;
}

footer p {
    color: var(--text-secondary);
    margin: 5px 0;
}

.disclaimer {
    font-size: 0.9em;
    color: var(--text-secondary);
    opacity: 0.7;
}

.disclaimer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.disclaimer a:hover {
    color: var(--highlight-color);
    opacity: 1;
}

/* Legal Pages Styles */
.legal-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--border-color);
    max-width: 900px;
    margin: 0 auto;
}

.legal-content h1 {
    color: var(--highlight-color);
    margin-bottom: 30px;
}

.legal-content h2 {
    color: var(--text-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

.legal-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
}

.contact-content {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--border-color);
    max-width: 700px;
    margin: 0 auto;
}

.contact-content h1 {
    color: var(--highlight-color);
    margin-bottom: 30px;
}

.contact-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.contact-info {
    margin-top: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--accent-color);
    border-radius: 10px;
}

.contact-item i {
    font-size: 1.5em;
    color: var(--highlight-color);
    width: 30px;
}

.contact-item div {
    flex: 1;
}

.contact-item strong {
    color: var(--text-color);
    display: block;
    margin-bottom: 5px;
}

.contact-item span {
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-title {
        flex: 1 1 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }

    header h1 {
        font-size: 1.3em;
    }

    .subtitle {
        font-size: 0.8em;
    }

    .categories-nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .category-btn {
        font-size: 0.85em;
        padding: 8px 15px;
        white-space: nowrap;
    }

    .search-bar-inline {
        margin-left: 0;
        width: 100%;
        margin-top: 10px;
    }

    .search-bar-inline input {
        width: 100%;
        max-width: none;
    }

    .channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .channel-card {
        padding: 15px;
    }

    .channel-logo {
        font-size: 2.5em;
    }

    .legal-content,
    .contact-content {
        padding: 20px;
    }

    .welcome-card {
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    header {
        padding: 10px 0;
    }

    .header-title {
        align-items: center;
    }

    header h1 {
        font-size: 1.2em;
    }

    .subtitle {
        font-size: 0.75em;
    }

    .channels-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .channel-card {
        padding: 10px;
    }

    .search-bar-inline input {
        font-size: 0.85em;
        padding: 6px 12px;
    }

    .search-bar-inline button {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    .legal-content,
    .contact-content {
        padding: 15px;
    }

    .legal-content h1,
    .contact-content h1 {
        font-size: 1.5em;
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
        padding: 15px 10px;
    }
}

/* Watch page styles */
.watch-header-bar {
    margin: 30px 0 20px 0;
    text-align: center;
}

.channel-title-info h2 {
    margin: 0;
    color: var(--highlight-color);
    font-size: 2em;
    font-weight: 700;
}

.channel-title-info p {
    margin: 10px 0 0 0;
    color: var(--text-secondary);
    font-size: 1.1em;
    text-transform: capitalize;
}

.player-section {
    margin: 30px 0;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
}

/* Source selector buttons */
.source-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    padding: 10px;
    background-color: var(--accent-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.source-btn {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
    justify-content: center;
}

.source-btn:hover:not(:disabled) {
    background-color: var(--accent-color);
    border-color: var(--highlight-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(88, 166, 255, 0.2);
}

.source-btn.active {
    background-color: var(--highlight-color);
    color: var(--primary-color);
    border-color: var(--highlight-color);
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.source-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.source-btn i {
    font-size: 1em;
}

.tv-schedule {
    margin-top: 20px;
    padding: 20px;
    background: var(--accent-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.tv-schedule h3 {
    color: var(--highlight-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2em;
}

.schedule-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.schedule-loading p {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.schedule-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.schedule-item:last-child {
    border-bottom: none;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.schedule-time {
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.95em;
}

.schedule-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-now {
    background-color: #28a745;
    color: #fff;
}

.status-next {
    background-color: #dc3545;
    color: #fff;
}

.status-later {
    background-color: var(--border-color);
    color: var(--text-secondary);
}

.schedule-title {
    color: var(--text-color);
    font-size: 1.1em;
    font-weight: 600;
    margin: 8px 0;
}

.schedule-description {
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.6;
    margin: 8px 0 0 0;
}

.schedule-progress {
    margin-top: 12px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--highlight-color) 0%, #7ab8ff 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.schedule-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.schedule-link,
.tv-guide-link {
    color: var(--highlight-color);
    text-decoration: none;
    font-size: 0.95em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.schedule-link:hover,
.tv-guide-link:hover {
    color: #7ab8ff;
    text-decoration: underline;
}

.schedule-link i {
    font-size: 0.85em;
}

.schedule-error {
    color: var(--text-secondary);
    padding: 20px;
    text-align: center;
}

.schedule-error p {
    margin: 10px 0;
    color: var(--text-secondary);
}

.schedule-error .schedule-link {
    margin-top: 10px;
    display: inline-flex;
}

#videoPlayer {
    width: 100%;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

#videoPlayer iframe,
#videoPlayer embed,
#videoPlayer video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

#videoPlayer .placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    flex-direction: column;
    gap: 15px;
}

#videoPlayer .placeholder i {
    font-size: 4em;
    color: var(--text-secondary);
}

#videoPlayer .placeholder p {
    font-size: 1.2em;
    color: var(--text-secondary);
    text-align: center;
}

#videoPlayer .loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Partners Section */
.partners-section {
    background: var(--secondary-color);
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.partners-section h2 {
    text-align: center;
    color: var(--text-color);
    font-size: 1.5em;
    margin-bottom: 30px;
    font-weight: 600;
}

.partners-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.partner-link {
    width: 100%;
    max-width: 600px;
    display: block;
    margin: 0 auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
    text-decoration: none;
}

.partner-link:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.partner-logo {
    width: 100%;
    max-width: 600px;
    height: auto;
    object-fit: contain;
    filter: brightness(0.9);
    transition: filter 0.3s ease;
    display: block;
}

.partner-link:hover .partner-logo {
    filter: brightness(1.1);
}

/* Similar Channels Section */
.similar-channels-section {
    background: var(--secondary-color);
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.similar-channels-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 20px;
    max-width: 100%;
    margin: 0 auto;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--highlight-color) var(--border-color);
}

.similar-channels-grid::-webkit-scrollbar {
    height: 8px;
}

.similar-channels-grid::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}

.similar-channels-grid::-webkit-scrollbar-thumb {
    background: var(--highlight-color);
    border-radius: 4px;
}

.similar-channels-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.similar-channels-grid .channel-card {
    flex: 0 0 auto;
    min-width: 150px;
    max-width: 150px;
}

.similar-channel-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.similar-channel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Mobile: Keep grid layout for similar channels */
@media (max-width: 768px) {
    .similar-channels-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        flex-wrap: wrap;
        overflow-x: visible;
    }
    
    .similar-channels-grid .channel-card {
        min-width: unset;
        max-width: unset;
    }
}

