:root {
    --bg-dark: #08080a;
    --bg-surface: #111116;
    --bg-glass: rgba(18, 18, 24, 0.72);
    --bg-glass-card: rgba(24, 24, 32, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-border-hover: rgba(255, 255, 255, 0.2);
    --text-main: #ffffff;
    --text-dim: #9494a0;
    --text-muted: #626270;
    
    /* Tesla & Cyber Accent Colors */
    --accent: #E50914; /* Brand Red */
    --accent-glow: rgba(229, 9, 20, 0.4);
    --tesla-red: #e82127;
    --cyber-cyan: #00f2fe;
    --cyber-cyan-glow: rgba(0, 242, 254, 0.35);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    
    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 8px;
    --radius-sm: 4px;
    
    --dock-height: 72px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    background: radial-gradient(circle at 50% 0%, #161622 0%, var(--bg-dark) 85%);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    padding-bottom: calc(var(--dock-height) + 30px);
}

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

.spin-icon {
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
}

.glass-card {
    background: var(--bg-glass-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
    border-color: var(--panel-border-hover);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

/* Top Automotive Header */
.top-header {
    position: sticky;
    top: 0;
    width: 100%;
    height: 64px;
    background: rgba(8, 8, 10, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 100;
    border-bottom: 1px solid var(--panel-border);
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--tesla-red), #990005);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, #b8b8c5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-status-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

.theater-btn-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theater-btn-header:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 16px var(--accent-glow);
}

/* Main Navigation Dock */
.tesla-dock {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    height: var(--dock-height);
    background: rgba(16, 16, 22, 0.88);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 36px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 6px;
    z-index: 200;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 56px;
    border-radius: 20px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    gap: 4px;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.dock-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.25), rgba(229, 9, 20, 0.08));
    border: 1px solid rgba(229, 9, 20, 0.4);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.dock-item.active svg {
    color: var(--accent);
}

/* View Container */
.view-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 32px;
}

.tab-view {
    display: none;
    animation: fadeIn 0.25s ease forwards;
}

.tab-view.active {
    display: block;
}

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

/* Home Dashboard Widgets */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.hero-widget {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    background: linear-gradient(135deg, rgba(28, 28, 40, 0.8), rgba(16, 16, 24, 0.6));
}

.widget-clock-group {
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.widget-time {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1;
}

.widget-date {
    font-size: 1.1rem;
    color: var(--text-dim);
    font-weight: 500;
}

.widget-quick-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.action-btn-large {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--accent), #990005);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px var(--accent-glow);
    transition: all 0.2s ease;
}

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

.action-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.weather-widget {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weather-temp {
    font-size: 2.8rem;
    font-weight: 800;
}

.weather-desc {
    font-size: 0.95rem;
    color: var(--text-dim);
}

/* Quick App Launchpad Grid */
.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    margin-bottom: 36px;
}

.app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    cursor: pointer;
    text-align: center;
    border-radius: var(--radius-lg);
    gap: 12px;
    text-decoration: none;
    color: #fff;
}

.app-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.1);
}

.app-icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
}

.app-icon-wrapper svg {
    width: 30px;
    height: 30px;
    display: block;
    flex-shrink: 0;
}

.app-brand-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
}

.app-brand-icon.wide {
    width: 44px;
    height: 26px;
}

.app-name {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Player Section */
.player-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    margin-bottom: 36px;
}

.player-main-col {
    display: flex;
    flex-direction: column;
}

/* Cinema Max In-Browser Mode for Tesla standard browser */
body.cinema-mode {
    padding-bottom: 12px;
    overflow: hidden;
}

body.cinema-mode .top-header {
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

body.cinema-mode .tesla-dock {
    transform: translate(-50%, 160%);
    transition: transform 0.3s ease;
}

body.cinema-mode .view-container {
    padding: 6px 12px;
    max-width: 100vw;
}

body.cinema-mode .player-layout {
    grid-template-columns: 1fr;
    margin-bottom: 0;
}

body.cinema-mode .queue-panel {
    display: none;
}

body.cinema-mode #player-wrapper {
    height: calc(100vh - 130px);
    aspect-ratio: auto;
    border-radius: var(--radius-lg);
}

