/* ============================================
   AUTOPLAY LIVE STUDIO - ENTERPRISE CONSOLE
   Modern, Professional Live Streaming Dashboard
   ============================================ */

/* CSS Custom Properties */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(26, 26, 37, 0.8);
    --bg-card-hover: rgba(35, 35, 50, 0.9);
    
    /* Accent Colors */
    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
    --accent-glow: rgba(139, 92, 246, 0.3);
    
    /* Status Colors */
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --warning: #f59e0b;
    --error: #ef4444;
    --live: #ef4444;
    --live-glow: rgba(239, 68, 68, 0.4);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    /* Border Colors */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    /* Spacing */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Layout */
.app {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: transform var(--transition-normal), width var(--transition-normal);
}

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

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo {
    height: 32px;
    width: auto;
    transition: opacity var(--transition-fast);
}

.logo:hover {
    opacity: 0.8;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    position: relative;
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    font-size: 16px;
    text-align: center;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item:hover i {
    opacity: 1;
}

.nav-item.active {
    background: var(--accent-gradient);
    color: var(--text-primary);
    box-shadow: var(--shadow-glow);
}

.nav-item.active i {
    opacity: 1;
}

.nav-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    background: var(--success);
    color: white;
    margin-left: auto;
}

.nav-badge.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-color);
}

.channel-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
    margin-bottom: 12px;
}

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

.channel-selector i:first-child {
    color: var(--accent-primary);
}

.channel-selector span {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-selector i:last-child {
    font-size: 10px;
    color: var(--text-muted);
}

.nav-item.logout {
    color: var(--error);
}

.nav-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    min-height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 20px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

.header-left {
    flex: 1;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* Broadcast Status */
.broadcast-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.broadcast-status.idle .status-dot {
    background: var(--text-muted);
}

.broadcast-status.preshow .status-dot {
    background: var(--warning);
    animation: blink 1.5s infinite;
}

.broadcast-status.live .status-dot {
    background: var(--live);
    animation: blink 1s infinite;
    box-shadow: 0 0 10px var(--live-glow);
}

.broadcast-status.ended .status-dot {
    background: var(--text-muted);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn i {
    font-size: 14px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-glow);
}

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

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

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

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

.btn-outline.disabled,
.btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-live {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px var(--live-glow);
}

.btn-live:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--live-glow);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ============================================
   CONTENT WRAPPER
   ============================================ */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-primary);
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.card:hover {
    border-color: var(--border-hover);
}

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

.card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--accent-primary);
    font-size: 16px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.card-body {
    padding: 20px;
}

