/* ==========================================================================
   OpenCast Web - Modern Streaming & Radio Player Design System
   ========================================================================== */

:root {
    --bg-dark: var(--bg-page, #090B10);
    --surface-dark: var(--bg-surface, #121620);
    --surface-dark-elevated: var(--bg-surface-elevated, #161C2A);
    --surface-hover: var(--bg-surface-hover, #1E2538);
    --surface-card: var(--bg-card, rgba(255, 255, 255, 0.04));
    --border-color: var(--border, rgba(255, 255, 255, 0.08));
    --border-highlight: var(--border-focus, #17A9F7);

    --brand-primary: #17A9F7;
    --brand-secondary: #0284C7;
    --brand-accent: #FF5364;
    --brand-gradient: #17A9F7;
    --brand-glow: var(--glow, rgba(23, 169, 247, 0.28));

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --sidebar-width: 250px;
    --player-height: 82px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Background Atmosphere Glow */
.bg-glow-layer {
    display: none;
}

/* App Shell Layout */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    padding-bottom: var(--player-height);
    position: relative;
    z-index: 1;
}

/* Sidebar Navigation */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--surface-dark);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    padding: 0 10px 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo .brand-logo-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    box-shadow: 0 4px 12px var(--brand-glow);
}

.sidebar-logo span,
.sidebar-logo .brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 20px;
    flex: 1;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.nav-btn svg {
    flex-shrink: 0;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.nav-btn.active {
    color: #fff;
    background: rgba(23, 169, 247, 0.12);
    border-left: 3px solid var(--brand-primary);
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-playstore-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.sidebar-playstore-btn:hover {
    color: var(--text-primary);
    background: var(--surface-dark-elevated);
    border-color: var(--border-highlight);
}

.sync-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sync-status-badge.status-synced {
    background: rgba(16, 185, 129, 0.12);
    color: #10B981;
}

.sync-status-badge.status-syncing {
    background: rgba(23, 169, 247, 0.15);
    color: var(--brand-primary);
}

/* Main Content Area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top App Header */
.app-header {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-color);
    background: var(--header-bg, rgba(9, 11, 16, 0.85));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 9;
}

.search-box-wrapper {
    position: relative;
    width: 100%;
    max-width: 440px;
}

.search-input {
    width: 100%;
    height: 42px;
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 0 16px 0 42px;
    color: var(--text-primary);
    font-size: 0.92rem;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(23, 169, 247, 0.18);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

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

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--brand-primary);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--brand-glow);
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(23, 169, 247, 0.4);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface-hover);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--surface-dark-elevated);
    border-color: var(--border-highlight);
}

/* User Profile Avatar Dropdown */
.user-profile-btn {
    display: none;
    align-items: center;
    gap: 10px;
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 4px 14px 4px 4px;
    cursor: pointer;
    color: var(--text-primary);
    transition: border-color 0.2s ease;
    position: relative;
}

.user-profile-btn:hover {
    border-color: var(--brand-primary);
}