body.cinema-mode .controls-bar {
    border-radius: var(--radius-lg);
    border-top: 1px solid var(--panel-border);
    margin-top: 6px;
    padding: 12px 18px;
}

#player-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: height 0.3s ease;
}

.tesla-canvas-surface {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.player-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-dim);
}

/* Modern Player Controls */
.controls-bar {
    background: rgba(20, 20, 28, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    border-top: none;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.controls-row-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-container {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: height 0.15s ease;
}

.progress-container:hover {
    height: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ff2a3b);
    border-radius: 3px;
    width: 0%;
    position: relative;
}

.time-readout {
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-dim);
    min-width: 90px;
}

.controls-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.playback-btn-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ctrl-btn {
    background: transparent;
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.ctrl-btn.play-btn-main {
    background: #fff;
    color: #000;
    width: 52px;
    height: 52px;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
}

.ctrl-btn.play-btn-main:hover {
    transform: scale(1.05);
    background: #f0f0f0;
}

.audio-dsp-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dsp-pill-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dsp-pill-btn:hover, .dsp-pill-btn.active {
    background: var(--accent);
    border-color: var(--accent);
}

/* Queue Sidebar */
.queue-panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.queue-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 480px;
    padding-right: 4px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.15s ease;
}

.queue-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.queue-item.active {
    background: rgba(229, 9, 20, 0.18);
    border: 1px solid rgba(229, 9, 20, 0.35);
}

.queue-thumb {
    width: 60px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    background: #111;
}

.queue-info {
    flex: 1;
    overflow: hidden;
}

.queue-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Gaming Hub */
.gaming-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 36px;
}

.game-launcher-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    cursor: pointer;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.game-launcher-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
    pointer-events: none;
}

/* IPTV Channel Grid */
.iptv-category-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 20px;
    scrollbar-width: none;
}

.iptv-cat-pill {
    padding: 8px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--panel-border);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.iptv-cat-pill.active {
    background: var(--accent);
    border-color: var(--accent);
}

.iptv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.channel-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    border-radius: var(--radius-lg);
}

.channel-logo {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
}

/* Modal Windows (Companion QR, Audio Equalizer) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    width: 100%;
    max-width: 440px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.qr-frame {
    background: #fff;
    padding: 16px;
    border-radius: 16px;
    margin: 20px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* Admin Panel Layout & Components */
.admin-body {
    padding-bottom: 0;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: rgba(14, 14, 18, 0.95);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    backdrop-filter: blur(20px);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 28px;
    padding: 0 12px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.sidebar-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-btn.active {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.sidebar-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s ease;
}

.sidebar-link-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.admin-main {
    flex: 1;
    padding: 32px 40px;
    background: radial-gradient(circle at 50% 0%, #161622 0%, var(--bg-dark) 90%);
    overflow-y: auto;
}

/* Admin Tabs Display Logic - Strict Isolation */
.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
    animation: fadeInAdmin 0.25s ease-in-out;
}

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

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.admin-badge {
    background: rgba(229, 9, 20, 0.15);
    border: 1px solid rgba(229, 9, 20, 0.35);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

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

.premium-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--panel-border);
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

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

.btn-premium {
    background: linear-gradient(135deg, var(--accent), #b21016);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.premium-table th {
    text-align: left;
    padding: 10px 14px;
    color: var(--text-dim);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--panel-border);
}

.premium-table td {
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.88rem;
    vertical-align: middle;
}

/* Fix Jumbo Thumbnails on Admin Table */
.admin-thumb {
    width: 96px !important;
    height: 54px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    max-height: 54px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
    display: block !important;
    background: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.premium-table .title-input {
    width: 100%;
    height: 38px;
    font-size: 0.88rem;
    padding: 6px 12px;
}

.premium-table .category-input {
    width: 100%;
    height: 38px;
    font-size: 0.88rem;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--panel-border);
    color: #fff;
    border-radius: var(--radius-md);
}

.btn-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-icon.success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success);
}
.btn-icon.success:hover {
    background: var(--success);
    color: #000;
}

