:root {
    --bg-dark: #0f1115;
    --bg-panel: #181b21;
    --bg-hover: #22262e;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --border: #2d3139;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Player Section */
.player-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
    overflow-y: auto;
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 10;
}

.hidden {
    display: none !important;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.controls-area {
    background: var(--bg-panel);
    padding: 1.5rem;
    border-radius: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
}

.current-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#current-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 2px;
}

#current-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.badge {
    font-size: 0.75rem;
    background: var(--bg-hover);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    color: var(--text-secondary);
}

.nav-buttons {
    display: flex;
    gap: 0.75rem;
}

button {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

button:hover {
    background: var(--accent);
    border-color: var(--accent);
}

button:active {
    transform: translateY(1px);
}

/* Sidebar */
.sidebar {
    width: 400px;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.search-box {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-box i.fa-search {
    color: var(--text-secondary);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.filters {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

select {
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    outline: none;
}

.channel-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* List Items */
.channel-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.channel-item:hover {
    background: var(--bg-hover);
}

.channel-item.active {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.channel-item.active .channel-name {
    color: var(--accent);
}

.ch-sn {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.ch-logo {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

/* Favorites Toggle in Search */
.fav-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 0.5rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.fav-toggle:hover {
    color: #eab308;
    /* Gold/Yellow */
}

.fav-toggle.active {
    color: #eab308;
    text-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
}

.fav-icon {
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.fav-icon:hover,
.fav-icon.fa-solid {
    color: #eab308;
}

.ch-info {
    flex: 1;
    min-width: 0;
}

.channel-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.channel-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
}

.placeholder-msg {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 50%;
    }

    .player-container {
        padding: 1rem;
    }
}
/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    position: relative;
    z-index: 10;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: 0.5rem;
    outline: none;
    width: 100%;
}

.form-group input:focus {
    border-color: var(--accent);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-primary {
    background: var(--accent);
    border: 1px solid var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
