:root {
    --bg-color: #0f172a;
    --sidebar-bg: rgba(30, 41, 59, 0.7);
    --card-bg: rgba(30, 41, 59, 0.5);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --border-color: rgba(148, 163, 184, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    font-family: 'Open Sans', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

#app-wrapper {
    display: flex;
    width: 95%;
    max-width: 1600px;
    height: 90vh;
    margin: 20px 0;
    box-shadow: var(--shadow-lg);
    background-color: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

#main-content-flex {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    height: 100%;
}

.sidebar {
    width: 320px;
    min-width: 280px;
    background-color: var(--sidebar-bg);
    border-right: var(--glass-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: var(--glass-border);
    flex-shrink: 0;
}

#logo-header {
    cursor: pointer;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    outline: none;
    transition: transform 0.2s ease;
}

#logo-header:hover {
    transform: scale(1.05);
}

#logo-header img {
    height: 50px;
    width: auto;
    display: block;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

#refresh-button {
    background-color: rgba(255, 255, 255, 0.05);
    border: var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    height: 44px;
    width: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

#refresh-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#refresh-button svg {
    height: 24px;
    width: 24px;
    fill: var(--accent-color);
}

#refresh-button svg.rotate {
    animation: spin 1s linear infinite;
}

.content {
    flex-grow: 1;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

#video-container {
    width: 100%;
    max-width: 1100px;
    aspect-ratio: 16/9;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    position: relative;
    border-radius: 16px;
    border: var(--glass-border);
    background-color: #000;
}

.video-js {
    width: 100% !important;
    height: 100% !important;
}

#channel-list-container {
    overflow-y: auto;
    flex-grow: 1;
    padding: 20px;
}

/* Custom Scrollbar */
#channel-list-container::-webkit-scrollbar {
    width: 6px;
}

#channel-list-container::-webkit-scrollbar-track {
    background: transparent;
}

#channel-list-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#channel-list-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.channel-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.channel-item {
    display: block;
    margin-bottom: 8px;
    width: 100%;
}

.channel-item a {
    text-decoration: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    padding: 14px 18px;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition);
    text-transform: uppercase;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.channel-item a:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: translateX(4px);
}

.channel-item a.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
    color: var(--accent-color);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.channel-item a::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    margin-right: 12px;
    opacity: 0.5;
    transition: var(--transition);
}

.channel-item a.active::before {
    background-color: var(--accent-color);
    opacity: 1;
    box-shadow: 0 0 8px var(--accent-color);
}

#status-display-area {
    flex-shrink: 0;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.status-message {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    margin: 0;
    font-weight: 600;
    font-size: 0.9em;
    color: #f87171;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    box-sizing: border-box;
}

.footer {
    width: 100%;
    padding: 20px;
    text-align: center;
    background-color: transparent;
    color: var(--text-secondary);
    font-size: 0.75em;
    border-top: none;
    flex-shrink: 0;
    opacity: 0.7;
    box-sizing: border-box;
}