/* Live TV Section */
#live-tv-section {
    display: flex;
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 40;
}

#live-tv-section .sidebar {
    width: 280px;
    background: var(--card-bg);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    height: 100%;
    z-index: 10;
    transform: translateX(0);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.06);
    border-radius: 0 16px 16px 0;
}

body.dark #live-tv-section .sidebar {
    background: rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

#live-tv-section .sidebar.collapsed {
    transform: translateX(-280px);
}

@media (max-width: 768px) {
    #live-tv-section .sidebar {
        width: 100%;
        max-width: 300px;
        transform: translateX(-100%);
        border-radius: 0;
    }
    #live-tv-section .sidebar.active {
        transform: translateX(0);
    }
}

#live-tv-section .sidebar-header {
    max-height: 80px;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex: 0 0 auto;
    background: var(--card-bg);
    text-align: center;
    border-radius: 0 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark #live-tv-section .sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--dark-card);
}

#live-tv-section .logo {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.1));
}

body.dark #live-tv-section .logo {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

#live-tv-section .sidebar-content {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
}

#live-tv-section .sidebar-section {
    margin-bottom: 24px;
    flex: 0 0 auto;
}

#live-tv-section .sidebar-section.channels {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#live-tv-section .sidebar-section.status {
    margin-top: auto;
}

#live-tv-section .url-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

#live-tv-section .url-input-group input[type="text"] {
    flex: 1;
    margin-bottom: 16px;
}

#live-tv-section .url-input-group button {
    width: 48px;
    height: 48px;
    padding: 0;
    margin-bottom: 16px;
}

#live-tv-section input[type="text"],
#live-tv-section input[type="file"] {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 2px solid var(--primary);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}

body.dark #live-tv-section input[type="text"],
body.dark #live-tv-section input[type="file"] {
    border: 2px solid var(--primary);
    background: var(--dark-card);
    color: var(--dark-text);
}

#live-tv-section input[type="text"]:focus,
#live-tv-section input[type="file"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.25);
    transform: scale(1.01);
    outline: none;
}

#live-tv-section input[type="text"]::placeholder {
    color: #999;
}

body.dark #live-tv-section input[type="text"]::placeholder {
    color: #a0a0a0;
}

#live-tv-section button {
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.3s, background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#live-tv-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 86, 179, 0.3);
    background: #1557b0;
}

#live-tv-section button i {
    font-size: 1.2rem;
}

#live-tv-section .playlist-controls {
    display: flex;
    gap: 10px;
}

#live-tv-section .playlist-controls button {
    width: 33.33%;
    margin-bottom: 0;
    padding: 12px;
    background: var(--card-bg);
    color: var(--text);
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.3s, background 0.3s;
}

body.dark #live-tv-section .playlist-controls button {
    background: var(--dark-card);
    color: var(--dark-text);
}

#live-tv-section .playlist-controls button:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.06);
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.3);
}

#live-tv-section .player-section {
    flex: 1;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-left: 280px; /* Match sidebar width */
    width: calc(100% - 280px);
    height: 100vh;
}

#live-tv-section .sidebar.collapsed + .player-section {
    margin-left: 0;
    width: 100%;
}

#live-tv-section #live-tv-video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#live-tv-section .top-controls {
    position: absolute;
    top: 120px;
    right: 10px;
    display: flex;
    gap: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

#live-tv-section .player-section:hover .top-controls {
    opacity: 1;
}

#live-tv-section .sidebar-toggle {
    background: var(--card-bg);
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.3s, background 0.3s;
}

body.dark #live-tv-section .sidebar-toggle {
    background: var(--dark-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

#live-tv-section .sidebar-toggle i {
    font-size: 1.5rem;
    color: var(--text);
    transition: color 0.3s;
}

body.dark #live-tv-section .sidebar-toggle i {
    color: var(--dark-text);
}

#live-tv-section .sidebar-toggle:hover {
    background: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.3);
}

#live-tv-section .sidebar-toggle:hover i {
    color: white;
}

#live-tv-section .channel-list,
#live-tv-section .history-list {
    flex: 1;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#live-tv-section .channel-list::-webkit-scrollbar,
#live-tv-section .history-list::-webkit-scrollbar {
    display: none;
}

#live-tv-section .channel {
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 5px;
    max-width: 250px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
}

body.dark #live-tv-section .channel {
    background: var(--dark-card);
}

#live-tv-section .channel:hover {
    background: var(--secondary);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.dark #live-tv-section .channel:hover {
    background: var(--dark-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#live-tv-section .channel.selected {
    background: var(--primary);
    color: white;
    transform: translateX(6px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.3);
}

#live-tv-section .channel.selected .fav-star {
    color: white;
}

#live-tv-section .channel.favorited {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
}

body.dark #live-tv-section .channel.favorited {
    background: linear-gradient(135deg, #34c759, #28a745);
}

#live-tv-section .channel-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-right: 8px;
    border-radius: 4px;
    vertical-align: middle;
}

