/* Base Styles */
:root {
    --primary: #3b82f6;
    --primary-foreground: #ffffff;
    --background: #f5f5f5;
    --foreground: #171717;
    --card: #ffffff;
    --card-foreground: #171717;
    --border: #e5e5e5;
    --input: #e5e5e5;
    --ring: #3b82f6;
    --radius: 0.5rem;
    --muted: #f3f4f6;
    --muted-foreground: #6b7280;
    --accent: #f3f4f6;
    --accent-foreground: #111827;
    --destructive: #ef4444;
    --destructive-foreground: #ffffff;
    --popover: #ffffff;
    --popover-foreground: #171717;
    --secondary: #f3f4f6;
    --secondary-foreground: #111827;
}

.dark {
    --background: #171717;
    --foreground: #ffffff;
    --card: #1f1f1f;
    --card-foreground: #ffffff;
    --border: #333333;
    --input: #333333;
    --muted: #2d2d2d;
    --muted-foreground: #a1a1aa;
    --accent: #2d2d2d;
    --accent-foreground: #ffffff;
    --popover: #1f1f1f;
    --popover-foreground: #ffffff;
    --secondary: #2d2d2d;
    --secondary-foreground: #ffffff;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hidden {
    display: none !important;
}

/* Mobile Navbar */
.mobile-navbar {
    background-color: var(--card);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.menu-button, .theme-button, .back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.375rem;
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: color 0.2s;
}

.menu-button:hover, .theme-button:hover, .back-button:hover {
    color: var(--foreground);
}

.logo-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.icon {
    width: 24px;
    height: 24px;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    inset: 0;
    background-color: var(--card);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.active {
    transform: translateX(0);
}

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

.menu-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.close-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.375rem;
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: color 0.2s;
}

.close-button:hover {
    color: var(--foreground);
}

.menu-list {
    list-style: none;
}

.menu-item {
    margin-bottom: 1rem;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--foreground);
    transition: background-color 0.2s;
}

.menu-link:hover {
    background-color: var(--muted);
}

.menu-link .icon {
    margin-right: 0.75rem;
    color: var(--primary);
}

/* Main Content */
.main-content {
    padding: 1.5rem 0;
}

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

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
}

.search-container {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
}

.search-input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background-color: var(--card);
    color: var(--foreground);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Categories */
.categories-section {
    margin-bottom: 1.5rem;
}

.categories-scroll {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.categories-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.category-button {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid var(--border);
    background-color: var(--card);
    color: var(--muted-foreground);
    margin-right: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.category-button.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

/* Channel Grid */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .channel-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .channel-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .channel-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.channel-card {
    position: relative;
    background-color: var(--card);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.channel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.channel-card.active {
    box-shadow: 0 0 0 2px var(--primary);
}

.channel-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.channel-logo-container {
    width: 4rem;
    height: 4rem;
    margin-bottom: 0.75rem;
    position: relative;
}

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

.channel-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
}

.channel-category {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 0.25rem;
}

.channel-overlay {
    position: absolute;
    inset: 0;
    border: 1px solid #3b82f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

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

.channel-card.active .channel-overlay {
    opacity: 1;
}

.play-button {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-radius: 9999px;
    padding: 0.75rem;
    border: none;
    cursor: pointer;
    transform: scale(1);
    transition: transform 0.2s;
}

.play-button:hover {
    transform: scale(1.1);
}

/* Channel Player Page */
.player-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.notification-alert {
    background-color: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 0.5rem 0rem 0.1rem 0rem;
    position: relative;
    top: 0;
    z-index: 40;
}

.dark .notification-alert {
    background-color: rgba(146, 64, 14, 0.3);
    border-left: 4px solid #d97706;
}

.notification-content {
    display: flex;
    align-items: flex-start;
}

.notification-icon {
    flex-shrink: 0;
    color: #f59e0b;
}

.notification-message {
    margin-left: 0.75rem;
    flex: 1;
    font-size: 0.875rem;
    color: #92400e;
}

.dark .notification-message {
    color: #fbbf24;
}

.notification-close {
    margin-left: auto;
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #f59e0b;
    cursor: pointer;
}

.notification-close:hover {
    color: #d97706;
}

.channel-info {
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
}

.channel-logo {
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.channel-logo img {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    border-radius: 0.375rem;
    background-color: var(--card);
    padding: 0.25rem;
    border: 1px solid var(--border);
}

.channel-details {
    flex: 1;
}

.channel-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--foreground);
}

.channel-show {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.player-layout {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .player-layout {
        flex-direction: row;
        gap: 1.5rem;
        margin-top: 1rem;
    }
    
    .player-main {
        width: 66.666667%;
    }
    
    .player-sidebar {
        width: 33.333333%;
    }
    
    .notification-alert .container {
        display: flex;
        justify-content: center;
    }
    
    .notification-content {
        max-width: 768px;
    }
}

.video-container {
    position: relative;
    width: 100%;
    background-color: #000;
    aspect-ratio: 16/9;
}

.video-player {
    width: 100%;
    height: 100%;
}

.server-selector-container {
    padding: 0.75rem 0;
}

.server-selector {
    background-color: var(--card);
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.server-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}

.server-options {
    display: flex;
    gap: 0.5rem;
}

.server-button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    background-color: var(--muted);
    color: var(--muted-foreground);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.server-button.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

/* Ad Banner - Updated for better visibility */
.ad-banner {
    width: 100%;
    background-color: var(--muted);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    min-height: 2rem;
}

.ad-label {
    padding: 0.5rem;
    background-color: var(--accent);
    font-size: 0.75rem;
    text-align: center;
    color: var(--muted-foreground);
    border-bottom: 1px solid var(--border);
}

.ad-content {
    height: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right, var(--muted), var(--accent));
}

.ad-content p {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Make sure the ad banner is visible on mobile */
@media (max-width: 767px) {
    .ad-banner {
        margin: 1rem 0;
    }
}

.channel-description {
    padding: 0.75rem 0;
}

.description-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.description-text {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.related-channels {
    padding: 0.75rem 0;
}

.related-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.related-grid {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .related-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        overflow-x: visible;
    }
}

.related-channel {
    flex-shrink: 0;
    width: 6rem;
}

@media (min-width: 768px) {
    .related-channel {
        width: 100%;
    }
}

.related-channel-card {
    background-color: var(--card);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.related-channel-img {
    width: 100%;
    height: 4rem;
    object-fit: cover;
}

.related-channel-name {
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}