/* ============================================================
   HoloClip Tracker - Midnight Amethyst Theme
   Global Styles & Animations
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --neon-teal: #7445f5;
    --neon-pink: #c92eb7;
    --neon-purple: #5c45a3;
    --neon-green: #00f5a0;
    --neon-yellow: #edab64;
    --neon-red: #ff006e;
    --bg-dark: #0a0a0f;
    --bg-surface: #12121a;
    --bg-elevated: #1a1a28;
    --text-primary: #eaeaea;
    --text-secondary: #6c6c80;
    --glass-bg: rgba(18, 18, 26, 0.7);
    --glass-border: rgba(127, 73, 140, 0.25);
    --glow-teal: 0 0 20px rgba(116, 69, 245, 0.3);
    --glow-pink: 0 0 20px rgba(201, 46, 183, 0.3);
    --glow-purple: 0 0 20px rgba(92, 69, 163, 0.3);
    --glow-intensity: 1;
    --glass-blur: 12px;
    --border-radius: 12px;
    --animation-speed: 1;
}

html {
    font-size: 112%;
}

/* ---------- Base ---------- */
html, body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Ambient Background (Cinematic) ---------- */
body::before {
    content: '';
    position: fixed;
    top: -40%;
    left: -20%;
    width: 60%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(116, 69, 245, 0.06), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    right: -10%;
    width: 50%;
    height: 70%;
    background: radial-gradient(ellipse, rgba(201, 46, 183, 0.04), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(127, 73, 140, 0.35);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(127, 73, 140, 0.55);
}

/* ---------- Keyframe Animations ---------- */

/* Fade + slide in from bottom */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade + slide in from top (for new video inserts) */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

/* Neon pulse glow */
@keyframes neonPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(116, 69, 245, 0.2),
                    0 0 10px rgba(116, 69, 245, 0.1);
    }
    50% {
        box-shadow: 0 0 10px rgba(116, 69, 245, 0.4),
                    0 0 20px rgba(116, 69, 245, 0.2),
                    0 0 40px rgba(116, 69, 245, 0.1);
    }
}

/* Neon pulse for pink */
@keyframes neonPulsePink {
    0%, 100% {
        box-shadow: 0 0 5px rgba(201, 46, 183, 0.2),
                    0 0 10px rgba(201, 46, 183, 0.1);
    }
    50% {
        box-shadow: 0 0 10px rgba(201, 46, 183, 0.4),
                    0 0 20px rgba(201, 46, 183, 0.2),
                    0 0 40px rgba(201, 46, 183, 0.1);
    }
}

/* Skeleton shimmer loading effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Subtle float animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Checkmark animation */
@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Gradient text shimmer */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Nav underline animation */
@keyframes underlineGlow {
    0%, 100% {
        opacity: 0.7;
        width: 60%;
    }
    50% {
        opacity: 1;
        width: 100%;
    }
}

/* ---------- Page Transition ---------- */
.page-content {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeSlideIn 0.4s ease-out;
}

/* ============================================================
   App Shell Layout — Sidebar + Content + Mobile Bar
   ============================================================ */

.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* ---------- Persistent Sidebar ---------- */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: rgba(14, 14, 21, 0.98);
    border-right: 1px solid rgba(127, 73, 140, 0.12);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    z-index: 50;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(127, 73, 140, 0.25); border-radius: 2px; }

.sidebar-brand {
    padding: 20px 16px 8px;
}

.sidebar-nav {
    padding: 0 8px;
}

.sidebar-section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 14px 12px 6px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #8b8ba0;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.sidebar-nav-item:hover {
    background: rgba(116, 69, 245, 0.06);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: rgba(116, 69, 245, 0.1);
    color: var(--neon-teal);
}

.sidebar-nav-item.active .mud-icon-root {
    color: var(--neon-teal) !important;
}

.live-nav-item {
    border: 1px solid rgba(255, 0, 110, 0.15);
}

.live-nav-item:hover {
    background: rgba(255, 0, 110, 0.06);
    border-color: rgba(255, 0, 110, 0.25);
}

.nav-badge {
    margin-left: auto;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: rgba(116, 69, 245, 0.1);
    color: var(--neon-teal);
}

.nav-badge.live {
    background: rgba(255, 0, 110, 0.15);
    color: var(--neon-red);
}

/* Sidebar Playlists */
.sidebar-playlists-section {
    padding: 0 8px;
    margin-top: 4px;
}

.sidebar-playlist-scroll {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.sidebar-playlist-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.8rem;
}

.sidebar-playlist-row:hover {
    background: rgba(116, 69, 245, 0.06);
}

.sidebar-pl-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #8b8ba0;
    font-weight: 500;
}

.sidebar-pl-count {
    font-size: 0.7rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.sidebar-spacer {
    flex: 1;
}

/* Sidebar User Footer */
.sidebar-footer {
    padding: 8px 8px 12px;
    border-top: 1px solid rgba(127, 73, 140, 0.12);
    margin-top: 8px;
}

.sidebar-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
}

