@property --play-color-1 {
    syntax: '<color>';
    inherits: false;
    initial-value: #10b981;
}
@property --play-color-2 {
    syntax: '<color>';
    inherits: false;
    initial-value: #8b5cf6;
}

:root {
    --bg-base: #07080a;
    --bg-sidebar: #0d0f12;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-panel: rgba(18, 20, 24, 0.65);
    
    --primary: #10b981; /* Emerald green */
    --primary-hover: #34d399;
    --primary-rgb: 16, 185, 129;
    
    --secondary: #8b5cf6; /* Violet */
    --secondary-hover: #a78bfa;
    --secondary-rgb: 139, 92, 246;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-sub: #6b7280;
    
    --glass-border: rgba(255, 255, 255, 0.04);
    --glass-shadow: rgba(0, 0, 0, 0.4);
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    
    --font-primary: 'Outfit', sans-serif;
    --font-secondary: 'Plus Jakarta Sans', sans-serif;
    
    --sidebar-width: 240px;
    --player-height: 116px;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* App Layout */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 100vh;
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden;
}

/* Ambient Glow */
.ambient-glow {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.15) 0%, rgba(var(--secondary-rgb), 0.08) 40%, rgba(0,0,0,0) 70%);
    filter: blur(140px);
    z-index: 0;
    pointer-events: none;
    transition: background 2s cubic-bezier(0.2, 0.8, 0.2, 1);
    animation: aurora-pulse 15s infinite alternate ease-in-out;
    opacity: 0.85;
}

@keyframes aurora-pulse {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(-5%, 5%) scale(1.1) rotate(10deg);
    }
    100% {
        transform: translate(5%, -5%) scale(0.95) rotate(-5deg);
    }
}

/* Sidebar */
.sidebar {
    background-color: var(--bg-sidebar);
    padding: 24px 16px var(--player-height);
    display: flex;
    flex-direction: column;
    z-index: 10;
    border-right: 1px solid var(--glass-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-primary);
    font-weight: 800;
    font-size: 24px;
    color: var(--text-main);
    margin-bottom: 30px;
    padding-left: 8px;
    letter-spacing: -0.5px;
}

.logo span {
    background: linear-gradient(135deg, var(--text-main) 50%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo svg {
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(var(--primary-rgb), 0.5));
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    color: var(--text-main);
    background-color: var(--bg-card-hover);
}

.nav-item.active {
    color: var(--text-main);
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.12) 0%, rgba(var(--secondary-rgb), 0.04) 100%);
    border-left: 3px solid var(--primary);
}

.nav-item.active svg {
    stroke: var(--primary);
    filter: drop-shadow(0 0 4px rgba(var(--primary-rgb), 0.3));
}

.library-header {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    color: var(--text-muted);
    font-family: var(--font-secondary);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    margin-bottom: 8px;
    gap: 10px;
}

.library-header span {
    flex-grow: 1;
}

.add-playlist-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.add-playlist-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-playlists {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.playlist-item.active {
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.12) 0%, rgba(var(--secondary-rgb), 0.04) 100%);
    border-left: 3px solid var(--primary);
}

.playlist-cover-tiny {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.playlist-name-tiny {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-count-tiny {
    font-size: 11px;
    color: var(--text-sub);
    font-family: var(--font-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.playlist-item-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

.playlist-item:hover .playlist-name-tiny,
.playlist-item.active .playlist-name-tiny {
    color: var(--text-main);
}

/* Playlist cover mosaic (2x2 grid) */
.cover-mosaic {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
}

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

.sidebar-mosaic {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    flex-shrink: 0;
}

.cover-gradient-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}


/* Main Content */
.main-content {
    grid-column: 2;
    background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-base) 100%);
    overflow-y: auto;
    padding: 24px 32px var(--player-height);
    z-index: 5;
    position: relative;
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    height: 56px;
    margin-bottom: 32px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: transparent;
    pointer-events: none;
}
.topbar * {
    pointer-events: auto;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 8px 16px;
    width: 380px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-container:focus-within {
    width: 440px;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.15);
}

.search-icon {
    color: var(--text-muted);
    margin-right: 12px;
    flex-shrink: 0;
}

.search-container input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: var(--font-secondary);
    font-size: 14px;
    width: 100%;
}

.search-container input:-webkit-autofill,
.search-container input:-webkit-autofill:hover, 
.search-container input:-webkit-autofill:focus,
.search-container input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text-main) !important;
    -webkit-box-shadow: 0 0 0px 1000px #121418 inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.search-container input::placeholder {
    color: var(--text-sub);
}

.spacer {
    flex-grow: 1;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile .avatar {
    width: 28px;
    height: 28px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
    color: #000;
}

.user-profile .username {
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-secondary);
}

/* Welcome Grid (Recently Played) */
.greeting {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

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

.quick-card {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--card-accent, var(--primary));
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.quick-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-3px) scale(1.01);
    border-color: rgba(var(--card-accent-rgb, var(--primary-rgb)), 0.2);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(var(--card-accent-rgb, var(--primary-rgb)), 0.15);
}

.quick-card-cover {
    width: 80px;
    height: 80px;
    object-fit: cover;
    flex-shrink: 0;
}

.quick-card-details {
    padding: 0 16px;
    flex-grow: 1;
    overflow: hidden;
}

.quick-card-title {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.quick-card-artist {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-secondary);
}

.quick-card-play {
    position: absolute;
    right: 16px;
    width: 42px;
    height: 42px;
    background-color: var(--card-accent, var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(var(--card-accent-rgb, var(--primary-rgb)), 0.4);
}

.quick-card:hover .quick-card-play {
    opacity: 1;
    transform: scale(1);
}

.quick-card-play:hover {
    background-color: var(--card-accent, var(--primary));
    filter: brightness(1.15);
    transform: scale(1.1) !important;
}

/* Category Grid & Cards */
.section-title-wrapper {
    margin-bottom: 18px;
}

.section-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 20px;
}

.music-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.music-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--card-shadow);
}

.card-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.music-card-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.music-card-gradient {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 40px;
}

.card-play-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    border: none;
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

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

.card-play-btn:hover {
    background-color: var(--primary-hover);
    transform: scale(1.08);
}

.music-card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-secondary);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Genre Search Cards */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.genre-card {
    aspect-ratio: 1.3;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.2s ease;
}

.genre-card:hover {
    transform: scale(1.02);
}

.genre-card h3 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Playlist details */
.playlist-header {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--glass-border);
}

.playlist-cover-large {
    width: 190px;
    height: 190px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.playlist-header-details {
    display: flex;
    flex-direction: column;
}

.playlist-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--primary);
    margin-bottom: 8px;
}

