:root {
    /* Color Palette */
    --bg-main: #0B0E14;
    --bg-surface: #151A23;
    --bg-surface-glass: rgba(21, 26, 35, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    
    --primary: #5267FF;
    --primary-hover: #6B7CFF;
    --primary-glow: rgba(82, 103, 255, 0.4);
    
    --text-primary: #FFFFFF;
    --text-secondary: #9BA1B0;
    --text-muted: #5F6676;
    
    --danger: #FF4A4A;
    --success: #00E676;

    /* Typography */
    --font-family: 'Outfit', sans-serif;
    
    /* Layout */
    --sidebar-width: 320px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    display: flex;
}

/* App Container */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    height: 72px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #8F52FF);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.brand h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-controls {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.stream-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* List Items */
.list-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 32px 16px;
    line-height: 1.5;
}

.stream-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stream-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.stream-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.stream-item.active {
    background-color: rgba(82, 103, 255, 0.1);
    border: 1px solid rgba(82, 103, 255, 0.3);
}

.stream-item-icon {
    width: 40px;
    height: 40px;
    background-color: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
    margin-right: 12px;
    position: relative;
    box-shadow: inset 0 0 0 1px var(--border-color);
}

.stream-item.active .stream-item-icon {
    background: linear-gradient(135deg, var(--primary), #8F52FF);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.stream-item.active .stream-item-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.stream-item-info {
    flex: 1;
    overflow: hidden;
}

.stream-item-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.stream-item-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Main Player Area */
.player-area {
    flex: 1;
    position: relative;
    background: radial-gradient(circle at center, #10141D 0%, #06080C 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fade-in 1s ease-out;
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.pulsing-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--text-muted);
    position: relative;
}

.pulsing-circle::before {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: pulse 3s infinite alternate;
}

.player-placeholder h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.iframe-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
}

video {
    width: 100%;
    height: 100%;
    background-color: black;
    outline: none;
}

.video-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    gap: 12px;
    font-size: 1.2rem;
}

.video-overlay i {
    font-size: 48px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(1px);
}

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

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.w-100 {
    width: 100%;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

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

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    padding: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 500;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

input[type="text"] {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

input[type="text"]:focus {
    border-color: var(--primary);
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Animations */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    from { transform: scale(0.95); opacity: 0.5; }
    to { transform: scale(1.05); opacity: 1; }
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}