.sidebar-user-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-email {
    font-size: 0.675rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- App Content ---------- */
.app-content {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    background: var(--bg-dark);
}

/* ---------- Mobile Bottom Bar ---------- */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(14, 14, 21, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(127, 73, 140, 0.15);
    z-index: 100;
    padding: 0 8px;
}

.mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    padding: 8px 4px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.625rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.mobile-tab:hover,
.mobile-tab.active {
    color: var(--neon-teal);
}

.mobile-tab.active .mud-icon-root {
    color: var(--neon-teal) !important;
}

/* Responsive: Sidebar / Bottom Bar */
@media (max-width: 960px) {
    .sidebar {
        display: none;
    }

    .mobile-bottom-bar {
        display: flex;
    }

    .app-content {
        padding-bottom: 60px;
    }
}

/* ---------- Glassmorphism Card ---------- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: rgba(116, 69, 245, 0.35);
    box-shadow: 0 8px 32px rgba(116, 69, 245, 0.1),
                0 0 0 1px rgba(116, 69, 245, 0.1);
    transform: translateY(-2px);
}

/* ---------- Video Card ---------- */
.video-card {
    animation: fadeSlideIn 0.5s ease-out backwards;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.video-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 12px 40px rgba(116, 69, 245, 0.15),
                0 0 0 1px rgba(116, 69, 245, 0.2);
}

/* New video slide-in animation */
.video-card-new {
    animation: slideDown 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Video card internal layout */
.video-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.video-title-link {
    text-decoration: none;
    color: inherit;
}

.video-title-link:hover .video-title {
    color: var(--neon-teal) !important;
}

.video-channel-link {
    text-decoration: none;
    color: var(--neon-pink);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
}

.video-channel-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.video-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.video-thumbnail-link {
    text-decoration: none;
    display: block;
}

/* ---------- Video Thumbnail ---------- */
.video-thumbnail {
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(116, 69, 245, 0.03), rgba(92, 69, 163, 0.03));
}

.video-thumbnail img {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-thumbnail:hover img {
    transform: scale(1.08);
}

.video-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.6) 0%, transparent 50%);
    pointer-events: none;
}

.video-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(116, 69, 245, 0.05), rgba(92, 69, 163, 0.05));
}

/* ---------- Watched Button ---------- */
.watched-btn {
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.watched-btn:hover {
    color: var(--neon-green);
}

.watched-btn.is-watched {
    color: var(--neon-green) !important;
    animation: checkmark 0.3s ease-out;
}

/* ---------- Video Grid: 5 columns on 2K+ screens (1600px accounts for display scaling) ---------- */
@media (min-width: 1600px) {
    .video-grid > .mud-grid-item {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

/* ---------- Video Grid Animation Reset ---------- */
.video-grid .mud-grid-item {
    animation: fadeSlideIn 0.5s ease-out backwards;
}

.video-grid .mud-grid-item:nth-child(1) { animation-delay: 0.03s; }
.video-grid .mud-grid-item:nth-child(2) { animation-delay: 0.06s; }
.video-grid .mud-grid-item:nth-child(3) { animation-delay: 0.09s; }
.video-grid .mud-grid-item:nth-child(4) { animation-delay: 0.12s; }
.video-grid .mud-grid-item:nth-child(5) { animation-delay: 0.15s; }
.video-grid .mud-grid-item:nth-child(6) { animation-delay: 0.18s; }
.video-grid .mud-grid-item:nth-child(7) { animation-delay: 0.21s; }
.video-grid .mud-grid-item:nth-child(8) { animation-delay: 0.24s; }
.video-grid .mud-grid-item:nth-child(9) { animation-delay: 0.27s; }
.video-grid .mud-grid-item:nth-child(10) { animation-delay: 0.30s; }
.video-grid .mud-grid-item:nth-child(11) { animation-delay: 0.33s; }
.video-grid .mud-grid-item:nth-child(12) { animation-delay: 0.36s; }

/* ---------- Neon Tag Chip ---------- */
.neon-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid rgba(116, 69, 245, 0.3);
    background: rgba(116, 69, 245, 0.08);
    color: var(--neon-teal);
    transition: all 0.25s ease;
    cursor: pointer;
}

.neon-chip:hover {
    background: rgba(116, 69, 245, 0.15);
    border-color: var(--neon-teal);
    box-shadow: 0 0 12px rgba(116, 69, 245, 0.2);
}

.neon-chip.chip-pink {
    border-color: rgba(201, 46, 183, 0.3);
    background: rgba(201, 46, 183, 0.08);
    color: var(--neon-pink);
}

.neon-chip.chip-pink:hover {
    background: rgba(201, 46, 183, 0.15);
    border-color: var(--neon-pink);
    box-shadow: 0 0 12px rgba(201, 46, 183, 0.2);
}

.neon-chip.chip-purple {
    border-color: rgba(92, 69, 163, 0.3);
    background: rgba(92, 69, 163, 0.08);
    color: var(--neon-purple);
}

.neon-chip.chip-purple:hover {
    background: rgba(92, 69, 163, 0.15);
    border-color: var(--neon-purple);
    box-shadow: 0 0 12px rgba(92, 69, 163, 0.2);
}

.neon-chip.chip-activity {
    border-color: rgba(255, 152, 0, 0.3);
    background: rgba(255, 152, 0, 0.08);
    color: #ffb74d;
}

.neon-chip.chip-activity:hover {
    background: rgba(255, 152, 0, 0.15);
    border-color: #ffb74d;
    box-shadow: 0 0 12px rgba(255, 152, 0, 0.2);
}

/* ---------- Watched Toggle ---------- */
.watched-toggle {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--text-secondary);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.watched-toggle:hover {
    border-color: var(--neon-green);
    background: rgba(0, 245, 160, 0.1);
}

.watched-toggle.is-watched {
    border-color: var(--neon-green);
    background: var(--neon-green);
}

.watched-toggle.is-watched .check-icon {
    animation: checkmark 0.3s ease-out forwards;
    color: var(--bg-dark);
}

/* ---------- Skeleton Shimmer ---------- */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-surface) 25%,
        rgba(92, 69, 163, 0.08) 50%,
        var(--bg-surface) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-title {
    height: 20px;
    width: 80%;
    margin-bottom: 12px;
}

.skeleton-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
}