.playlist-title-large {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.1;
    letter-spacing: -1px;
}

.playlist-meta {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-secondary);
}

.playlist-actions-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}

.playlist-play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--primary);
    border: none;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.playlist-play-btn:hover {
    background-color: var(--primary-hover);
    transform: scale(1.06);
}

.playlist-action-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--text-sub);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.playlist-action-secondary:hover {
    color: var(--text-main);
    border-color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Playlist / Search Songs Table */
.playlist-songs-table, .search-results-table {
    margin-top: 10px;
}

/* Empty playlist state */
.empty-playlist-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    gap: 12px;
}

.empty-playlist-icon {
    color: var(--text-sub);
    margin-bottom: 8px;
    opacity: 0.5;
}

.empty-playlist-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.empty-playlist-sub {
    font-size: 14px;
    color: var(--text-muted);
    font-family: var(--font-secondary);
    margin-bottom: 8px;
}

.empty-find-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

.table-header, .table-row {
    display: grid;
    grid-template-columns: 48px 2.5fr 1.5fr 100px 80px;
    align-items: center;
    font-size: 13px;
    font-family: var(--font-secondary);
    padding: 8px 16px;
}

.table-header {
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.table-row {
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background-color 0.2s ease;
}

.table-row:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.table-row.playing {
    background-color: rgba(var(--primary-rgb), 0.06);
}

.table-row.playing .col-title-wrapper h4,
.table-row.playing .col-num {
    color: var(--primary);
}

.col-num {
    font-weight: 600;
    font-size: 14px;
    text-align: center;
}

.table-row .col-num-play {
    display: none;
    cursor: pointer;
    color: var(--primary);
    align-items: center;
    justify-content: center;
}

.table-row:hover .col-num-text {
    display: none;
}
.table-row:hover .col-num-play {
    display: flex;
}
.table-row:hover .playing-equalizer {
    display: none !important;
}

.col-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.col-title-cover {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.col-title-details {
    overflow: hidden;
}

.col-title-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.col-title-details span {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-album {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    color: var(--text-muted);
}

.table-row:hover .col-album {
    color: var(--text-main);
}

.col-time {
    color: var(--text-muted);
    font-size: 13px;
}

.col-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.row-action-btn {
    background: transparent;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0; /* Only show on row hover */
}

.table-row:hover .row-action-btn {
    opacity: 1;
}

.row-action-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.row-action-btn.active {
    opacity: 1;
    color: var(--primary);
}


/* Right Panel (Lyrics / YouTube Player Canvas) */
.canvas-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100vh;
    background: rgba(13, 15, 18, 0.96);
    border-left: 1px solid var(--glass-border);
    backdrop-filter: blur(25px);
    width: 340px;
    z-index: 15;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateX(0);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    padding-bottom: var(--player-height);
}

.canvas-panel.collapsed {
    transform: translateX(100%);
    pointer-events: none;
    border-left-color: transparent !important;
}

.canvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
    gap: 8px;
}

/* Canvas tab switcher */
.canvas-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 3px;
    flex: 1;
}

.canvas-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
    padding: 7px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.canvas-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.canvas-tab.active {
    background: rgba(255, 255, 255, 0.10);
    color: var(--text-main);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.close-canvas {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 0.5;
}

.close-canvas:hover {
    color: var(--text-main);
}

.canvas-container {
    padding: 20px;
    display: flex;
    justify-content: center;
}

/* We style the YouTube embedded player nicely */
#ytPlayerFrameContainer {
    width: 100%;
    aspect-ratio: 1.77;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--glass-border);
    background-color: #000;
    transition: opacity 0.3s ease;
}

/* Backgrounded player container helper to maintain mobile playback when sidebar is closed/lyrics are active */
#ytPlayerFrameContainer.yt-player-backgrounded {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 200px !important;
    height: 112px !important;
    opacity: 0.001 !important;
    z-index: -9999 !important;
    pointer-events: none !important;
    transform: none !important;
    visibility: visible !important;
    display: block !important;
    box-shadow: none !important;
    border: none !important;
}

.canvas-video-container-hidden {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

#ytPlayer {
    width: 100%;
    height: 100%;
}

.canvas-lyrics {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.canvas-lyrics h4 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lyrics-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
    font-weight: 500;
    white-space: pre-line;
    transition: all 0.3s ease;
}

.lyrics-line {
    padding: 8px 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    opacity: 0.4;
    font-size: 14px;
    font-weight: 600;
}

.lyrics-line:hover {
    opacity: 0.8;
}

.lyrics-line.active {
    color: var(--primary);
    opacity: 1;
    font-size: 17px;
    font-weight: 800;
    transform: scale(1.03);
    text-shadow: 0 0 12px rgba(var(--primary-rgb), 0.35);
}

/* Fullscreen Specific Synced Lyrics */
.fullscreen-lyrics-text .lyrics-line {
    font-size: 1.6rem;
    line-height: 1.8;
    padding: 10px 0;
    opacity: 0.45 !important;
    color: rgba(255, 255, 255, 0.45) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: left;
}

.fullscreen-lyrics-text .lyrics-line:hover {
    opacity: 0.8 !important;
    color: white !important;
}

.fullscreen-lyrics-text .lyrics-line.active {
    color: var(--primary) !important;
    opacity: 1 !important;
    font-size: 2.1rem;
    font-weight: 800;
    transform: scale(1.04) translateX(10px) !important;
    text-shadow: 0 0 20px rgba(var(--primary-rgb), 0.85), 0 0 10px rgba(var(--primary-rgb), 0.4) !important;
}