.btn-icon.danger {
    background: rgba(229, 9, 20, 0.15);
    border-color: rgba(229, 9, 20, 0.3);
    color: var(--accent);
}
.btn-icon.danger:hover {
    background: var(--accent);
    color: #fff;
}

/* Playlists & Categories Grid in Admin */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.playlist-card {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-thumbnail {
    width: 100%;
    height: 135px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-thumbnail.collage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
}

.tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.tag-chip, .tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--panel-border);
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    transition: all 0.15s ease;
}

.tag-chip:hover, .tag-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.delete-cat-btn, .tag-delete-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
    transition: color 0.15s ease;
}
.delete-cat-btn:hover, .tag-delete-btn:hover {
    color: var(--accent);
}

/* Immersive Playlist Editor Layout */
.editor-split-view {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    margin-top: 20px;
}

.editor-pane {
    background: rgba(14, 14, 20, 0.7);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    backdrop-filter: blur(12px);
}

.editor-pane h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.playlist-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
}

.drag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    gap: 12px;
    cursor: grab;
    transition: all 0.15s ease;
}

.drag-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.drag-item.dragging {
    opacity: 0.5;
    background: rgba(229, 9, 20, 0.15);
    border-color: var(--accent);
}

.drag-handle {
    color: var(--text-dim);
    cursor: grab;
    width: 18px;
    height: 18px;
}

.drag-item-thumb {
    width: 64px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}

.rec-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rec-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    gap: 12px;
}

.rec-thumb {
    width: 56px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}

.rec-info {
    flex: 1;
    overflow: hidden;
}

.rec-title {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(20, 20, 26, 0.95);
    border: 1px solid var(--panel-border);
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    animation: slideIn 0.3s ease;
}

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

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

@keyframes slideIn {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .player-layout {
        grid-template-columns: 1fr;
    }
    .top-header {
        padding: 0 16px;
    }
    .view-container {
        padding: 16px;
    }
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
    }
}

/* =========================================================
   MUSIC APP UI OVERHAUL & AI SMART PLAYLISTS
   ========================================================= */

/* Mood & Activity Filters Carousel */
.mood-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 6px 2px 18px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-bottom: 8px;
}
.mood-carousel::-webkit-scrollbar {
    display: none;
}

.mood-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 30px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    user-select: none;
}

.mood-chip:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-2px);
}

.mood-chip.active {
    background: linear-gradient(135deg, var(--accent) 0%, #ff3b30 100%);
    border-color: transparent;
    box-shadow: 0 4px 18px rgba(229, 9, 20, 0.45);
    color: #ffffff;
}

.mood-chip i {
    width: 16px;
    height: 16px;
}

/* Smart Mixes & Mood Radios Grid */
.smart-mix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.smart-mix-card {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 175px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    backdrop-filter: blur(16px);
}

.smart-mix-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.25);
}

.mix-supermix {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.4) 0%, rgba(20, 20, 30, 0.9) 100%);
    border-color: rgba(229, 9, 20, 0.3);
}

.mix-energize {
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.4) 0%, rgba(20, 20, 30, 0.9) 100%);
    border-color: rgba(255, 107, 0, 0.3);
}

.mix-nightdrive {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.35) 0%, rgba(20, 20, 30, 0.9) 100%);
    border-color: rgba(0, 242, 254, 0.3);
}

.mix-feelgood {
    background: linear-gradient(135deg, rgba(255, 45, 120, 0.4) 0%, rgba(20, 20, 30, 0.9) 100%);
    border-color: rgba(255, 45, 120, 0.3);
}