/* ---------- Navigation ---------- */
.nav-item-neon {
    position: relative;
    transition: all 0.3s ease;
}

.nav-item-neon::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-teal), var(--neon-pink));
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item-neon:hover::after,
.nav-item-neon.active::after {
    width: 80%;
}

.nav-item-neon.active::after {
    animation: underlineGlow 3s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(116, 69, 245, 0.4);
}

/* ---------- Gradient Text ---------- */
.neon-gradient-text {
    background: linear-gradient(135deg, var(--neon-teal), var(--neon-pink), var(--neon-purple));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 6s ease infinite;
}

/* ---------- Tags Page — Stats Bar ---------- */
.tags-stats-bar {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.tags-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tags-stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.tags-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.tags-stat-dot.active  { background: var(--neon-green); }
.tags-stat-dot.inactive { background: var(--neon-red); }
.tags-stat-dot.total   { background: var(--neon-teal); }

/* ---------- Tags Page — Filter Bar ---------- */
.tags-filter-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.6rem;
}

.tags-search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.tags-search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tags-search-box input:focus {
    border-color: var(--neon-teal);
    box-shadow: 0 0 0 3px rgba(116, 69, 245, 0.15);
}

.tags-search-box input::placeholder { color: var(--text-secondary); }

.tags-search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    width: 18px;
    height: 18px;
}

/* ---------- Tags Page — Pill Buttons ---------- */
.tags-pill-group {
    display: flex;
    gap: 8px;
}

.tags-pill {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    user-select: none;
}

.tags-pill:hover {
    border-color: var(--neon-teal);
    color: var(--text-primary);
}

.tags-pill.active {
    background: linear-gradient(135deg, var(--neon-teal), var(--neon-purple));
    border-color: transparent;
    color: #fff;
}

.tags-pill.active-status.active {
    background: linear-gradient(135deg, var(--neon-green), #00c980);
    color: #0a0a0f;
    border-color: transparent;
}

.tags-pill.inactive-status.active {
    background: linear-gradient(135deg, var(--neon-red), #cc0058);
    color: #fff;
    border-color: transparent;
}

/* ---------- Tags Page — Category Section ---------- */
.tags-category-section {
    margin-bottom: 2rem;
}

.tags-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--glass-border);
}

.tags-category-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.tags-category-tab.holojp {
    background: rgba(116, 69, 245, 0.15);
    color: var(--neon-teal);
}

.tags-category-tab.holoen {
    background: rgba(201, 46, 183, 0.15);
    color: var(--neon-pink);
}

.tags-category-tab.holoid {
    background: rgba(0, 245, 160, 0.15);
    color: var(--neon-green);
}

.tags-category-tab.activity {
    background: rgba(255, 152, 0, 0.15);
    color: #ffb74d;
}

.tags-category-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ---------- Tags Page — Card Grid ---------- */
.tags-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.tag-card {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.25s ease;
    cursor: default;
}

.tag-card:hover {
    border-color: var(--neon-teal);
    box-shadow: 0 0 20px rgba(116, 69, 245, 0.12), 0 4px 12px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.tag-card.inactive {
    border-style: dashed;
    opacity: 0.5;
}

.tag-card.inactive:hover {
    opacity: 0.75;
    border-color: var(--text-secondary);
    box-shadow: none;
    transform: translateY(-1px);
}

.tag-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tag-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
}

.tag-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(116, 69, 245, 0.12);
    color: var(--neon-teal);
    font-size: 0.72rem;
    font-weight: 600;
    flex-shrink: 0;
}

.tag-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tag-card-aliases {
    font-size: 0.68rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
}

/* ---------- Tags Page — Toggle Switch ---------- */
.tag-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    display: inline-block;
}

.tag-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.tag-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    transition: 0.25s;
}

.tag-toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: 0.25s;
}

.tag-toggle input:checked + .tag-toggle-slider {
    background: var(--neon-teal);
    border-color: var(--neon-teal);
}

.tag-toggle input:checked + .tag-toggle-slider::before {
    transform: translateX(18px);
    background: #fff;
}

/* ---------- Channels Page — Stats Bar ---------- */
.ch-stats-bar {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.ch-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ch-stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.ch-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.ch-stat-dot.active { background: var(--neon-green); }
.ch-stat-dot.paused { background: var(--neon-yellow); }
.ch-stat-dot.total  { background: var(--neon-teal); }

/* ---------- Channels Page — Filter Bar ---------- */
.ch-filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.4rem;
}