/* Bottom Player Bar */
.player-bar {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    height: 80px;
    background: rgba(13, 15, 18, 0.65);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 999;
    box-sizing: border-box;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.player-bar.inactive {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(120px) !important;
}

/* Left: Current Track */
.current-track {
    display: flex;
    align-items: center;
    width: 30%;
    min-width: 180px;
    gap: 14px;
}

.track-thumbnail {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

.track-info {
    overflow: hidden;
}

.track-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.track-artist {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-like-btn {
    background: transparent;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.track-like-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.track-like-btn.liked {
    color: var(--primary);
    filter: drop-shadow(0 0 4px rgba(var(--primary-rgb), 0.4));
}

.track-like-btn.liked fill {
    fill: var(--primary);
}


/* Center: Player Controls */
.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
    max-width: 500px;
    gap: 8px;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.control-btn:hover {
    color: var(--text-main);
}

.control-btn.active {
    color: var(--primary);
    position: relative;
}

.control-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 4px;
    height: 4px;
    background-color: var(--primary);
    border-radius: 50%;
}

.play-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    --play-color-1: var(--primary);
    --play-color-2: var(--secondary);
    background: linear-gradient(135deg, var(--play-color-1) 0%, var(--play-color-2) 100%) !important;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
    transition: --play-color-1 0.8s ease, --play-color-2 0.8s ease, box-shadow 0.8s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.play-btn:hover {
    transform: scale(1.08);
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.4), 0 0 10px rgba(var(--secondary-rgb), 0.2);
}

.progress-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.time-display {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-secondary);
    min-width: 30px;
    text-align: center;
}

.progress-bar-wrapper {
    flex-grow: 1;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: height 0.1s ease;
    overflow: visible;
}

.progress-bar-wrapper:hover {
    height: 6px;
}

.progress-bar-fill {
    height: 8px;
    width: 0%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 8' width='20' height='8'%3E%3Cpath d='M0,4 Q5,0 10,4 T20,4' fill='none' stroke='%2310b981' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 20px 8px;
    background-position: 0 center;
    animation: waveFlow 1.2s linear infinite;
    border-radius: 4px 0 0 4px;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0.6);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.15s ease-in-out;
}

.progress-bar-wrapper:hover .progress-bar-fill::after {
    transform: translateY(-50%) scale(1.2);
}


/* Right: Volume & Extra */
.extra-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 30%;
    min-width: 180px;
    gap: 8px;
}

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

.volume-slider-wrapper {
    flex-grow: 1;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.volume-slider-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 2px;
    position: relative;
}

.volume-slider-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0.6);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.15s ease-in-out;
}

.volume-slider-wrapper:hover .volume-slider-fill::after {
    transform: translateY(-50%) scale(1.2);
}


/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #121418;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: modalAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.modal-header h2 {
    font-size: 20px;
    font-weight: 800;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.modal-body input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px;
    color: white;
    font-family: var(--font-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

.modal-body input:focus {
    border-color: var(--primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
}

.btn-secondary:hover {
    color: var(--text-main);
}

.btn-primary {
    background-color: var(--primary);
    color: #000;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: scale(1.03);
}

/* Dropdown Menu (Add to playlist dropdown) */
.dropdown-menu {
    position: absolute;
    background: #16181f;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px 0;
    width: 180px;
    z-index: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sub);
    padding: 6px 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-item {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

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



/* ==========================================================================
   Fullscreen Player Mode
   ========================================================================== */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background-color: #060708;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 60px;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 1;
}

.fullscreen-overlay:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background-color: #060708 !important;
    padding: 40px 60px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.fullscreen-overlay:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    background-color: #060708 !important;
    padding: 40px 60px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.fullscreen-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96);
    display: none !important;
}

/* Fullscreen Background Blur */
.fullscreen-bg {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: blur(80px) brightness(0.2);
    transform: scale(1.1);
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.fullscreen-bg.active {
    opacity: 0.85;
}

.fullscreen-close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.fullscreen-close-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg) scale(1.08);
}

.fullscreen-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.fullscreen-layout {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 80px;
    align-items: center;
    flex-grow: 1;
    margin-top: 40px;
}

.fullscreen-art-wrapper {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px color-mix(in srgb, var(--extracted-glow-color, var(--primary)) 15%, transparent);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.5s ease-in-out, box-shadow 0.8s ease;
}

.fullscreen-overlay:not(.hidden) .fullscreen-art-wrapper {
    animation: pulseGlow 8s infinite alternate;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px color-mix(in srgb, var(--extracted-glow-color, var(--primary)) 15%, transparent);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 60px color-mix(in srgb, var(--extracted-glow-color, var(--primary)) 30%, transparent);
        transform: scale(1.02);
    }
}

.fullscreen-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fullscreen-info-lyrics {
    display: flex;
    flex-direction: column;
    height: 70%;
    justify-content: space-between;
    min-width: 0; /* Prevents grid layout overflow */
}

.fullscreen-track-details {
    margin-bottom: 24px;
}

.fullscreen-title {
    font-size: clamp(2rem, 3.8vw, 3.2rem);
    font-weight: 800;
    color: white;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 12px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fullscreen-artist {
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    color: var(--primary);
    font-family: var(--font-secondary);
    font-weight: 600;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fullscreen-lyrics-container {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 380px;
    padding-right: 20px;
    mask-image: linear-gradient(to bottom, transparent 0%, white 15%, white 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, white 15%, white 85%, transparent 100%);
}

.fullscreen-lyrics-text {
    font-size: 1.7rem;
    line-height: 1.9;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.35);
    white-space: pre-line;
    transition: all 0.3s ease;
}

.fullscreen-lyrics-text p {
    margin-bottom: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.fullscreen-lyrics-text p:hover {
    color: white;
}

.fullscreen-controls-bar {
    width: 100%;
    margin-top: auto;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.fs-progress {
    width: 100%;
    margin-bottom: 24px;
}

.fs-progress .time-display {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    min-width: 45px;
}

.fs-progress .progress-bar-wrapper {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.08);
    overflow: visible;
}

.fs-progress .progress-bar-wrapper:hover {
    height: 8px;
}

.fs-buttons {
    justify-content: center;
    gap: 32px;
}

.fs-buttons .control-btn {
    color: rgba(255, 255, 255, 0.5);
    padding: 8px;
}

.fs-buttons .control-btn:hover {
    color: white;
}

.fs-buttons .control-btn.active {
    color: var(--primary);
}

.fs-play {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.3);
}

.fs-play:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    filter: brightness(1.1);
    box-shadow: 0 6px 25px rgba(var(--primary-rgb), 0.5), 0 0 15px rgba(var(--secondary-rgb), 0.3);
    transform: scale(1.08);
}

/* ==========================================================================
   Clickability & Visual Polish (Spotify-like enhancement)
   ========================================================================== */
.table-row {
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.2s ease, box-shadow 0.2s ease;
}

.table-row:hover {
    transform: translateX(6px);
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.quick-card {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s ease, box-shadow 0.3s ease;
}

.quick-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.music-card {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s ease, box-shadow 0.3s ease;
}

.music-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.nav-item {
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleX(0);
    width: 4px;
    height: 16px;
    background-color: var(--primary);
    border-radius: 0 4px 4px 0;
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav-item:hover::before, .nav-item.active::before {
    transform: translateY(-50%) scaleX(1);
}

/* Responsive constraints for Fullscreen Layout */
@media (max-width: 1024px) {
    .fullscreen-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 30px;
        text-align: center;
        justify-content: center;
    }
    
    .fullscreen-art-wrapper {
        width: 280px;
        margin: 0 auto;
    }
    
    .fullscreen-info-lyrics {
        height: auto;
    }

    .fullscreen-title {
        font-size: 2.2rem;
    }
    
    .fullscreen-lyrics-container {
        max-height: 200px;
    }
}

/* Loading Spinner */
.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.25);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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