.view-all-link {
    font-size: 12px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Stream Preview Card */
.stream-preview-card {
    grid-column: span 8;
}

.preview-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.preview-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-container video.hidden,
.preview-container iframe.hidden {
    display: none;
}

.preview-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Preview Status Badge */
.preview-status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-status-badge .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.preview-status-badge.idle {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.preview-status-badge.idle .badge-dot {
    background: var(--text-muted);
}

.preview-status-badge.preshow {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.preview-status-badge.preshow .badge-dot {
    background: var(--warning);
    animation: blink 1.5s infinite;
}

.preview-status-badge.live {
    background: rgba(239, 68, 68, 0.2);
    color: var(--live);
}

.preview-status-badge.live .badge-dot {
    background: var(--live);
    animation: blink 1s infinite;
    box-shadow: 0 0 8px var(--live-glow);
}

.preview-status-badge.ended {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.preview-status-badge.ended .badge-dot {
    background: var(--success);
}

/* Preview Empty State */
.preview-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

.preview-empty-state i {
    font-size: 40px;
    opacity: 0.5;
}

.preview-empty-state span {
    font-size: 14px;
    font-weight: 500;
}

.preview-empty-state p {
    font-size: 12px;
    opacity: 0.7;
    max-width: 200px;
}

.preview-empty-state.hidden {
    display: none;
}

/* Preview Content Label */
.preview-content-label {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

.preview-content-label.hidden {
    display: none;
}

.preview-content-label.live {
    background: rgba(239, 68, 68, 0.9);
}

.preview-content-label.live::before {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: blink 1s infinite;
}

/* Broadcast State Card */
.broadcast-state-card {
    grid-column: span 4;
}

.show-state {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
}

.state-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 24px;
}

.show-state.idle .state-icon {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.show-state.preshow .state-icon {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.show-state.live .state-icon {
    background: rgba(239, 68, 68, 0.2);
    color: var(--live);
    animation: pulse 1s infinite;
}

.show-state.ended .state-icon {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.state-info {
    display: flex;
    flex-direction: column;
}

.state-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.state-value {
    font-size: 18px;
    font-weight: 700;
}

.state-controls {
    display: flex;
    gap: 10px;
}

/* Stats Card */
.stats-card {
    grid-column: span 4;
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
}

.stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    color: var(--accent-primary);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* Lobby Media Card */
.lobby-media-card {
    grid-column: span 8;
}

.media-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.media-slot {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.media-slot-preview {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.media-slot-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-slot-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    color: var(--text-muted);
    font-size: 32px;
}

.media-slot-preview video[src]:not([src=""]) + .media-slot-overlay {
    display: none;
}

.media-slot-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slot-label {
    font-weight: 600;
    font-size: 14px;
}

.slot-description {
    font-size: 12px;
    color: var(--text-muted);
}

/* Recent Replays Card */
.recent-replays-card {
    grid-column: span 12;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast);
}

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

.recent-item-thumb {
    width: 120px;
    aspect-ratio: 16 / 9;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.recent-item-thumb img,
.recent-item-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-item-title {
    font-weight: 600;
    color: var(--text-primary);
}

.recent-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

.recent-item-actions {
    display: flex;
    gap: 8px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ============================================
   BROADCAST VIEW
   ============================================ */
.broadcast-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.broadcast-option-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.broadcast-option-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.option-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border-radius: 50%;
    font-size: 32px;
    color: var(--accent-primary);
}

.broadcast-option-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.broadcast-option-card p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.broadcast-option-card.featured {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.02));
    border-color: rgba(139, 92, 246, 0.3);
}

.broadcast-option-card.featured:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.2);
}

.broadcast-option-card.featured .option-icon {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #a78bfa, var(--accent-primary));
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

/* ============================================
   MEDIA LIBRARY
   ============================================ */
.media-library {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.media-toolbar,
.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    min-width: 250px;
}

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

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.filter-dropdown select,
.list-toolbar select {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.view-toggle {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.view-btn {
    padding: 10px 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* Upload Dropzone */
.upload-dropzone {
    position: relative;
    padding: 48px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.05);
}

.upload-dropzone.hidden {
    display: none;
}

.dropzone-content i {
    font-size: 48px;
    color: var(--accent-primary);
    margin-bottom: 16px;
}

.dropzone-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.dropzone-content p {
    font-size: 14px;
    color: var(--text-muted);
}

.upload-progress {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.upload-progress.hidden {
    display: none;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.media-item {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.media-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.media-item.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-primary);
}

.media-item-thumb {
    aspect-ratio: 16 / 9;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.media-item-thumb video,
.media-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item-info {
    padding: 12px;
}

.media-item-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.media-item-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.media-item-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.media-item:hover .media-item-actions {
    opacity: 1;
}

.media-item-actions button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 12px;
}

.media-item-actions button:hover {
    background: var(--accent-primary);
}

.media-item-actions button.delete:hover {
    background: var(--error);
}

/* ============================================
   REPLAYS LIST
   ============================================ */
.replays-list,
.recordings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.replay-item,
.recording-item {
    display: grid;
    grid-template-columns: 160px 1fr auto auto;
    align-items: center;
    gap: 20px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.replay-item:hover,
.recording-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.replay-thumb,
.recording-thumb {
    aspect-ratio: 16 / 9;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.replay-thumb img,
.replay-thumb video,
.recording-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.replay-info,
.recording-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.replay-title,
.recording-title {
    font-size: 15px;
    font-weight: 600;
}

.replay-meta,
.recording-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.replay-meta span,
.recording-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.replay-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.replay-status.public {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.replay-status.private {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.replay-actions,
.recording-actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   EMBED & SHARE
   ============================================ */
.embed-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 800px;
}

.embed-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.embed-section h3 i {
    color: var(--accent-primary);
}

.embed-item {
    margin-bottom: 24px;
}

.embed-item label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.copy-field {
    display: flex;
    gap: 8px;
}

.copy-field input,
.copy-field code {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 13px;
}

.copy-field.code-field code {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    overflow-x: auto;
    white-space: nowrap;
}

.copy-btn {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.embed-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ============================================
   SETTINGS
   ============================================ */
.settings-container {
    max-width: 600px;
}

.settings-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-of-type {
    border-bottom: none;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section h3 i {
    color: var(--accent-primary);
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-group input[readonly] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Checkbox */
.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.checkbox-label input:checked + .checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.settings-actions {
    margin-top: 24px;
}

/* Form Hint */
.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Color Picker */
.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.color-picker-container input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 2px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.color-picker-container input[type="color"]:hover {
    border-color: var(--accent-primary);
}

.color-picker-container input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker-container input[type="color"]::-webkit-color-swatch {
    border-radius: 4px;
    border: none;
}

.color-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-preset {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.color-preset:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.color-preset.active {
    border-color: white;
    box-shadow: 0 0 0 2px var(--accent-primary), 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

.color-preview span {
    font-size: 13px;
    color: var(--text-secondary);
}

.preview-btn {
    padding: 10px 24px;
    border-radius: var(--border-radius-sm);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: default;
    transition: background var(--transition-fast);
}

/* Logo Upload */
.logo-upload-container {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.logo-preview {
    width: 100px;
    height: 100px;
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-preview.has-logo {
    border-style: solid;
    border-color: var(--accent-primary);
}

.logo-placeholder {
    color: var(--text-muted);
    font-size: 32px;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-upload-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-progress {
    margin-top: 12px;
}

.upload-progress .progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.upload-progress .progress-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-progress .progress-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* Info Banner */
.info-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
}

.info-banner i {
    color: var(--warning);
    font-size: 18px;
    margin-top: 2px;
}

.info-banner p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.hidden {
    display: none;
}

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

.modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-grid {
    max-height: 400px;
    overflow-y: auto;
}

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

/* Thumbnail Selector */
.thumbnail-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.thumbnail-option {
    aspect-ratio: 16 / 9;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.thumbnail-option:hover {
    border-color: var(--text-muted);
}

.thumbnail-option.selected {
    border-color: var(--accent-primary);
}

.thumbnail-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    min-width: 300px;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

.toast i {
    font-size: 18px;
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--error);
}

.toast-message {
    flex: 1;
    font-size: 14px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .stream-preview-card {
        grid-column: span 6;
    }
    
    .broadcast-state-card {
        grid-column: span 3;
    }
    
    .stats-card {
        grid-column: span 3;
    }
    
    .lobby-media-card {
        grid-column: span 6;
    }
    
    .recent-replays-card {
        grid-column: span 6;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .header-right .btn span {
        display: none;
    }
    
    .header-right .btn {
        padding: 10px 12px;
    }
    
    .replay-item,
    .recording-item {
        grid-template-columns: 120px 1fr auto;
    }
    
    .replay-status {
        display: none;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stream-preview-card,
    .broadcast-state-card,
    .stats-card,
    .lobby-media-card,
    .recent-replays-card {
        grid-column: span 1;
    }
    
    .media-slots {
        grid-template-columns: 1fr;
    }
    
    .top-header {
        padding: 0 16px;
    }
    
    .content-wrapper {
        padding: 16px;
    }
    
    .media-toolbar,
    .list-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-right {
        justify-content: space-between;
    }
    
    .search-box {
        min-width: auto;
        flex: 1;
    }
    
    .replay-item,
    .recording-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .replay-thumb,
    .recording-thumb {
        width: 100%;
    }
    
    .broadcast-options {
        grid-template-columns: 1fr;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

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

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   SUSPENSION BANNER (Admin Override)
   ============================================ */
.suspension-banner {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    color: var(--text-primary);
}

.suspension-banner i {
    font-size: 20px;
    color: var(--error);
}

.suspension-banner span {
    font-size: 14px;
    line-height: 1.5;
}

.suspension-banner strong {
    color: var(--error);
}

.suspension-banner.deleted {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.25), rgba(239, 68, 68, 0.1));
    border-color: var(--error);
}

/* Disabled button state for suspension */
.btn.disabled,
button.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