.ch-search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.ch-search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ch-search-box input:focus {
    border-color: var(--neon-teal);
    box-shadow: 0 0 0 3px rgba(116, 69, 245, 0.15);
}

.ch-search-box input::placeholder { color: var(--text-secondary); }

.ch-search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    width: 18px;
    height: 18px;
}

/* ---------- Channels Page — Pills ---------- */
.ch-pill-group {
    display: flex;
    gap: 8px;
}

.ch-pill {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    user-select: none;
}

.ch-pill:hover {
    border-color: var(--neon-teal);
    color: var(--text-primary);
}

.ch-pill.active {
    background: linear-gradient(135deg, var(--neon-teal), var(--neon-purple));
    border-color: transparent;
    color: #fff;
}

.ch-pill.active-status.active {
    background: linear-gradient(135deg, var(--neon-green), #00c980);
    color: #0a0a0f;
    border-color: transparent;
}

.ch-pill.paused-status.active {
    background: linear-gradient(135deg, var(--neon-yellow), #c98a00);
    color: #0a0a0f;
    border-color: transparent;
}

/* ---------- Channels Page — Row List ---------- */
.ch-row-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ch-row {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.ch-row:hover {
    border-color: var(--neon-teal);
    box-shadow: 0 0 16px rgba(116, 69, 245, 0.1);
    transform: translateX(3px);
}

.ch-row.paused {
    opacity: 0.5;
    border-style: dashed;
}

.ch-row.paused:hover {
    opacity: 0.75;
    border-color: var(--text-secondary);
    box-shadow: none;
}

/* ---------- Channels Page — Toggle ---------- */
.ch-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    display: inline-block;
}

.ch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.ch-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    transition: 0.25s;
}

.ch-toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: 0.25s;
}

.ch-toggle input:checked + .ch-toggle-slider {
    background: var(--neon-teal);
    border-color: var(--neon-teal);
}

.ch-toggle input:checked + .ch-toggle-slider::before {
    transform: translateX(18px);
    background: #fff;
}

/* ---------- Channels Page — Row Info ---------- */
.ch-row-info {
    flex: 1;
    min-width: 0;
}

.ch-row-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-row-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.ch-row-yt-id {
    font-family: 'Consolas', 'Monaco', monospace;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ch-row-sep {
    color: rgba(127, 73, 140, 0.4);
}

/* ---------- Channels Page — Badges ---------- */
.ch-video-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(116, 69, 245, 0.12);
    color: var(--neon-teal);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---------- Channels Page — Row Actions ---------- */
.ch-row-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.ch-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
}

.ch-icon-btn:hover {
    border-color: var(--neon-teal);
    color: var(--text-primary);
    background: rgba(116, 69, 245, 0.08);
}

.ch-icon-btn.danger:hover {
    border-color: var(--neon-red);
    color: var(--neon-red);
    background: rgba(255, 0, 110, 0.08);
}

.ch-icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ---------- Channels Page — Progress Banner ---------- */
.ch-progress-banner {
    background: var(--bg-surface);
    border: 1px solid rgba(116, 69, 245, 0.3);
    border-radius: var(--border-radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 1rem;
}

.ch-progress-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--glass-border);
    border-top-color: var(--neon-teal);
    border-radius: 50%;
    animation: chSpin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes chSpin { to { transform: rotate(360deg); } }

.ch-progress-info { flex: 1; }

.ch-progress-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.ch-progress-detail {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.ch-progress-bar-track {
    width: 100%;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}

.ch-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-teal), var(--neon-pink));
    border-radius: 4px;
    transition: width 0.3s;
}

.ch-progress-bar-fill.ch-progress-indeterminate {
    width: 30% !important;
    animation: chIndeterminate 1.5s ease-in-out infinite;
}

@keyframes chIndeterminate {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* ---------- Stat Card ---------- */
.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: var(--border-radius);
    background: rgba(18, 18, 26, 0.5);
    border: 1px solid var(--glass-border);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(116, 69, 245, 0.3);
    transform: translateY(-2px);
}

/* ---------- MudBlazor Overrides ---------- */

/* Snackbar toast styling */
.mud-snackbar {
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid var(--glass-border) !important;
}

/* MudDrawer/AppBar overrides removed — using custom sidebar layout */

/* MudCard hover effect */
.mud-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.mud-card:hover {
    border-color: rgba(116, 69, 245, 0.2) !important;
}

/* MudChip neon styling */
.mud-chip.neon {
    border: 1px solid rgba(116, 69, 245, 0.3);
    transition: all 0.25s ease;
}

.mud-chip.neon:hover {
    box-shadow: 0 0 10px rgba(116, 69, 245, 0.2);
}

/* MudButton glow on hover */
.mud-button-root.mud-button-filled-primary:hover {
    box-shadow: 0 4px 20px rgba(116, 69, 245, 0.3) !important;
}

.mud-button-root.mud-button-filled-secondary:hover {
    box-shadow: 0 4px 20px rgba(201, 46, 183, 0.3) !important;
}