/* ==========================================================================
   Smooth Transitions & Track Switching Animations (Premium Polish)
   ========================================================================== */

/* 1. Track Info Switching Transitions (Fade Out & Slide Down) */
.current-track {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}
.current-track.switching {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
}

/* 2. Fullscreen Details (Fade Out & Slide Left) */
.fullscreen-track-details {
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease, filter 0.4s ease;
}
.fullscreen-track-details.switching {
    opacity: 0;
    transform: translateX(-30px);
    filter: blur(4px);
}

/* 3. Fullscreen Album Art (Fade Out, Shrink, Rotate & Blur) */
.fullscreen-art-wrapper {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease, filter 0.4s ease, box-shadow 0.6s ease;
}
.fullscreen-art-wrapper.switching {
    opacity: 0;
    transform: scale(0.8) rotate(-4deg);
    filter: blur(8px);
}

/* 4. Section Transitions (Smooth translation up and fade-in) */
.content-section {
    animation: sectionFadeIn 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

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

/* 5. Staggered Lyrics Line Entry Animation */
.fullscreen-lyrics-text .lyrics-line {
    animation: lyricsLineFadeIn 0.55s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    animation-delay: calc(var(--line-index, 0) * 0.025s);
    opacity: 0; /* Starts hidden and animates in dynamically */
}

@keyframes lyricsLineFadeIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 0.55;
        transform: translateY(0);
    }
}

/* 6. Active Equalizer Animation for Songs Table */
.playing-equalizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    width: 20px;
    height: 18px;
    margin: 0 auto;
}

.playing-equalizer .eq-bar {
    width: 3px;
    min-height: 3px;
    background: linear-gradient(to top, var(--primary), #34d399);
    border-radius: 2px 2px 1px 1px;
    box-shadow: 0 0 5px rgba(var(--primary-rgb), 0.6);
    animation: bounceEqualizer 0.7s ease-in-out infinite alternate;
    transform-origin: bottom;
}

.playing-equalizer .eq-bar-1 { animation-delay: 0.00s; animation-duration: 0.55s; }
.playing-equalizer .eq-bar-2 { animation-delay: 0.18s; animation-duration: 0.75s; }
.playing-equalizer .eq-bar-3 { animation-delay: 0.06s; animation-duration: 0.60s; }
.playing-equalizer .eq-bar-4 { animation-delay: 0.24s; animation-duration: 0.50s; }

@keyframes bounceEqualizer {
    0%   { height: 3px;  opacity: 0.7; }
    50%  { height: 12px; opacity: 1; }
    100% { height: 18px; opacity: 1; }
}

/* Freeze Equalizer Animation on Pause */
.table-row:not(.playing-state) .playing-equalizer .eq-bar {
    animation-play-state: paused !important;
    opacity: 0.45;
}

/* Row transition on active play state */
.table-row.playing {
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.08) 0%, transparent 100%) !important;
    border-left: 3px solid var(--primary);
    padding-left: 13px !important;
    transition: all 0.35s ease;
}

