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

body,
html {
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

#player-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.live-status {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: #ff0000;
    border-radius: 50%;
    margin-right: 10px;
    animation: pulse 1.5s infinite;
}

/* Channel Toggle Button */
.channel-toggle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    /* Desktop: Top Right */
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    pointer-events: auto;
    transition: background 0.3s;
    z-index: 20;
}

.channel-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Channel Panel (Sidebar) */
.channel-panel {
    position: absolute;
    top: 0;
    right: -300px;
    /* Hidden off-screen */
    width: 300px;
    height: calc(100% - 40px);
    /* Leave space for bottom marquee */
    background: rgba(0, 0, 0, 0.95);
    z-index: 30;
    /* Above player, below marquee */
    padding: 20px;
    transition: right 0.3s ease;
    border-left: 1px solid #333;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.channel-panel.open {
    right: 0;
}

.panel-header {
    margin-bottom: 5px;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    position: sticky;
    top: -20px;
    /* Offset for panel padding */
    background: rgba(0, 0, 0, 0.95);
    z-index: 40;
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.1);
}

.category-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
    /* Hide scrollbar Hide on Firefox */
}

.category-filters::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for Chrome/Safari */
}

.category-pill {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-pill:hover {
    background: rgba(255, 255, 255, 0.2);
}

.category-pill.active {
    background: #00ff00;
    color: #000;
    border-color: #00ff00;
}

.channel-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #222;
    cursor: pointer;
    transition: background 0.2s;
}

.channel-item:hover {
    background: #222;
}

.channel-item.active {
    background: #1a4d1a;
    /* Dark green for active */
    border-left: 4px solid #00ff00;
}

.channel-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 15px;
    background: white;
    padding: 2px;
    border-radius: 4px;
}

.channel-name {
    font-size: 14px;
    font-weight: 500;
}

.channel-items {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Bottom Controls */
.donation-btn-container {
    position: absolute;
    bottom: 60px;
    left: 20px;
    pointer-events: auto;
}

.donate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 12px 25px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.idonate-btn {
    background: linear-gradient(135deg, #ff8c00 0%, #ff4500 100%);
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: btn-shake 4s infinite;
}

.idonate-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 69, 0, 0.6);
    filter: brightness(1.1);
}

.donate-btn-alt {
    display: block;
    margin-top: 10px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.3s;
}

.donate-btn-alt:hover {
    color: #fff;
}

.btn-icon {
    margin-right: 8px;
    font-size: 20px;
}

@keyframes btn-shake {

    0%,
    90%,
    100% {
        transform: rotate(0);
    }

    92% {
        transform: rotate(2deg);
    }

    94% {
        transform: rotate(-2deg);
    }

    96% {
        transform: rotate(2deg);
    }

    98% {
        transform: rotate(-2deg);
    }
}

.telegram-link-container {
    position: absolute;
    bottom: 60px;
    right: 20px;
    pointer-events: auto;
}

.telegram-btn {
    display: flex;
    align-items: center;
    background: rgba(0, 136, 204, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    transition: background 0.3s;
    white-space: nowrap;
}

.telegram-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    fill: currentColor;
}

.marquee-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 0;
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    /* Ensure marquee is always on top of sidebar */
}

.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 20s linear infinite;
    font-weight: 600;
    font-size: 16px;
    color: #ffcc00;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

@keyframes marquee {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-100%, 0);
    }
}

/* Mobile Responsiveness */
/* Mobile Responsiveness */
@media (max-width: 768px) {

    /* Full screen channel list on mobile */
    .channel-panel {
        width: 100%;
        right: -100%;
        /* Fully hidden */
        border-left: none;
    }

    .channel-panel.open {
        right: 0;
    }

    /* Larger touch targets for channels */
    .channel-item {
        padding: 15px 10px;
    }

    .channel-logo {
        width: 50px;
        height: 50px;
    }

    .channel-name {
        font-size: 16px;
    }

    /* Adjust Header controls */
    .live-status {
        top: 10px;
        left: 10px;
        padding: 5px 10px;
        font-size: 12px;
        z-index: 25;
        /* Ensure above video controls if any */
    }

    .channel-toggle-btn {
        top: 10px;
        /* Align with status */
        right: 10px;
        padding: 8px 14px;
        /* Larger touch area */
        font-size: 14px;
        z-index: 25;
    }

    /* Filter & Search */
    .search-input {
        font-size: 16px;
        /* Prevent IOS zoom */
        padding: 12px;
    }

    .category-pill {
        padding: 8px 16px;
        font-size: 14px;
    }

    /* Bottom Controls - Compact */
    .donation-btn-container {
        bottom: 50px;
        /* Above marquee */
        left: 10px;
        transform: scale(0.85);
        /* Slightly smaller */
        transform-origin: bottom left;
        z-index: 20;
    }

    .telegram-link-container {
        bottom: 50px;
        right: 10px;
        transform: scale(0.85);
        transform-origin: bottom right;
        z-index: 20;
    }

    /* Ensure marquee doesn't block clicks */
    .marquee-container {
        pointer-events: none;
        padding: 5px 0;
    }

    .marquee-content {
        font-size: 14px;
    }

    /* Modal Adjustments */
    .modal-content {
        width: 90%;
        margin: 20% auto;
    }
}

/* Very Small Screens (iPhone SE etc) */
@media (max-width: 380px) {
    .live-status span {
        display: none;
        /* Hide text, keep dot */
    }

    .channel-toggle-btn {
        font-size: 0;
        /* Hide text */
    }

    .channel-toggle-btn::after {
        content: '📺';
        /* Show icon only */
        font-size: 20px;
    }

    .telegram-btn {
        padding: 8px;
        font-size: 0;
        /* Hide text */
    }

    .telegram-icon {
        margin-right: 0;
        width: 24px;
        height: 24px;
    }
}