/* MudPagination active page glow */
.mud-pagination .mud-pagination-item.mud-pagination-item-selected {
    box-shadow: 0 0 12px rgba(116, 69, 245, 0.3);
}

/* MudSelect/Input focus glow */
.mud-input-outlined .mud-input-outlined-border {
    transition: all 0.3s ease !important;
}

.mud-input.mud-input-outlined:focus-within .mud-input-outlined-border {
    box-shadow: 0 0 0 2px rgba(116, 69, 245, 0.15);
}

/* ---------- Utility Classes ---------- */
.glow-teal { box-shadow: var(--glow-teal); }
.glow-pink { box-shadow: var(--glow-pink); }
.glow-purple { box-shadow: var(--glow-purple); }

.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse-teal { animation: neonPulse 3s ease-in-out infinite; }
.animate-pulse-pink { animation: neonPulsePink 3s ease-in-out infinite; }

/* ---------- Playlist Card ---------- */
.playlist-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.playlist-card-header {
    cursor: pointer;
    transition: background 0.2s ease;
}

.playlist-card-header:hover {
    background: rgba(116, 69, 245, 0.04);
}

.playlist-icon-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.playlist-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(116, 69, 245, 0.15);
    color: var(--neon-teal);
    border: 1px solid rgba(116, 69, 245, 0.3);
}

.playlist-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Playlist Detail ---------- */
.playlist-video-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    transition: all 0.25s ease;
}

.playlist-video-item:hover {
    border-color: rgba(116, 69, 245, 0.3);
}

.playlist-video-item.dragging {
    opacity: 0.4;
}

.playlist-video-item.drag-over {
    border-top: 2px solid var(--neon-teal);
    margin-top: -2px;
}

.playlist-drag-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-width: 28px;
    flex-shrink: 0;
    cursor: grab;
}

.playlist-drag-handle:active {
    cursor: grabbing;
}

.playlist-video-thumbnail {
    width: 120px;
    min-width: 120px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    display: block;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(116, 69, 245, 0.03), rgba(92, 69, 163, 0.03));
}

.playlist-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.playlist-video-thumbnail:hover img {
    transform: scale(1.05);
}

.playlist-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-video-info {
    flex: 1;
    min-width: 0;
}

.playlist-video-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.playlist-video-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Playlist add button on video card */
.playlist-add-btn {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.playlist-add-btn:hover {
    color: var(--neon-teal);
}

/* Responsive: stack playlist items on mobile */
@media (max-width: 600px) {
    .playlist-video-thumbnail {
        width: 80px;
        min-width: 80px;
    }

    .playlist-video-item {
        gap: 8px;
        padding: 6px 8px;
    }
}

/* ---------- Playlist Detail — Table Layout ---------- */
.playlist-table-header {
    display: grid;
    grid-template-columns: 36px 100px 1fr 140px 80px 40px;
    gap: 12px;
    align-items: center;
    padding: 8px 14px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(127, 73, 140, 0.15);
}

.playlist-table-row {
    display: grid;
    grid-template-columns: 36px 100px 1fr 140px 80px 40px;
    gap: 12px;
    align-items: center;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.playlist-table-row:hover {
    background: rgba(116, 69, 245, 0.04);
    border-color: rgba(127, 73, 140, 0.15);
}

.playlist-table-row.dragging {
    opacity: 0.4;
}

.playlist-table-row.drag-over {
    border-top: 2px solid var(--neon-teal);
    margin-top: -2px;
}

.playlist-table-row .drag-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    cursor: grab;
}

.playlist-table-row .drag-col:active {
    cursor: grabbing;
}

.playlist-table-row .thumb-col {
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(116, 69, 245, 0.03), rgba(92, 69, 163, 0.03));
}

.playlist-table-row .thumb-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.playlist-table-row:hover .thumb-col img {
    transform: scale(1.05);
}

.playlist-table-row .thumb-col a {
    display: block;
    text-decoration: none;
}

.playlist-table-row .info-col {
    min-width: 0;
}

.playlist-table-row .info-col .info-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.playlist-table-row:hover .info-col .info-title {
    color: var(--neon-teal);
}