.user-avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-dropdown-menu {
    position: absolute;
    top: 52px;
    right: 0;
    width: 220px;
    background: var(--surface-dark-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 100;
}

.user-dropdown-menu.show {
    display: flex;
}

.dropdown-header {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.dropdown-header-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dropdown-header-email {
    font-size: 0.76rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: transparent;
    border: none;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.dropdown-item-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* Content Views Container */
.content-viewport {
    flex: 1;
    padding: 28px 32px 40px;
}

.tab-content-panel {
    display: none;
}

.tab-content-panel.active {
    display: block;
    animation: fadeIn 0.25s ease forwards;
}

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

/* Discover Hero */
.discover-hero-banner {
    position: relative;
    background: var(--surface-dark-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    margin-bottom: 32px;
    overflow: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, margin-bottom 0.25s ease;
}

[data-theme="light"] .discover-hero-banner {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
}

html.welcome-dismissed #discover-hero-banner,
.discover-hero-banner.dismissed {
    display: none !important;
}

.hero-dismiss-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
}

.hero-dismiss-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.16);
    transform: scale(1.08);
}

[data-theme="light"] .hero-dismiss-btn {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .hero-dismiss-btn:hover {
    background: rgba(15, 23, 42, 0.12);
}

.discover-hero-content {
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.discover-hero-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(23, 169, 247, 0.2);
    border-radius: var(--radius-full);
    color: var(--brand-primary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.discover-hero-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

.discover-hero-title span {
    color: var(--brand-primary);
}

.discover-hero-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 18px;
}

/* Filter Pills Rows */
.filter-scroll-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 24px;
    scrollbar-width: none;
}

.filter-scroll-row::-webkit-scrollbar {
    display: none;
}

.filter-pill, .category-pill, .lang-pill {
    padding: 7px 16px;
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filter-pill:hover, .category-pill:hover, .lang-pill:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.filter-pill.active, .category-pill.active, .lang-pill.active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
    box-shadow: 0 4px 12px var(--brand-glow);
}

/* Section Titles */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 28px 0 16px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Shows Grid */
.shows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.show-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.show-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.card-artwork-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #0f141f;
}

.card-artwork {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.show-card:hover .card-artwork {
    transform: scale(1.04);
}

.card-play-overlay-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.2s ease;
    cursor: pointer;
}

.show-card:hover .card-play-overlay-btn {
    opacity: 1;
    transform: translateY(0);
}

.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.card-badge.custom-badge {
    background: var(--brand-secondary);
}

.card-info {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.card-author {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-category {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.btn-card-follow {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-card-follow.following {
    background: rgba(23, 169, 247, 0.15);
    color: var(--brand-primary);
    border-color: rgba(23, 169, 247, 0.4);
}

/* Radio Cards Grid */
.radio-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.radio-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
}

.radio-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.radio-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.radio-card-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-fav-star {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    transition: transform 0.15s ease, color 0.15s ease;
}

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

.btn-fav-star.active {
    color: #F59E0B;
}

.radio-card-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.radio-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-accent);
    display: inline-block;
    box-shadow: 0 0 8px var(--brand-accent);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

.radio-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.tag-badge {
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.btn-play-radio-stream {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px;
    background: rgba(23, 169, 247, 0.14);
    color: var(--brand-primary);
    border: 1px solid rgba(23, 169, 247, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-play-radio-stream:hover {
    background: var(--brand-primary);
    color: #fff;
}

/* Radio mini row for Discover */
.radio-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.radio-mini-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.radio-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.radio-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.radio-mini-info {
    flex: 1;
    min-width: 0;
}

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

.radio-mini-meta {
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.btn-play-radio-mini {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(23, 169, 247, 0.15);
    color: var(--brand-primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-play-radio-mini:hover {
    background: var(--brand-primary);
    color: #fff;
}

/* Custom RSS Form */
.custom-rss-panel {
    max-width: 760px;
    margin: 0 auto;
}

.custom-rss-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
}

.custom-rss-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.custom-rss-header p {
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.5;
    margin-bottom: 24px;
}

.rss-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.rss-url-input {
    flex: 1;
    height: 48px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

.rss-url-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(23, 169, 247, 0.18);
}

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

.custom-rss-result-card {
    background: var(--surface-dark-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.rss-result-art {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.rss-result-info {
    flex: 1;
}

.rss-result-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.rss-result-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.rss-result-desc {
    margin: 8px 0 14px;
    color: var(--text-muted) !important;
}

.rss-result-actions {
    display: flex;
    gap: 12px;
}

/* Library Sub Navigation */
.library-sub-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.sub-tab-btn {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sub-tab-btn:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.sub-tab-btn.active {
    background: var(--surface-dark);
    color: var(--brand-primary);
    border-color: rgba(23, 169, 247, 0.3);
}

.library-sub-panel {
    display: none;
}

.library-sub-panel.active {
    display: block;
}

/* History List Rows */
.history-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.btn-clear-history {
    background: transparent;
    border: none;
    color: var(--brand-accent);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.history-item-row {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    transition: background 0.15s ease;
}

.history-item-row:hover {
    background: var(--surface-hover);
}

.history-item-artwork {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.history-item-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-play-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.history-item-row:hover .history-play-btn {
    opacity: 1;
}

.history-item-info {
    flex: 1;
    min-width: 0;
}

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

.history-item-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.history-progress-bar-wrapper {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.history-progress-bar {
    height: 100%;
    background: var(--brand-primary);
    border-radius: var(--radius-full);
}

.history-item-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.status-badge.completed {
    color: #10B981;
    font-weight: 700;
}

.btn-delete-history {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    transition: color 0.15s ease;
}

.btn-delete-history:hover {
    color: var(--brand-accent);
}

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

.playlist-create-card {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.playlist-create-card:hover {
    border-color: var(--brand-primary);
    background: rgba(23, 169, 247, 0.05);
}

.create-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--surface-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--brand-primary);
}

.playlist-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.playlist-card-artwork {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: rgba(23, 169, 247, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.playlist-card-info {
    flex: 1;
    min-width: 0;
}

.playlist-card-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-card-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-delete-playlist {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    transition: color 0.15s ease;
}

.btn-delete-playlist:hover {
    color: var(--brand-accent);
}

/* Sticky / Bottom Audio Player */
.bottom-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--player-height);
    background: var(--player-bg, rgba(14, 18, 27, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow-lg, 0 -8px 24px rgba(0, 0, 0, 0.5));
    opacity: 0;
    pointer-events: none;
    transform: translateY(100%);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-player-bar.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.player-left {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 280px;
    cursor: pointer;
}

.player-artwork-thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #090B10;
    flex-shrink: 0;
}

.player-track-meta {
    flex: 1;
    min-width: 0;
}

.player-track-title {
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.player-track-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: rgba(244, 63, 94, 0.18);
    color: var(--brand-accent);
    font-size: 0.68rem;
    font-weight: 800;
}

/* Center Controls */
.player-center {
    flex: 1;
    max-width: 620px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.player-buttons-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.player-btn-circle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.player-btn-circle:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.btn-main-play {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff !important;
    box-shadow: 0 4px 14px var(--brand-glow);
}

.btn-main-play:hover {
    transform: scale(1.08) !important;
    background: #25b4ff;
}

.player-timeline-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-time {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    width: 44px;
}

.timeline-time.time-left {
    text-align: right;
}

.range-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.22);
    accent-color: var(--brand-primary);
    outline: none;
    cursor: pointer;
    transition: height 0.15s ease;
}

[data-theme="light"] .range-slider {
    background: #CBD5E1;
}

.range-slider:hover {
    height: 6px;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--brand-primary);
    cursor: pointer;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
    border: 2px solid #FFFFFF;
}

.range-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--brand-primary);
    cursor: pointer;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
    border: 2px solid #FFFFFF;
}

.range-slider::-moz-range-track {
    height: 4px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.22);
}

[data-theme="light"] .range-slider::-moz-range-track {
    background: #CBD5E1;
}

/* Mobile top mini-player progress bar */
.player-top-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 10;
    pointer-events: none;
}

[data-theme="light"] .player-top-progress-bar {
    background: #E2E8F0;
}

.player-top-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--brand-primary);
    transition: width 0.15s linear;
}

.mobile-play-btn {
    display: none;
}

/* Right Controls */
.player-right {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 280px;
    justify-content: flex-end;
}

.volume-control-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 110px;
}

.volume-slider {
    width: 100%;
}

.btn-pill-small {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-pill-small:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.14);
}

.sleep-timer-badge {
    display: none;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 83, 100, 0.2);
    color: var(--brand-accent);
    font-size: 0.72rem;
    font-weight: 700;
}

/* Speed Dropdown Menu */
.speed-dropdown {
    position: absolute;
    bottom: 90px;
    right: 180px;
    background: var(--surface-dark-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    z-index: 1001;
}

.speed-dropdown.show {
    display: flex;
}

.speed-chip {
    padding: 6px 14px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    text-align: left;
}

.speed-chip:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.speed-chip.active {
    background: var(--brand-primary);
    color: #fff;
}

/* Modals Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-backdrop, rgba(0, 0, 0, 0.75));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

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

.modal-content-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: var(--shadow-modal, 0 20px 40px rgba(0, 0, 0, 0.6));
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1E293B;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 100 !important;
}

.modal-close-btn:hover {
    color: #FFFFFF;
    background: #334155;
    transform: scale(1.05);
}

/* Show Detail Modal Specifics */
.show-detail-modal-card {
    width: 90%;
    max-width: 800px;
    max-height: 88vh;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.show-header-cover {
    display: flex;
    gap: 24px;
    padding: 24px 28px;
    background: var(--surface-dark-elevated);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    position: relative;
}

[data-theme="light"] .show-header-cover {
    background: #F8FAFC;
}

.modal-show-art {
    width: 140px;
    height: 140px;
    border-radius: var(--radius-md);
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    background: #0f141f;
}

.modal-show-meta {
    flex: 1;
    min-width: 0;
    padding-right: 36px;
}

.modal-show-meta h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    line-height: 1.25;
}

.modal-show-author {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 12px;
}

.modal-show-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.show-episodes-section {
    padding: 16px 28px 24px;
    flex: 1;
    overflow-y: auto;
}

.episode-row-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 12px;
    border-radius: var(--radius-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease;
}

.episode-row-item:hover {
    background: var(--surface-hover);
}

.btn-episode-play {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(23, 169, 247, 0.15);
    color: var(--brand-primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.btn-episode-play:hover {
    background: var(--brand-primary);
    color: #fff;
    transform: scale(1.08);
}

.episode-row-content {
    flex: 1;
    min-width: 0;
}

.episode-row-title {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-row-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.resume-pill {
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(23, 169, 247, 0.18);
    color: var(--brand-primary);
    font-weight: 700;
}

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

.btn-row-like, .btn-row-playlist {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    transition: color 0.15s ease;
}

.btn-row-like:hover, .btn-row-playlist:hover {
    color: var(--text-primary);
}

.btn-row-like.liked {
    color: var(--brand-accent);
}

/* Expanded Player Modal */
.expanded-player-card {
    max-width: 480px;
    text-align: center;
}

.exp-artwork-container {
    width: 260px;
    height: 260px;
    margin: 0 auto 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
    background: #090B10;
}

.exp-artwork-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.exp-track-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.exp-track-show {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 24px;
}

.exp-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin: 20px 0;
}

/* Auth Modal Forms */
.auth-tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.auth-tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.auth-tab-btn.active {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-google-sign-in {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: #ffffff;
    color: #1a1a1a;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    transition: background 0.2s ease;
}

.btn-google-sign-in:hover {
    background: #f1f5f9;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    text-align: left;
}

.auth-form-group label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.auth-input {
    height: 44px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    color: var(--text-primary);
    font-size: 0.92rem;
    outline: none;
}

.auth-input:focus {
    border-color: var(--brand-primary);
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
}

.auth-switch-link {
    background: transparent;
    border: none;
    color: var(--brand-primary);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 14px;
    display: inline-block;
}

/* Sleep Timer Modal choices */
.sleep-choices-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.sleep-choice-btn {
    padding: 12px;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sleep-choice-btn:hover {
    background: var(--brand-primary);
    color: #fff;
}

/* Playlist Picker */
.playlist-picker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 18px 0;
    max-height: 240px;
    overflow-y: auto;
}

.playlist-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.playlist-picker-item.active {
    border-color: #10B981;
    color: #10B981;
}

/* Floating Toast */
.app-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: #161C2A;
    border: 1.5px solid var(--brand-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    color: #F8FAFC;
    padding: 10px 14px 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 3000;
    opacity: 0;
    transform: translateY(-12px);
    transition: all 0.25s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

[data-theme="light"] .app-toast {
    background: #FFFFFF;
    color: #0F172A;
    border: 1.5px solid var(--brand-primary);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.15);
}

.app-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast-message {
    flex: 1;
    line-height: 1.35;
}

.toast-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.05rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.toast-close-btn:hover {
    color: var(--brand-accent);
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .toast-close-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.btn-close-player {
    color: var(--text-secondary);
}

.btn-close-player:hover {
    color: var(--brand-accent) !important;
    background: var(--surface-hover);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-sidebar {
        display: none;
    }

    .app-main {
        width: 100%;
    }

    .content-viewport {
        padding: 18px 16px 80px;
    }

    .app-header {
        height: 60px;
        padding: 0 12px;
        gap: 8px;
    }

    .search-box-wrapper {
        flex: 1;
        min-width: 0;
    }

    .search-input {
        height: 38px;
        font-size: 0.86rem;
        padding: 0 12px 0 36px;
    }

    .search-icon {
        left: 10px;
        width: 16px;
        height: 16px;
    }

    .header-actions {
        gap: 8px;
        flex-shrink: 0;
    }

    #btn-open-auth {
        height: 36px;
        padding: 0 12px;
        font-size: 0.82rem;
        white-space: nowrap;
        flex-shrink: 0;
        border-radius: var(--radius-full);
    }

    .app-toast {
        top: 14px;
        right: 14px;
        left: 14px;
        text-align: center;
    }

    .bottom-player-bar {
        padding: 0 12px;
        height: 68px;
        bottom: 60px;
    }

    .player-left {
        width: auto;
        max-width: 58%;
        gap: 10px;
    }

    .player-left .track-info-wrapper {
        min-width: 0;
    }

    .player-left .track-title,
    .player-left .track-show {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .player-center {
        display: none;
    }

    .player-right {
        width: auto;
        gap: 8px;
    }

    .player-right #btn-speed-toggle,
    .player-right #btn-sleep-timer {
        display: none !important;
    }

    .mobile-play-btn {
        display: flex !important;
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 50%;
        background: var(--brand-primary);
        color: #FFFFFF;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(23, 169, 247, 0.35);
        border: none;
        cursor: pointer;
        padding: 0;
    }

    .mobile-play-btn:active {
        transform: scale(0.92);
    }

    .volume-control-wrapper {
        display: none;
    }

    /* Mobile bottom navigation bar */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: var(--surface-dark);
        border-top: 1px solid var(--border-color);
        z-index: 999;
        justify-content: space-around;
        align-items: center;
    }

    .mobile-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 600;
        text-decoration: none;
        background: transparent;
        border: none;
        cursor: pointer;
    }

    .mobile-nav-btn.active {
        color: var(--brand-primary);
    }

    .bottom-player-bar {
        bottom: 60px;
    }

    /* Mobile Modal Drawer System (Full-Width Bottom Sheet) */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content-card {
        border-radius: 20px 20px 0 0;
        max-height: 94vh;
    }

    .show-detail-modal-card {
        width: 100% !important;
        max-width: 100% !important;
        height: 94vh !important;
        max-height: 94vh !important;
        border-radius: 22px 22px 0 0 !important;
        border-bottom: none !important;
        border-left: none !important;
        border-right: none !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .modal-close-btn {
        top: 14px;
        right: 14px;
        width: 36px;
        height: 36px;
        z-index: 100 !important;
    }

    .show-header-cover {
        padding: 16px 14px;
        gap: 14px;
        align-items: flex-start;
    }

    .modal-show-art {
        width: 86px !important;
        height: 86px !important;
        min-width: 86px !important;
        border-radius: 12px;
    }

    .modal-show-meta {
        padding-right: 32px;
    }

    .modal-show-meta h2 {
        font-size: 1.15rem;
        line-height: 1.25;
        margin-bottom: 2px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .modal-show-author {
        font-size: 0.8rem;
        margin-bottom: 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .modal-show-actions {
        gap: 8px;
    }

    .modal-show-actions .btn-primary,
    .modal-show-actions .btn-secondary {
        padding: 6px 12px;
        font-size: 0.8rem;
        height: 34px;
    }

    .modal-episode-search-wrapper {
        padding: 10px 14px;
    }

    .modal-episode-search-input {
        height: 36px;
        font-size: 0.84rem;
        border-radius: var(--radius-full);
    }

    .show-episodes-section {
        padding: 8px 12px 32px;
        flex: 1;
        overflow-y: auto;
        max-height: none;
    }

    .episode-row-item {
        padding: 12px 8px;
        gap: 10px;
        align-items: flex-start;
    }

    .btn-episode-play {
        width: 36px;
        height: 36px;
        min-width: 36px;
        margin-top: 2px;
    }

    .episode-row-content {
        flex: 1;
        min-width: 0;
    }

    .episode-row-title {
        font-size: 0.88rem;
        font-weight: 700;
        line-height: 1.3;
        margin-bottom: 3px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .episode-row-desc {
        font-size: 0.78rem;
        line-height: 1.35;
        margin-bottom: 5px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .episode-row-meta {
        font-size: 0.72rem;
        gap: 6px;
    }

    .episode-row-actions {
        display: flex;
        gap: 2px;
        align-items: center;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .btn-row-like, .btn-row-playlist {
        padding: 5px;
    }

    .expanded-player-card {
        width: 100% !important;
        max-width: 100% !important;
        height: 94vh !important;
        max-height: 94vh !important;
        border-radius: 22px 22px 0 0 !important;
        border-bottom: none !important;
        margin: 0 !important;
        padding: 24px 18px 40px !important;
    }

    .exp-artwork-container {
        width: 200px;
        height: 200px;
        margin-bottom: 18px;
    }
}

@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none;
    }
}

/* Empty states and loaders */
.empty-state {
    padding: 48px 24px;
    text-align: center;
    background: var(--surface-dark);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.15rem;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 32px auto;
}

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

/* ==========================================================================
   Search Layouts & Tab Enhancements
   ========================================================================== */

.tab-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin-bottom: 24px;
}

.tab-search-input {
    width: 100%;
    height: 48px;
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 46px 0 44px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.tab-search-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(23, 169, 247, 0.18);
}

.tab-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.search-clear-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.search-clear-btn.visible {
    display: flex;
}

/* Search Results Container Overlay */
.search-results-container {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

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

.btn-close-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-close-search:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

/* Searched Podcast Cards Grid */
.search-podcasts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.search-podcast-card {
    background: var(--surface-dark-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.search-podcast-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: var(--surface-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.search-podcast-thumb {
    width: 68px;
    height: 68px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: #090B10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.search-podcast-info {
    flex: 1;
    min-width: 0;
}

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

.search-podcast-author {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.search-podcast-tags {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-podcast-genre {
    font-size: 0.72rem;
    color: var(--brand-primary);
    background: rgba(23, 169, 247, 0.12);
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.search-podcast-count {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Modal episode search input */
.modal-episode-search-wrapper {
    position: sticky;
    top: 0;
    background: var(--surface-dark);
    padding: 12px 28px;
    border-bottom: 1px solid var(--border-color);
    z-index: 2;
}

.modal-episode-search-input {
    width: 100%;
    height: 38px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
}

.modal-episode-search-input:focus {
    border-color: var(--brand-primary);
}

/* ==========================================================================
   Light Mode Explicit Overrides & Polish
   ========================================================================== */

[data-theme="light"] .show-card,
[data-theme="light"] .radio-card,
[data-theme="light"] .custom-rss-card,
[data-theme="light"] .playlist-card {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.02);
}

[data-theme="light"] .show-card:hover,
[data-theme="light"] .radio-card:hover,
[data-theme="light"] .custom-rss-card:hover,
[data-theme="light"] .playlist-card:hover {
    border-color: rgba(15, 23, 42, 0.16);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .episode-item {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .episode-item:hover {
    background: #F8FAFC;
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .search-input,
[data-theme="light"] .form-input,
[data-theme="light"] .modal-episode-search-input {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.14);
    color: #0F172A;
}

[data-theme="light"] .search-input:focus,
[data-theme="light"] .form-input:focus,
[data-theme="light"] .modal-episode-search-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(23, 169, 247, 0.15);
}

[data-theme="light"] .card-artwork-wrapper,
[data-theme="light"] .player-artwork-thumb,
[data-theme="light"] .search-podcast-thumb {
    background: #E2E8F0;
}

[data-theme="light"] .nav-btn:hover {
    background: rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .nav-btn.active {
    background: rgba(23, 169, 247, 0.12);
    color: var(--brand-primary);
}

[data-theme="light"] .bottom-player-bar {
    background: rgba(255, 255, 255, 0.96);
    border-top-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .user-dropdown-menu {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .dropdown-item-btn:hover {
    background: #F1F5F9;
}

[data-theme="light"] .modal-close-btn {
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    color: #1E293B;
}

[data-theme="light"] .modal-close-btn:hover {
    background: #E2E8F0;
    color: #0F172A;
}

[data-theme="light"] .modal-content-card {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16);
}

[data-theme="light"] .modal-episode-search-wrapper {
    background: #FFFFFF;
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .episode-row-item {
    border-bottom-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .episode-row-item:hover {
    background: #F8FAFC;
}