.mix-chill {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.35) 0%, rgba(20, 20, 30, 0.9) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.mix-favorites {
    background: linear-gradient(135deg, rgba(235, 47, 150, 0.4) 0%, rgba(20, 20, 30, 0.9) 100%);
    border-color: rgba(235, 47, 150, 0.3);
}

.smart-mix-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.mix-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #ffffff;
}

.mix-play-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(229, 9, 20, 0.5);
    opacity: 0.92;
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.smart-mix-card:hover .mix-play-btn {
    transform: scale(1.12);
    opacity: 1;
}

.smart-mix-meta h3 {
    font-size: 1.18rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: #ffffff;
}

.smart-mix-meta p {
    font-size: 0.82rem;
    color: var(--text-dim);
}

/* Audio Mode vs Video Mode Switcher */
.deck-mode-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
}

.deck-mode-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.deck-mode-btn.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Audio Vinyl & Ambient Visualizer Deck */
.audio-visualizer-deck {
    width: 100%;
    aspect-ratio: 16/9;
    background: radial-gradient(circle at 50% 50%, #1a1a28 0%, #0a0a0f 100%);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.audio-visualizer-deck.hidden {
    display: none;
}

.ambient-glow-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(50px) opacity(0.35);
    transform: scale(1.2);
    pointer-events: none;
}

.vinyl-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    z-index: 2;
}

.album-cover-art {
    width: 220px;
    height: 220px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 2;
    transition: transform 0.3s ease;
}

.vinyl-disc {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: radial-gradient(circle, #2a2a2a 0%, #111111 40%, #050505 100%);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9), inset 0 0 0 2px rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -70px;
    animation: rotateVinyl 12s linear infinite;
    animation-play-state: paused;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.vinyl-disc.spinning {
    animation-play-state: running;
}

.vinyl-center-label {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff4757);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    text-align: center;
    box-shadow: inset 0 0 0 3px #000;
}

@keyframes rotateVinyl {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Visualizer Wave Equalizer Animation */
.visualizer-waves {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 18px;
    margin-left: 8px;
}

.visualizer-waves .wave-bar {
    width: 3px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
    animation: eqWave 1.2s ease-in-out infinite alternate;
}

.visualizer-waves .wave-bar:nth-child(1) { animation-delay: 0.1s; }
.visualizer-waves .wave-bar:nth-child(2) { animation-delay: 0.35s; }
.visualizer-waves .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.visualizer-waves .wave-bar:nth-child(4) { animation-delay: 0.45s; }

.visualizer-waves.paused .wave-bar {
    animation-play-state: paused;
    height: 4px !important;
}

@keyframes eqWave {
    0% { height: 4px; }
    50% { height: 18px; }
    100% { height: 8px; }
}

/* Transport Active Control States */
.ctrl-btn.active {
    color: #00f2fe !important;
    text-shadow: 0 0 12px rgba(0, 242, 254, 0.75);
}

.ctrl-btn.repeat-one::after {
    content: '1';
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.65rem;
    font-weight: 900;
    color: #00f2fe;
}

.like-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, color 0.2s ease;
    padding: 6px;
}

.like-btn:hover {
    transform: scale(1.15);
    color: #ff4757;
}

.like-btn.liked {
    color: #ff4757 !important;
    animation: heartPulse 0.3s ease;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Persistent Floating Mini-Player */
.mini-player-bar {
    position: fixed;
    bottom: calc(var(--dock-height) + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    width: calc(100% - 36px);
    max-width: 860px;
    height: 60px;
    background: rgba(18, 18, 26, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(24px);
    z-index: 999;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    opacity: 0;
}

.mini-player-bar.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.mini-player-progress {
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.mini-player-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #ff4757);
    border-radius: 2px;
    transition: width 0.2s linear;
}

.mini-player-left {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    flex: 1;
}

.mini-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.mini-meta {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mini-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-artist {
    font-size: 0.76rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.mini-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    transition: transform 0.18s ease;
}

.mini-btn:hover {
    transform: scale(1.15);
}

.mini-play-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
}