.playlist-table-row .info-col .info-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.playlist-table-row .tags-col {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.playlist-table-row .time-col {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
}

.playlist-table-row .actions-col {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Watched status indicator */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid var(--text-secondary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.status-dot:hover {
    border-color: var(--neon-green);
}

.status-dot.watched {
    background: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 6px rgba(0, 245, 160, 0.3);
}

/* Playlist filter chips */
/* ---------- Timeline Filter Bar ---------- */
.filter-bar .mud-input-label,
.filter-bar .mud-input,
.filter-bar .mud-select-input,
.filter-bar .mud-input-slot,
.filter-bar .mud-input > input,
.filter-bar .mud-autocomplete > input,
.filter-bar .mud-input-control .mud-input-label {
    font-size: 0.8125rem !important;
}

.filter-bar .mud-input-label-outlined {
    font-size: 0.75rem !important;
}

.playlist-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    padding: 0 4px;
}

/* Responsive table */
@media (max-width: 800px) {
    .playlist-table-header {
        display: none;
    }

    .playlist-table-row {
        grid-template-columns: 28px 80px 1fr 40px;
    }

    .playlist-table-row .tags-col,
    .playlist-table-row .time-col {
        display: none;
    }
}

@media (max-width: 500px) {
    .playlist-table-row {
        grid-template-columns: 28px 1fr 40px;
    }

    .playlist-table-row .thumb-col {
        display: none;
    }
}

/* ---------- Filter Pill Chips (Cinematic) ---------- */
.filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.filter-pill.active {
    background: linear-gradient(135deg, rgba(116, 69, 245, 0.15), rgba(201, 46, 183, 0.1));
    border-color: var(--neon-teal);
    color: var(--neon-teal);
}

.filter-pill-sep {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.06);
    align-self: center;
    margin: 0 2px;
}

/* ---------- Blazor Error UI ---------- */
#blazor-error-ui {
    background: linear-gradient(135deg, rgba(255, 0, 110, 0.9), rgba(201, 46, 183, 0.9));
    backdrop-filter: blur(12px);
    padding: 1rem 1.5rem;
    color: white;
    border-radius: 0 0 12px 12px;
    font-family: 'Inter', sans-serif;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.blazor-error-boundary {
    background: rgba(255, 0, 110, 0.1);
    border: 1px solid rgba(255, 0, 110, 0.3);
    padding: 1rem;
    border-radius: 12px;
    color: var(--neon-red);
}

/* ---------- Reconnect Modal ---------- */
#components-reconnect-modal {
    display: none;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.reconnect-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.reconnect-card {
    position: relative;
    z-index: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px 48px;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(116, 69, 245, 0.08);
    max-width: 360px;
    width: 90%;
}

.reconnect-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(116, 69, 245, 0.2);
    border-top-color: var(--neon-teal);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: reconnectSpin 1s linear infinite;
}

@keyframes reconnectSpin {
    to { transform: rotate(360deg); }
}

.reconnect-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.reconnect-message {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 24px;
    line-height: 1.5;
}

.reconnect-reload-btn {
    display: none;
    padding: 10px 28px;
    background: var(--neon-teal);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.reconnect-reload-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

/* Show reload button and change message when failed/rejected */
#components-reconnect-modal.components-reconnect-failed .reconnect-spinner,
#components-reconnect-modal.components-reconnect-rejected .reconnect-spinner {
    border-top-color: var(--neon-red);
    animation: none;
    border-color: rgba(255, 0, 110, 0.3);
    border-top-color: var(--neon-red);
}

#components-reconnect-modal.components-reconnect-failed .reconnect-title,
#components-reconnect-modal.components-reconnect-rejected .reconnect-title {
    color: var(--neon-red);
}

#components-reconnect-modal.components-reconnect-failed .reconnect-reload-btn,
#components-reconnect-modal.components-reconnect-rejected .reconnect-reload-btn {
    display: inline-block;
}

/* ---------- Compact Mode ---------- */
.compact-mode .page-content {
    padding: 12px 16px;
}

.compact-mode .glass-card {
    padding: 12px 16px;
}

.compact-mode .mb-6 {
    margin-bottom: 12px !important;
}

.compact-mode .mb-4 {
    margin-bottom: 8px !important;
}

.compact-mode .pa-6 {
    padding: 12px 16px !important;
}

/* ---------- No Animations Mode ---------- */
.no-animations *,
.no-animations *::before,
.no-animations *::after {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}

/* ---------- Dynamic Border Radius Override ---------- */
.mud-paper,
.mud-card,
.mud-dialog,
.mud-snackbar {
    border-radius: var(--border-radius) !important;
}

/* ---------- Theme Customizer ---------- */

/* Preset cards */
.theme-preset-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 90px;
}

.theme-preset-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.theme-preset-card.selected {
    border-color: var(--neon-teal);
    box-shadow: 0 0 12px rgba(116, 69, 245, 0.3);
    background: rgba(255, 255, 255, 0.06);
}

.preset-colors {
    display: flex;
    align-items: center;
    gap: 4px;
}

.preset-bg-swatch {
    width: 32px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preset-accent-dot,
.preset-secondary-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

/* Color picker fields */
.color-picker-field {
    display: flex;
    flex-direction: column;
}

.color-picker-field .mud-picker {
    background: transparent !important;
}

.color-picker-field .mud-picker-inline-paper {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--glass-border);
}

/* ---------- Login Page ---------- */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-dark);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* Grid background */
.login-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(116, 69, 245, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(116, 69, 245, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 70%);
}

/* Scan-line overlay */
.login-bg-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg, transparent, transparent 2px,
        rgba(116, 69, 245, 0.008) 2px, rgba(116, 69, 245, 0.008) 4px
    );
    pointer-events: none;
}

/* Ambient glow spots */
.login-bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.login-bg-glow-1 {
    width: 500px;
    height: 500px;
    top: -10%;
    right: -5%;
    background: radial-gradient(circle, rgba(201, 46, 183, 0.1), transparent 60%);
    animation: login-pulse-glow 8s ease-in-out infinite alternate;
}

.login-bg-glow-2 {
    width: 400px;
    height: 400px;
    bottom: -5%;
    left: -5%;
    background: radial-gradient(circle, rgba(116, 69, 245, 0.1), transparent 60%);
    animation: login-pulse-glow 8s ease-in-out infinite alternate-reverse;
}