/* 7. Control Button Hover/Active Pop Animations */
.play-btn svg {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.play-btn:active {
    transform: scale(0.92) !important;
}
.play-btn:active svg {
    transform: scale(0.85);
}

.control-btn svg {
    transition: transform 0.2s ease, filter 0.2s ease;
}
.control-btn:hover svg {
    transform: scale(1.12);
}
.control-btn:active svg {
    transform: scale(0.9);
}

.track-like-btn:active svg {
    transform: scale(0.8);
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Smooth range slider track transitions */
.progress-bar-fill, .volume-slider-fill {
    transition: background-color 0.2s ease;
}

/* Play/Pause Button SVG animations (absolute layout for crossfading) */
.play-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.play-btn svg {
    position: absolute;
    transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

/* Default state: Play icon visible, Pause icon hidden */
.play-btn #playIcon, .play-btn #fsPlayIcon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.play-btn #pauseIcon, .play-btn #fsPauseIcon {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

/* Playing state: Play icon hidden, Pause icon visible */
.play-btn.playing #playIcon, .play-btn.playing #fsPlayIcon {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

.play-btn.playing #pauseIcon, .play-btn.playing #fsPauseIcon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* 60fps Sine Wave Flow Animation (Android 13+ Style) */
@keyframes waveFlow {
    from {
        background-position: 0px center;
    }
    to {
        background-position: 20px center;
    }
}

/* Pause the wave flow when not actively playing */
.player-bar:not(.playing-state) .progress-bar-fill,
.fullscreen-overlay:not(.playing-state) .progress-bar-fill {
    animation-play-state: paused !important;
}

/* ==========================================================================
   Queue Panel
   ========================================================================== */
.queue-panel {
    position: fixed;
    bottom: calc(var(--player-height) + 12px);
    right: 24px;
    width: 340px;
    max-height: 480px;
    background: rgba(16, 18, 22, 0.97);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    backdrop-filter: blur(30px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    z-index: 300;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: queueSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.queue-panel.hidden {
    display: none !important;
}

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

.queue-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}

.queue-panel-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.queue-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 26px;
    cursor: pointer;
    line-height: 0.6;
    padding: 4px;
    border-radius: 50%;
    transition: color 0.2s;
}

.queue-close-btn:hover { color: var(--text-main); }

.queue-panel-body {
    overflow-y: auto;
    flex-grow: 1;
    padding: 8px 0;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 8px;
    margin: 2px 8px;
    transition: background-color 0.2s;
    position: relative;
}

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

.queue-item.active {
    background: rgba(var(--primary-rgb), 0.12);
}

.queue-item.active .queue-item-title {
    color: var(--primary);
}

.queue-item-num {
    font-size: 12px;
    color: var(--text-sub);
    min-width: 20px;
    text-align: center;
}

.queue-item-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255,255,255,0.05);
}

.queue-item-details {
    overflow: hidden;
    flex: 1;
}

.queue-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-artist {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.queue-item-drag {
    color: var(--text-sub);
    cursor: grab;
    padding: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.queue-item:hover .queue-item-drag { opacity: 1; }

.queue-item.drag-over {
    border-top: 2px solid var(--primary);
}

/* ==========================================================================
   Mini Player Bubble
   ========================================================================== */
.mini-player {
    position: fixed;
    bottom: calc(var(--player-height) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(18, 20, 26, 0.96);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 60px;
    padding: 10px 16px 10px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 16px 50px rgba(0,0,0,0.7), 0 0 0 1px rgba(var(--primary-rgb), 0.15);
    z-index: 290;
    backdrop-filter: blur(30px);
    min-width: 320px;
    max-width: 480px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.mini-player:not(.hidden) {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

.mini-player-art {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: rgba(255,255,255,0.05);
    flex-shrink: 0;
    border: 2px solid rgba(var(--primary-rgb), 0.3);
    animation: miniArtSpin 12s linear infinite;
    animation-play-state: paused;
}

.mini-player.playing .mini-player-art {
    animation-play-state: running;
}

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

.mini-player-info {
    overflow: hidden;
    flex: 1;
}

.mini-player-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-artist {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mini-player-btn:hover {
    color: white;
    background: rgba(255,255,255,0.08);
    transform: scale(1.1);
}

.mini-player-expand-btn {
    background: rgba(var(--primary-rgb), 0.15);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    color: var(--primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mini-player-expand-btn:hover {
    background: rgba(var(--primary-rgb), 0.3);
    transform: scale(1.1);
}

.mini-player-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.07);
    border-radius: 0 0 60px 60px;
    overflow: hidden;
}

.mini-player-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    border-radius: 0 0 60px 60px;
    width: 0%;
    transition: width 0.5s linear;
}

/* ==========================================================================
   Keyboard Shortcut Toast
   ========================================================================== */
.kbd-toast {
    position: fixed;
    bottom: calc(var(--player-height) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 9000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    animation: toastAppear 0.25s ease forwards;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kbd-toast kbd {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 2px 7px;
    font-family: monospace;
    font-size: 12px;
}

@keyframes toastAppear {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ==========================================================================
   Fullscreen Title Marquee (when text is long)
   ========================================================================== */
.fullscreen-title.marquee-active,
.fullscreen-artist.marquee-active {
    white-space: nowrap;
    overflow: hidden;
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    -webkit-box-orient: unset;
}

.fullscreen-title.marquee-active span,
.fullscreen-artist.marquee-active span {
    display: inline-block;
    animation: marqueeScroll 12s linear infinite;
    padding-right: 60px;
}

@keyframes marqueeScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ==========================================================================
   Draggable Progress Bar (shows thumb always on active drag)
   ========================================================================== */
.progress-bar-wrapper.dragging {
    height: 8px !important;
    cursor: grabbing;
}

.progress-bar-wrapper.dragging .progress-bar-fill::after {
    transform: translateY(-50%) scale(1.4) !important;
    background-color: white;
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.5);
}

/* Volume slider dragging */
.volume-slider-wrapper.dragging {
    cursor: grabbing;
}

/* ==========================================================================
   Queue Button Active State
   ========================================================================== */
#queueBtn.active {
    color: var(--primary);
}

/* ==========================================================================
   Playlist row drag-and-drop reordering
   ========================================================================== */
.table-row.dragging-row {
    opacity: 0.4;
    border: 1px dashed rgba(var(--primary-rgb), 0.5);
}

.table-row.drag-target {
    border-top: 2px solid var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: calc(var(--player-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
    align-items: center;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 12px;
    font-family: var(--font-secondary);
    font-size: 14px;
    font-weight: 600;
    background: rgba(20, 22, 28, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    color: var(--text-main);
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    white-space: nowrap;
    min-width: 200px;
    max-width: 420px;
}

.toast.toast-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.toast-msg {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-success { border-left: 3px solid #10b981; color: #d1fae5; }
.toast-success .toast-icon { color: #10b981; }

.toast-error { border-left: 3px solid #ef4444; color: #fee2e2; }
.toast-error .toast-icon { color: #ef4444; }

.toast-info { border-left: 3px solid #60a5fa; color: #dbeafe; }
.toast-info .toast-icon { color: #60a5fa; }

.toast-warning { border-left: 3px solid #f59e0b; color: #fef3c7; }
.toast-warning .toast-icon { color: #f59e0b; }

/* ==========================================================================
   Keyboard Shortcuts Popup
   ========================================================================== */
.shortcuts-help-btn {
    margin-right: 8px;
    color: var(--text-muted);
}

.shortcuts-popup {
    position: absolute;
    top: 64px;
    right: 100px;
    width: 320px;
    background: rgba(16, 18, 24, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(24px);
    z-index: 200;
    overflow: hidden;
    animation: popupFadeIn 0.2s ease;
}

@keyframes popupFadeIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.shortcuts-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.shortcuts-popup-header .close-modal {
    font-size: 22px;
    line-height: 0.6;
}

.shortcuts-list {
    padding: 12px 0;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    transition: background 0.15s ease;
}

.shortcut-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.shortcut-row kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    font-family: var(--font-secondary);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0;
    white-space: nowrap;
}

.shortcut-row span {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-secondary);
}

/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */

.mobile-only-section {
    display: none !important;
}

/* Mobile bottom navigation bar */
.mobile-nav-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(10, 11, 13, 0.97);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    justify-content: space-around;
    align-items: center;
    z-index: 999;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-secondary);
    font-size: 11px;
    font-weight: 500;
    flex: 1;
    height: 100%;
    transition: color 0.2s ease;
}

.mobile-nav-item svg {
    stroke: currentColor;
    transition: transform 0.2s ease;
}

.mobile-nav-item:hover, .mobile-nav-item.active {
    color: var(--text-main);
}

.mobile-nav-item.active svg {
    stroke: var(--primary);
    filter: drop-shadow(0 0 4px rgba(var(--primary-rgb), 0.3));
    transform: scale(1.05);
}

.topbar-home-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-home-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
    transform: scale(1.05);
}

/* ─────────────────────────────────────────────────────────────────
   MOBILE BREAKPOINT  ≤ 768px
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* ── Layout ───────────────────────────────────────────────── */
    .sidebar { display: none !important; }
    .mobile-only-section { display: block !important; }
    .mobile-nav-bar { display: none !important; }

    /* Stack into single column.
       Row 1: scrollable content
       Row 2: player bar (fixed height) */
    :root {
        --player-height: 82px;
        --mobile-nav-height: 0px;
    }

    .app-container {
        display: block !important;    /* switch away from grid on mobile */
        height: 100dvh;
        width: 100vw;
        overflow: hidden;
        position: relative;
    }

    /* Scrollable content area leaves room for floating player bar */
    .main-content {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0 !important; /* stretch all the way to bottom */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 16px 110px !important; /* bottom padding so last item is not covered by floating player */
        background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg-base) 100%);
        z-index: 5;
    }

    /* ── Topbar ───────────────────────────────────────────────── */
    .topbar {
        margin-bottom: 14px;
        height: 44px;
        position: sticky;
        top: 0;
        background: var(--bg-panel) !important;
        z-index: 50;
        margin-top: -12px !important;
        padding-top: 12px !important;
        padding-bottom: 4px !important;
    }

    .search-container {
        flex-grow: 1 !important;
        width: auto !important;
        max-width: none !important;
        padding: 7px 14px;
    }
    .search-container:focus-within {
        width: auto !important;
    }

    .shortcuts-help-btn {
        display: none !important; /* hide non-essentials on mobile topbar */
    }
    
    .user-profile-content {
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }
    
    .user-profile .username {
        display: none !important;
    }

    /* ── Greeting & cards ─────────────────────────────────────────── */
    .greeting {
        font-size: 22px !important;
        margin-bottom: 14px;
    }

    .quick-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-bottom: 24px;
    }
    .quick-card { height: 60px !important; border-radius: 8px; }
    .quick-card-cover { width: 60px !important; height: 60px !important; }
    .quick-card-title { font-size: 13px !important; }
    .quick-card-play { display: none !important; }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
        gap: 10px !important;
    }
    .genre-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    .music-card { padding: 10px !important; }
    .music-card-title { font-size: 13px !important; }
    .music-card-desc { display: none !important; }

    /* ── Playlist view ────────────────────────────────────────────── */
    .playlist-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 14px !important;
        padding: 14px 0 !important;
    }
    .playlist-cover-large {
        width: 140px !important;
        height: 140px !important;
        font-size: 56px !important;
    }
    .playlist-title-large { font-size: 24px !important; }

    /* ── Songs Table ──────────────────────────────────────────────── */
    .playlist-songs-table .table-header,
    .playlist-songs-table .table-row {
        grid-template-columns: 36px 1fr 56px 44px !important;
        padding: 8px 6px !important;
    }
    .search-results-table .table-header,
    .search-results-table .table-row {
        grid-template-columns: 36px 1fr 48px 56px !important;
        padding: 8px 6px !important;
    }
    .search-results-table .col-actions {
        gap: 4px !important;
    }
    .col-album { display: none !important; }
    .table-row:hover { transform: none !important; }
    .row-action-btn { opacity: 1 !important; }

    /* ── Bottom Player Bar (Music Island) ─────────────────────────── */
    .player-bar {
        position: fixed !important;
        bottom: 16px !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        height: 82px !important;
        background: rgba(13, 15, 18, 0.55) !important;
        backdrop-filter: blur(25px) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 20px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
        padding: 10px 12px 10px 8px !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        z-index: 999 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    /* Top row details */
    .player-bar .current-track {
        display: flex !important;
        align-items: center !important;
        width: calc(100% - 86px) !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        height: 40px !important;
        cursor: pointer !important;
        gap: 8px !important;
    }

    .player-bar .current-track .track-thumbnail {
        width: 36px !important;
        height: 36px !important;
        border-radius: 6px !important;
    }

    .player-bar .current-track .track-info {
        margin-left: 0 !important;
        overflow: hidden !important;
        flex: 1 !important;
        min-width: 0 !important;
    }

    .player-bar .current-track .track-title {
        font-size: 13px !important;
        font-weight: 700 !important;
        color: var(--text-main) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .player-bar .current-track .track-artist {
        font-size: 11px !important;
        color: var(--text-muted) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .player-bar .current-track .track-like-btn {
        display: none !important;
    }

    /* Player controls layout */
    .player-bar .player-controls {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    /* Position play/next buttons in top right of the island */
    .player-bar .player-controls .control-buttons {
        position: absolute !important;
        top: 10px !important;
        right: 14px !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        height: 40px !important;
        z-index: 20 !important;
    }

    .player-bar .control-buttons #shuffleBtn,
    .player-bar .control-buttons #prevBtn,
    .player-bar .control-buttons #repeatBtn {
        display: none !important;
    }

    .player-bar .control-buttons .play-btn {
        width: 36px !important;
        height: 36px !important;
        background: #fff !important;
        color: #000 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
        border: none !important;
        padding: 0 !important;
    }

    .player-bar .control-buttons .play-btn svg {
        width: 16px !important;
        height: 16px !important;
        fill: #000 !important;
        stroke: none !important;
    }

    .player-bar .control-buttons #nextBtn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: var(--text-main) !important;
        opacity: 0.8 !important;
        background: transparent !important;
        border: none !important;
        padding: 4px !important;
    }

    .player-bar .control-buttons #nextBtn svg {
        width: 20px !important;
        height: 20px !important;
    }

    .player-bar .control-buttons #mobileCastBtn {
        display: none; /* Managed by JS */
        align-items: center !important;
        justify-content: center !important;
        color: var(--text-main) !important;
        opacity: 0.8 !important;
        background: transparent !important;
        border: none !important;
        padding: 4px !important;
    }
    
    .player-bar .control-buttons #mobileCastBtn.active {
        color: var(--primary) !important;
        opacity: 1 !important;
    }

    /* Progress bar styling (Draggable slider at the bottom of the island) */
    .player-bar .progress-container {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        height: 16px !important;
        margin-top: 4px !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        z-index: 5 !important;
    }

    .player-bar .progress-container .time-display {
        font-size: 9px !important;
        color: var(--text-muted) !important;
        min-width: 24px !important;
        display: block !important;
    }

    .player-bar .progress-bar-wrapper {
        flex-grow: 1 !important;
        height: 4px !important;
        background: rgba(255, 255, 255, 0.12);
        border-radius: 2px !important;
        position: relative !important;
        cursor: pointer !important;
    }

    .player-bar .progress-bar-wrapper::before {
        content: '' !important;
        position: absolute !important;
        top: -10px !important;
        bottom: -10px !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 5 !important;
    }

    .player-bar .progress-bar-fill {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 8' width='20' height='8'%3E%3Cpath d='M0,4 Q5,0 10,4 T20,4' fill='none' stroke='%2310b981' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") !important;
        background-repeat: repeat-x !important;
        background-size: 20px 8px !important;
        background-position: 0 center;
        animation: waveFlow 1.2s linear infinite !important;
        height: 8px !important;
        width: 0%;
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        border-radius: 4px 0 0 4px !important;
    }

    .player-bar .progress-bar-fill::after {
        content: '' !important;
        position: absolute !important;
        right: -6px !important;
        top: 50% !important;
        transform: translateY(-50%) scale(1) !important;
        width: 10px !important;
        height: 10px !important;
        border-radius: 50% !important;
        background: #fff !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.4) !important;
        z-index: 6 !important;
    }

    .player-bar .extra-controls {
        display: none !important;
    }

    /* ── Fullscreen Player ────────────────────────────────────────── */
    .fullscreen-overlay {
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .fullscreen-close-btn {
        position: absolute !important;
        top: 16px !important;
        right: 16px !important;
        width: 40px !important;
        height: 40px !important;
        z-index: 200;
        background: rgba(0,0,0,0.4) !important;
    }
    .fullscreen-content {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-end !important;
        align-items: stretch !important;
        height: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
    .fullscreen-layout {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0 !important;
        flex: 1;
        padding: 20px 24px 10px !important;
        overflow: hidden;
    }
    .fullscreen-art-wrapper {
        width: min(65vw, 250px) !important;
        height: min(65vw, 250px) !important;
        border-radius: 16px !important;
        box-shadow: 0 12px 50px rgba(0,0,0,0.7) !important;
        flex-shrink: 0 !important;
        margin-top: 10px !important;
        margin-bottom: 20px !important;
    }
    .fullscreen-info-lyrics {
        width: 100% !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        height: auto !important;
        gap: 12px;
    }
    .fullscreen-track-details {
        text-align: center !important;
        margin-bottom: 0 !important;
        width: 100%;
    }
    .fullscreen-title { font-size: 1.4rem !important; margin-bottom: 6px !important; }
    .fullscreen-artist { font-size: 1rem !important; }
    .fullscreen-lyrics-container {
        width: 100% !important;
        max-height: 160px !important;
        overflow-y: auto !important;
        flex-grow: 0 !important;
        padding-right: 0 !important;
        mask-image: linear-gradient(to bottom, transparent, white 20%, white 80%, transparent) !important;
        -webkit-mask-image: linear-gradient(to bottom, transparent, white 20%, white 80%, transparent) !important;
    }
    .fullscreen-lyrics-text .lyrics-line {
        font-size: 1.05rem !important;
        text-align: center !important;
        padding: 5px 0 !important;
    }
    .fullscreen-lyrics-text .lyrics-line.active {
        font-size: 1.25rem !important;
        transform: scale(1.02) translateX(0) !important;
    }
    .fullscreen-controls-bar {
        width: 100% !important;
        padding: 14px 24px 32px !important;
        border-top: 1px solid rgba(255,255,255,0.06) !important;
        margin-top: 0 !important;
    }
    .fs-progress { margin-bottom: 14px !important; }
    .fs-progress .progress-bar-wrapper {
        height: 5px !important;
        border-radius: 3px !important;
    }
    .fs-progress .progress-bar-wrapper:hover { height: 7px !important; }
    /* Enlarged touch target for fullscreen progress */
    .fs-progress .progress-bar-wrapper::before {
        content: '';
        position: absolute;
        top: -16px;
        bottom: -16px;
        left: 0;
        right: 0;
        z-index: 10;
    }
    .fs-progress .time-display { font-size: 11px !important; min-width: 34px !important; }
    .fs-buttons {
        gap: 20px !important;
        justify-content: center !important;
        align-items: center !important;
        display: flex !important;
    }
    .fs-buttons .control-btn {
        padding: 12px !important;
    }
    .fs-buttons .control-btn svg {
        width: 24px !important;
        height: 24px !important;
    }
    .fs-play {
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        aspect-ratio: 1 / 1 !important;
    }
    .fs-play svg {
        width: 28px !important;
        height: 28px !important;
    }

    /* ── Right canvas panel ───────────────────────────────────────── */
    .canvas-panel {
        width: 100vw !important;
        height: calc(100dvh - var(--player-height) - var(--mobile-nav-height)) !important;
    }

    /* ── Queue panel ─────────────────────────────────────────────── */
    .queue-panel {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        bottom: calc(var(--player-height) + var(--mobile-nav-height) + 8px) !important;
    }

    /* ── Toast / kbd notifications ───────────────────────────────── */
    .toast-container {
        bottom: calc(var(--player-height) + var(--mobile-nav-height) + 12px) !important;
    }
    .kbd-toast {
        bottom: calc(var(--player-height) + var(--mobile-nav-height) + 12px) !important;
    }
}


/* ==========================================================================
   Google Account Authentication UI & Modals
   ========================================================================== */

.login-btn-header {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-btn-header:hover {
    background: var(--primary-hover);
    transform: scale(1.04);
}

.user-profile-content {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    padding: 6px 16px 6px 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.user-profile-content.active .profile-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background: rgba(18, 20, 24, 0.95);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dropdown-header {
    padding: 4px 8px;
}

.dropdown-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-email {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

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

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.login-modal-content {
    background: rgba(18, 20, 24, 0.9);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(30px);
    width: 90%;
    max-width: 420px;
    border-radius: 24px;
    padding: 40px 30px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    text-align: center;
    animation: modal-appear 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-modal-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-main);
    font-family: var(--font-primary);
}

.login-modal-header p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
    font-family: var(--font-secondary);
}

.google-btn-container {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    width: 100%;
}

/* Align and format Google dynamic button button */
.google-btn-container > div {
    width: 100%;
    display: flex;
    justify-content: center;
}

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 20px 0;
    font-family: var(--font-secondary);
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
}

.login-divider span {
    padding: 0 10px;
}

.sandbox-profiles {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    margin-top: 10px;
}

.sandbox-profile-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 12px 6px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sandbox-profile-btn img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.sandbox-profile-btn span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-secondary);
}

.sandbox-profile-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.sandbox-profile-btn:hover img {
    border-color: var(--primary);
}

.sandbox-profile-btn:hover span {
    color: var(--text-main);
}

/* ── Shazam Music Recognition Styles ────────────────────────────────────── */
.shazam-input-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.shazam-input-btn:hover {
    color: var(--primary);
    background: rgba(29, 185, 84, 0.1);
    transform: scale(1.1);
}

.shazam-input-btn.listening {
    color: #ff5555;
    background: rgba(255, 85, 85, 0.1);
    animation: shazamPulse 1.2s infinite;
}

@keyframes shazamPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Modal styling */
.shazam-modal-content {
    max-width: 420px !important;
}

.shazam-modal-body {
    padding: 30px 20px !important;
    text-align: center;
}

.shazam-status-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    width: 100%;
    box-sizing: border-box;
}

.shazam-state-listening,
.shazam-state-analyzing,
.shazam-state-success,
.shazam-state-failure {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Radar Pulse Animation */
.radar-pulse {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shazam-center-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), #1ed760);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(29, 185, 84, 0.4);
}

.shazam-center-icon svg {
    color: #000;
}

.pulse-circle {
    position: absolute;
    width: 70px;
    height: 70px;
    background: rgba(29, 185, 84, 0.3);
    border-radius: 50%;
    animation: radarRipple 2s infinite ease-out;
    opacity: 0;
}

.pulse-circle.c1 { animation-delay: 0s; }
.pulse-circle.c2 { animation-delay: 0.6s; }
.pulse-circle.c3 { animation-delay: 1.2s; }

@keyframes radarRipple {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.shazam-pulse-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    font-family: var(--font-primary);
}

.shazam-hint-text {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-secondary);
}

/* Spinner for Analyzing State */
.shazam-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: rotateSpinner 1.2s linear infinite;
    margin-bottom: 24px;
}

@keyframes rotateSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success State Styles */
.recognized-track-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    text-align: left;
}

.recognized-track-thumb {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.recognized-track-details {
    flex-grow: 1;
    overflow: hidden;
}

.recognized-track-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    font-family: var(--font-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recognized-track-artist {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shazam-success-actions,
.shazam-failure-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.shazam-success-actions button,
.shazam-failure-actions button {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 24px;
    transition: all 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.shazam-success-actions .btn-primary,
.shazam-failure-actions .btn-primary {
    background: var(--primary);
    color: #000;
    border: none;
}

.shazam-success-actions .btn-primary:hover,
.shazam-failure-actions .btn-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.shazam-success-actions .btn-secondary,
.shazam-failure-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.shazam-success-actions .btn-secondary:hover,
.shazam-failure-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
    transform: scale(1.02);
}

/* Failure State Styles */
.shazam-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.shazam-error-msg {
    font-size: 15px;
    color: #ff5555;
    margin-bottom: 24px;
    font-family: var(--font-secondary);
    line-height: 1.4;
}

/* ── Listening Statistics Dashboard Styles ───────────────────────────────── */
.period-select-dropdown {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: var(--font-secondary);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}
.period-select-dropdown:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}
.period-select-dropdown option {
    background: #181b22;
    color: var(--text-main);
}

.stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.kpi-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 0 10px rgba(var(--primary-rgb), 0.1);
}

.kpi-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.kpi-value {
    font-size: 24px;
    font-weight: 750;
    color: var(--text-main);
    font-family: var(--font-primary);
    letter-spacing: -0.5px;
}
.kpi-label {
    font-size: 13px;
    color: var(--text-sub);
    font-family: var(--font-secondary);
}

.stats-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.stats-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.panel-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-primary);
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.top-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stats-empty-msg {
    font-size: 13px;
    color: var(--text-sub);
    text-align: center;
    padding: 30px 0;
    font-family: var(--font-secondary);
}

.stats-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}
.stats-row:hover {
    background: rgba(255, 255, 255, 0.04);
}
.stats-rank {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    min-width: 20px;
    text-align: center;
}
.stats-detail {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.stats-row-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stats-row-subtitle {
    font-size: 12px;
    color: var(--text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stats-count-badge {
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    white-space: nowrap;
}

@media (max-width: 768px) {
    #sectionStats {
        width: 100% !important;
        overflow-x: hidden !important;
    }
    .stats-kpi-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        margin-bottom: 20px !important;
    }
    .kpi-card {
        padding: 16px !important;
        gap: 12px !important;
    }
    .stats-panel {
        padding: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .stats-dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
        padding-bottom: 80px;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* Custom Search History Panel */
.search-history-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #0d0f12;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 8px;
    max-height: 320px;
    overflow-y: auto;
    backdrop-filter: blur(15px);
}

.search-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 6px;
}

.clear-history-btn {
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s ease;
}

.clear-history-btn:hover {
    color: var(--primary);
}

.search-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: var(--text-main);
    font-size: 14px;
}

.search-history-item:hover {
    background-color: var(--bg-card-hover);
}

.search-history-item svg.clock-icon {
    color: var(--text-sub);
    flex-shrink: 0;
}

.search-history-item .history-text {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-history-item .remove-history-btn {
    background: transparent;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.search-history-item .remove-history-btn:hover {
    color: #ff5555;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Custom Dropdown Styling */
.custom-dropdown {
    position: relative;
    width: 160px;
    user-select: none;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: var(--font-secondary);
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.custom-dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.custom-dropdown-trigger .chevron {
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.custom-dropdown.open .custom-dropdown-trigger .chevron {
    transform: rotate(180deg);
}

.custom-dropdown-options {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 100%;
    background: #181b22;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    z-index: 500;
    padding: 4px;
    backdrop-filter: blur(15px);
}

.custom-dropdown-option {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-dropdown-option:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.custom-dropdown-option.active {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary);
    font-weight: 600;
}

/* ── Custom Animated Logo Styles ────────────────────────────────────────── */
.gooify-animated-logo .wave-bar {
    transform-origin: center;
    animation: bounceLogo 1.2s ease-in-out infinite;
}
.gooify-animated-logo .bar-1 { animation-delay: 0.1s; }
.gooify-animated-logo .bar-2 { animation-delay: 0.3s; }
.gooify-animated-logo .bar-3 { animation-delay: 0.5s; }

@keyframes bounceLogo {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.4); }
}

/* ── Splash Screen Loader Styles ────────────────────────────────────────── */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #07080a;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.splash-screen.hidden {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}
.splash-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.splash-logo-container {
    margin-bottom: 8px;
    filter: drop-shadow(0 0 15px rgba(29, 185, 84, 0.3));
}
.gooify-animated-logo-large .wave-bar {
    transform-origin: center;
    animation: bounceLarge 1.2s ease-in-out infinite;
}
.gooify-animated-logo-large .bar-1 { animation-delay: 0.1s; }
.gooify-animated-logo-large .bar-2 { animation-delay: 0.3s; }
.gooify-animated-logo-large .bar-3 { animation-delay: 0.5s; }

@keyframes bounceLarge {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.35); }
}
.splash-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin: 0;
}
.splash-loading-bar {
    width: 180px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin: 4px 0;
}
.splash-loading-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 2px;
    animation: loadProgress 2.2s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}
@keyframes loadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}
.splash-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: 'Plus Jakarta Sans', sans-serif;
    letter-spacing: 0.5px;
    margin: 0;
}

/* ── Gooify Connect Badge ────────────────────────────────────────────────── */
.connect-device-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(29, 185, 84, 0.12);
    border: 1px solid rgba(29, 185, 84, 0.25);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    color: var(--primary);
    font-weight: 600;
    line-height: 1;
    margin-left: 4px;
    animation: badgePulse 2s infinite ease-in-out;
}
.connect-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
}
@keyframes badgePulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; filter: drop-shadow(0 0 2px rgba(29, 185, 84, 0.5)); }
}