#live-tv-section .channel-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#live-tv-section .channel-status {
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

#live-tv-section .channel-status.active {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
}

body.dark #live-tv-section .channel-status.active {
    background: linear-gradient(135deg, #34c759, #28a745);
}

#live-tv-section .channel-status.offline {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

body.dark #live-tv-section .channel-status.offline {
    background: linear-gradient(135deg, #e04b5a, #dc3545);
}

#live-tv-section .fav-star {
    cursor: pointer;
    color: #f1c40f;
    font-size: 1.4rem;
    transition: transform 0.2s;
}

#live-tv-section .fav-star:hover {
    transform: scale(1.2);
}

#live-tv-section .history-item {
    padding: 8px 12px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s, transform 0.2s;
}

body.dark #live-tv-section .history-item {
    background: var(--dark-card);
}

#live-tv-section .history-item:hover {
    background: var(--secondary);
    transform: translateX(4px);
}

body.dark #live-tv-section .history-item:hover {
    background: var(--dark-card);
}

#live-tv-section .history-item button {
    width: auto;
    padding: 6px 10px;
    background: var(--primary);
    border-radius: 8px;
    font-size: 0.9rem;
}

#live-tv-section .history-item button:hover {
    background: #1557b0;
}

#live-tv-section .history-item .delete-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

#live-tv-section .history-item .delete-btn:hover {
    background: linear-gradient(135deg, #c82333, #b31d2b);
}

body.dark #live-tv-section .history-item .delete-btn {
    background: linear-gradient(135deg, #e04b5a, #dc3545);
}

body.dark #live-tv-section .history-item .delete-btn:hover {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

#live-tv-section .playlist-status {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#live-tv-section .playlist-status span {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.3s, opacity 0.3s;
    cursor: pointer;
}

#live-tv-section .playlist-status span:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

body.dark #live-tv-section .playlist-status span:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#live-tv-section .playlist-status span.active-filter {
    opacity: 0.9;
    transform: scale(1.05);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

body.dark #live-tv-section .playlist-status span.active-filter {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

#live-tv-section .total { background: var(--card-bg); }
body.dark #live-tv-section .total { background: var(--dark-card); }
#live-tv-section .active { background: linear-gradient(135deg, rgba(77, 168, 255, 0.3), #2c2c2c); color: white; }
body.dark #live-tv-section .active { background: linear-gradient(135deg, rgba(77, 168, 255, 0.3), rgba(0, 123, 255, 0.3)); }
#live-tv-section .offline { background: linear-gradient(135deg, #dc3545, #c82333); color: white; }
body.dark #live-tv-section .offline { background: linear-gradient(135deg, #e04b5a, #dc3545); }

#live-tv-section .now-playing {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 12px 18px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 10px;
    display: none;
    z-index: 5;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    font-weight: 600;
}

#live-tv-section .notification {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 10px;
    display: none;
    z-index: 10;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

#live-tv-section .notification.with-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 24px;
}

#live-tv-section .notification.with-buttons button {
    width: auto;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #28a745, #218838);
}

#live-tv-section .notification.with-buttons button:hover {
    background: linear-gradient(135deg, #218838, #1c7430);
}

#live-tv-section .notification.with-buttons button.no {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

#live-tv-section .notification.with-buttons button.no:hover {
    background: linear-gradient(135deg, #c82333, #b31d2b);
}

body.dark #live-tv-section .notification.with-buttons button {
    background: linear-gradient(135deg, #34c759, #28a745);
}

body.dark #live-tv-section .notification.with-buttons button:hover {
    background: linear-gradient(135deg, #28a745, #218838);
}

body.dark #live-tv-section .notification.with-buttons button.no {
    background: linear-gradient(135deg, #e04b5a, #dc3545);
}

body.dark #live-tv-section .notification.with-buttons button.no:hover {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

#live-tv-section .player-controls {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

#live-tv-section .player-section:hover .player-controls {
    opacity: 1;
}

#live-tv-section .player-controls button {
    width: 50px;
    height: 50px;
    padding: 0;
    font-size: 1.3rem;
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.3s, background 0.3s;
}

body.dark #live-tv-section .player-controls button {
    background: var(--dark-card);
    color: var(--dark-text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

#live-tv-section .player-controls button:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.12);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.3);
}

#live-tv-section #live-tv-quality-indicator {
    padding: 14px;
    background: var(--card-bg);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.dark #live-tv-section #live-tv-quality-indicator {
    background: var(--dark-card);
    color: var(--dark-text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    #live-tv-section .player-section {
        margin-left: 0;
        width: 100%;
    }
    #live-tv-section .player-controls {
        bottom: 12px;
        gap: 10px;
    }
    #live-tv-section .player-controls button {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
    #live-tv-section .now-playing {
        font-size: 0.9rem;
        padding: 10px 14px;
        max-width: 70%;
    }
    #live-tv-section .playlist-controls button {
        padding: 10px;
    }
    #live-tv-section .url-input-group button {
        width: 42px;
        height: 42px;
    }
}