/* Floating stream elements */
.login-stream-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.login-stream-el {
    position: absolute;
    font-size: 1.2rem;
    opacity: 0;
    animation: login-float-up 12s linear infinite;
}

.login-stream-el:nth-child(1)  { left: 8%;  animation-delay: 0s;   font-size: 1.1rem; }
.login-stream-el:nth-child(2)  { left: 15%; animation-delay: 2s;   font-size: 0.9rem; }
.login-stream-el:nth-child(3)  { left: 25%; animation-delay: 4.5s; font-size: 1.3rem; }
.login-stream-el:nth-child(4)  { left: 35%; animation-delay: 1s;   font-size: 1rem; }
.login-stream-el:nth-child(5)  { left: 50%; animation-delay: 3.5s; font-size: 1.1rem; }
.login-stream-el:nth-child(6)  { left: 62%; animation-delay: 6s;   font-size: 0.8rem; }
.login-stream-el:nth-child(7)  { left: 72%; animation-delay: 2.5s; font-size: 1.2rem; }
.login-stream-el:nth-child(8)  { left: 82%; animation-delay: 5s;   font-size: 1rem; }
.login-stream-el:nth-child(9)  { left: 90%; animation-delay: 7.5s; font-size: 0.9rem; }
.login-stream-el:nth-child(10) { left: 45%; animation-delay: 8.5s; font-size: 1.1rem; }

/* Login wrapper */
.login-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: login-entrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
    transform: translateY(20px) scale(0.98);
}

/* Stream panel */
.stream-panel {
    width: 100%;
    max-width: 420px;
}

.panel-accent {
    height: 3px;
    background: linear-gradient(90deg, var(--neon-teal), var(--neon-pink), var(--neon-teal));
    background-size: 200% 100%;
    border-radius: 20px 20px 0 0;
    animation: login-accent-slide 4s ease infinite;
}

.panel-body {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 20px 20px;
    padding: 40px 36px 36px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(116, 69, 245, 0.05);
    position: relative;
}

/* Live indicator */
.live-indicator {
    position: absolute;
    top: -14px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(255, 0, 110, 0.9);
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 2px 12px rgba(255, 0, 110, 0.4);
    animation: login-pulse-badge 2s ease-in-out infinite;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: login-blink 1.5s ease-in-out infinite;
}

/* Brand section */
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 32px;
}

.login-brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--neon-teal), var(--neon-pink));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(116, 69, 245, 0.3);
}

/* Chat messages */
.login-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 28px;
}

.login-chat-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(116, 69, 245, 0.04);
    border: 1px solid rgba(116, 69, 245, 0.08);
    border-radius: 12px;
    font-size: 0.78rem;
    opacity: 0;
    animation: login-chat-pop 0.4s ease forwards;
}

.login-chat-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
}

.login-chat-avatar.av-pink   { background: var(--neon-pink); }
.login-chat-avatar.av-purple { background: var(--neon-teal); }
.login-chat-avatar.av-teal   { background: var(--neon-green); color: var(--bg-dark); }

.login-chat-name { font-weight: 600; margin-right: 4px; }
.login-chat-name.name-pink   { color: var(--neon-pink); }
.login-chat-name.name-purple { color: var(--neon-teal); }
.login-chat-name.name-teal   { color: var(--neon-green); }
.login-chat-text { color: var(--text-secondary); }

/* Google sign-in button */
.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    background: #ffffff;
    color: #3c4043;
    font-family: 'Inter', 'Roboto', sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.google-signin-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(116, 69, 245, 0.1),
        0 0 40px rgba(201, 46, 183, 0.08);
}

.google-signin-btn:active {
    background: #f1f3f4;
    transform: translateY(0);
}

.google-signin-btn svg { flex-shrink: 0; }

/* Stats footer */
.login-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(127, 73, 140, 0.12);
}

.login-stat { text-align: center; }

.login-stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--neon-teal), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-stat-label {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2px;
}

.login-footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: 0.65rem;
    color: rgba(108, 108, 128, 0.4);
    animation: login-fade-in 1s ease 1.8s both;
}

/* Login animations */
@keyframes login-entrance {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes login-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes login-float-up {
    0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    5%   { opacity: 0.15; }
    90%  { opacity: 0.15; }
    100% { transform: translateY(-100px) rotate(20deg); opacity: 0; }
}

@keyframes login-pulse-glow {
    0% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.1); }
}

@keyframes login-accent-slide {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes login-pulse-badge {
    0%, 100% { box-shadow: 0 2px 12px rgba(255, 0, 110, 0.4); }
    50% { box-shadow: 0 2px 20px rgba(255, 0, 110, 0.6); }
}

@keyframes login-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes login-chat-pop {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- Page Header ---------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ---------- Mobile Responsive ---------- */
@media (max-width: 959px) {
    .page-content {
        padding: 16px;
    }
}

@media (max-width: 599px) {
    .page-content {
        padding: 12px;
    }

    /* Reduce glass card padding on mobile */
    .glass-card {
        padding: 12px;
    }

    /* Login page mobile spacing */
    .stream-panel { max-width: 100%; }
    .panel-body { padding: 32px 24px 28px; }
    .login-stats { gap: 16px; }
    .login-chat-messages { gap: 6px; }

    .login-container {
        padding: 16px;
    }

    /* Page headers stack vertically on mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .page-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    /* Filter chips wrap on mobile */
    .filter-chips-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Category header actions wrap */
    .category-header {
        flex-wrap: wrap;
    }

    /* Live streams row scroll on mobile */
    .live-streams-row {
        gap: 12px;
    }

    .live-card {
        min-width: 240px;
    }

    /* Channel rows wrap on mobile */
    .ch-row {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }

    .ch-row-info {
        flex: 1 1 calc(100% - 60px);
        min-width: 0;
    }

    .ch-row-yt-id { display: none; }
    .ch-row-sep:first-of-type { display: none; }

    .ch-video-badge { order: 0; }

    .ch-row-actions {
        margin-left: auto;
    }

    /* Tags card grid single column on mobile */
    .tags-card-grid {
        grid-template-columns: 1fr;
    }

    .tags-category-header {
        flex-wrap: wrap;
    }
}

/* ============================================================
   Now Live - Cinematic Stream Cards
   ============================================================ */

.live-streams-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 0 8px;
    scrollbar-width: thin;
}

.live-streams-row::-webkit-scrollbar {
    height: 4px;
}

/* Cinematic live card with thumbnail background */
.live-card-cinematic {
    position: relative;
    min-width: 280px;
    max-width: 340px;
    border-radius: var(--border-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
    border: 1px solid rgba(255, 0, 110, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.live-card-cinematic:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(255, 0, 110, 0.15);
    border-color: rgba(255, 0, 110, 0.4);
    text-decoration: none;
    color: inherit;
}

.live-card-bg {
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-surface);
    filter: brightness(0.4);
    transition: filter 0.3s ease;
}

.live-card-cinematic:hover .live-card-bg {
    filter: brightness(0.5);
}

.live-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.95) 0%, rgba(10, 10, 15, 0.3) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
}

.live-card-badges {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.live-badge-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 0, 110, 0.9);
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.live-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: pulse-live 1.5s infinite;
}

.viewer-pill {
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.live-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.live-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.live-card-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-card-tags {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.live-pulse {
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Fallback for old live cards */
.live-badge {
    animation: pulse-live 2s infinite;
}

.live-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* ============================================================
   Timeline Hybrid Layout — Wider Grid + Info Panel (2K+)
   ============================================================ */

.timeline-layout {
    display: flex;
    align-items: flex-start;
}

.timeline-layout > .page-content {
    flex: 1;
    min-width: 0;
}

/* Panel hidden by default (< 1920px) */
.timeline-panel {
    display: none;
}

/* ---------- Panel: visible on 2K+ screens (1600px accounts for display scaling) ---------- */
@media (min-width: 1600px) {
    .timeline-layout > .page-content {
        max-width: none;
    }

    .timeline-panel {
        display: flex;
        flex-direction: column;
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 0;
        height: 100vh;
        border-left: 1px solid rgba(127, 73, 140, 0.12);
        background: rgba(14, 14, 21, 0.5);
        padding: 20px 16px;
        overflow-y: auto;
        gap: 20px;
        scrollbar-width: thin;
    }

    .timeline-panel::-webkit-scrollbar { width: 4px; }
    .timeline-panel::-webkit-scrollbar-thumb { background: rgba(127, 73, 140, 0.2); border-radius: 2px; }
}

/* ---------- Panel Sections ---------- */
.tp-section {
    display: flex;
    flex-direction: column;
}

.tp-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* ---------- Panel Stats Grid ---------- */
.tp-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tp-stat {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.tp-stat-val {
    font-size: 1.15rem;
    font-weight: 700;
}

.tp-stat-lbl {
    font-size: 0.5625rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tp-stat-teal .tp-stat-val  { color: var(--neon-teal); }
.tp-stat-green .tp-stat-val { color: var(--neon-green); }
.tp-stat-yellow .tp-stat-val { color: var(--neon-yellow); }
.tp-stat-pink .tp-stat-val  { color: var(--neon-pink); }

/* ---------- Panel Live Items ---------- */
.tp-live-item {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    background: var(--bg-surface);
    border: 1px solid rgba(255, 0, 110, 0.15);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
}

.tp-live-item:hover {
    border-color: rgba(255, 0, 110, 0.4);
    text-decoration: none;
    color: inherit;
}

.tp-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--neon-red);
    animation: pulse-live 1.5s infinite;
    flex-shrink: 0;
}

.tp-live-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tp-live-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tp-live-title {
    font-size: 0.625rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-live-viewers {
    font-size: 0.625rem;
    color: var(--neon-red);
    font-weight: 600;
    flex-shrink: 0;
}

/* ---------- Panel Recent Activity ---------- */
.tp-activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(127, 73, 140, 0.06);
}

.tp-activity-item:last-child {
    border-bottom: none;
}

.tp-act-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
}

.tp-act-count {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--neon-teal);
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(0, 245, 212, 0.08);
    margin-right: 6px;
}

.tp-act-time {
    font-size: 0.625rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    opacity: 0.7;
}
