@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #06070c;
    --bg-secondary: rgba(14, 16, 27, 0.65);
    --accent: #822faf;
    --accent-glow: rgba(130, 47, 175, 0.4);
    --accent-cyan: #2a75b3;
    --accent-cyan-glow: rgba(42, 117, 179, 0.3);
    --text-primary: #f8f9fa;
    --text-secondary: #a0a5b5;
    --text-muted: #5e6473;
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-highlight: rgba(255, 255, 255, 0.02);
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-premium: 0 16px 40px rgba(0, 0, 0, 0.6);
    --neon-shadow: 0 0 20px var(--accent-glow);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 5% 10%, rgba(130, 47, 175, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 95% 90%, rgba(42, 117, 179, 0.08) 0%, transparent 40%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.audio-unlock-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: rgba(6, 7, 12, 0.96);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    color: #fff;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.audio-unlock-banner.show {
    opacity: 1;
    pointer-events: auto;
}

.unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(130, 47, 175, 0.6);
}

.unlock-btn:active {
    transform: translateY(0);
}

@keyframes pulse-glow {
    from {
        transform: scale(1);
        opacity: 0.9;
    }
    to {
        transform: scale(1.08);
        opacity: 1;
    }
}

/* App Header styling */
header {
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.brand-container {
    text-align: right;
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #f7d6c8, #ffcad4, #b5e2fa, #c5dedd);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 4s linear infinite;
    text-shadow: 0 0 25px rgba(255, 202, 212, 0.25);
}

.brand-subtitle {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--accent-cyan);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 2px;
    opacity: 0.9;
    text-shadow: 0 0 10px var(--accent-cyan-glow);
}

@keyframes shine {
    to { background-position: 200% center; }
}

/* Main Layout: Split Screen */
.app-layout {
    display: flex;
    flex: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px 110px 40px;
    gap: 30px;
}

/* Left Sidebar - Most Selected History */
.sidebar-left {
    width: 320px;
    min-width: 320px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(15px);
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
    position: relative; /* absolute buttons anchor */
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 14px;
}

.sidebar-title i {
    color: var(--accent-cyan);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 32px; /* space for scroll buttons */
}

.history-list::-webkit-scrollbar {
    width: 5px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Sidebar history vertical scroll buttons */
.hist-slide-btn {
    position: absolute;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), #185a8f);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 5;
    transition: var(--transition-smooth);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(42, 117, 179, 0.35);
}

.hist-slide-btn:hover {
    background: linear-gradient(135deg, #388ad0, var(--accent-cyan));
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 12px rgba(58, 134, 200, 0.5), 0 4px 15px rgba(42, 117, 179, 0.2);
}

.hist-slide-btn.up {
    right: 12px;
    top: 30%;
    transform: translateY(-50%);
}

.hist-slide-btn.down {
    right: 12px;
    top: 70%;
    transform: translateY(-50%);
}

.hist-slide-btn.up:hover {
    transform: translateY(-50%) scale(1.06);
}

.hist-slide-btn.down:hover {
    transform: translateY(-50%) scale(1.06);
}

.hist-slide-btn.up:active {
    transform: translateY(-50%) scale(0.95);
}

.hist-slide-btn.down:active {
    transform: translateY(-50%) scale(0.95);
}

.history-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid transparent;
    padding: 10px 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--glass-border);
    transform: translateX(4px);
}

.history-item.active {
    background: rgba(42, 117, 179, 0.1);
    border-color: var(--accent-cyan);
}

.history-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

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

.history-details {
    flex: 1;
    overflow: hidden;
    margin-right: 8px;
}

.history-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-artist {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.history-plays {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(42, 117, 179, 0.15);
    color: #5bb3ff;
    padding: 4px 8px;
    border-radius: 20px;
    border: 1px solid rgba(42, 117, 179, 0.3);
    white-space: nowrap;
}

/* Right Main Panel */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flex children from breaking width */
}

/* Music Genre Pills */
.genres-container {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.genre-pill {
    background: linear-gradient(135deg, var(--accent-cyan), #185a8f);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 8px 18px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(42, 117, 179, 0.35);
}

.genre-pill:hover {
    background: linear-gradient(135deg, #388ad0, var(--accent-cyan));
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(58, 134, 200, 0.6), 0 4px 15px rgba(42, 117, 179, 0.2);
    transform: translateY(-2px);
}

.genre-pill.active {
    background: linear-gradient(135deg, var(--accent), #56167d);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    box-shadow: 0 0 20px var(--accent-glow);
}

.genre-pill:active {
    transform: translateY(0) scale(0.95);
}

/* Search Container */
.search-container {
    width: 100%;
    margin-bottom: 24px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 6px 6px 6px 24px;
    backdrop-filter: blur(15px);
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-premium);
}

.search-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 25px var(--accent-glow), var(--shadow-premium);
    transform: translateY(-2px);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 14px;
    font-size: 1.2rem;
    transition: var(--transition-smooth);
}

.search-wrapper:focus-within .search-icon {
    color: var(--accent);
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1.05rem;
    width: 100%;
    padding: 10px 0;
    font-family: inherit;
}

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

/* Keyboard Toggle Button in Search Bar */
.keyboard-toggle-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    margin-right: 16px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.keyboard-toggle-btn:hover {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px var(--accent-cyan-glow);
    transform: scale(1.1);
}

.keyboard-toggle-btn.active {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.search-button {
    background: linear-gradient(135deg, var(--accent), #621d96);
    border: none;
    outline: none;
    color: var(--text-primary);
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(130, 47, 175, 0.3);
}

.search-button:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(130, 47, 175, 0.5);
}

/* On-Screen Virtual Keyboard Panel */
.virtual-keyboard {
    display: none; /* hidden by default */
    flex-direction: column;
    gap: 8px;
    background: rgba(8, 9, 18, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 18px;
    margin-top: 15px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 20px rgba(130, 47, 175, 0.1);
    backdrop-filter: blur(20px);
    transition: var(--transition-smooth);
}

.virtual-keyboard.show {
    display: flex;
    animation: slide-down-kb 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes slide-down-kb {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.keyboard-key {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
    min-width: 40px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.keyboard-key:hover {
    background: rgba(130, 47, 175, 0.25);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(130, 47, 175, 0.3);
    transform: translateY(-2px);
    color: #fff;
}

.keyboard-key:active {
    transform: translateY(0) scale(0.95);
}

/* Action key variations */
.keyboard-key.key-wide {
    min-width: 70px;
    background: rgba(255, 255, 255, 0.08);
}

.keyboard-key.key-backspace {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.2);
    color: #ff7675;
}

.keyboard-key.key-backspace:hover {
    background: rgba(231, 76, 60, 0.3);
    border-color: #ff7675;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

.keyboard-key.key-clear {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.keyboard-key.key-space {
    min-width: 250px;
}

.keyboard-key.key-enter {
    background: linear-gradient(135deg, var(--accent), #56167d);
    border-color: rgba(130, 47, 175, 0.4);
    min-width: 100px;
    font-weight: 600;
}

.keyboard-key.key-enter:hover {
    background: linear-gradient(135deg, #9d4edd, var(--accent));
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Vertical Covers Grid Section (Scrollable, 4 or 5 columns) */
.carousel-outer {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 24px;
    backdrop-filter: blur(5px);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.01);
}

.carousel-container {
    width: 100%;
    display: grid;
    /* Responsive vertical grid - shrunken to fit 6 covers in the first line */
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    grid-auto-flow: row;
    grid-auto-rows: auto;
    gap: 12px;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    padding: 10px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.carousel-container::-webkit-scrollbar {
    width: 6px;
}

.carousel-container::-webkit-scrollbar-track {
    background: transparent;
}

.carousel-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.carousel-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Cover Cards styling */
.cover-card {
    width: 100%; /* Take full column width of grid */
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 8px;
    backdrop-filter: blur(8px);
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
    user-select: none;
}

.cover-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 1;
}

.cover-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(130, 47, 175, 0.1);
}

.cover-card:hover::before {
    opacity: 1;
}

.card-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.cover-card:hover .card-image {
    transform: scale(1.06);
}

.card-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 7, 12, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 2;
}

.cover-card:hover .card-play-overlay {
    opacity: 1;
}

.play-icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transform: scale(0.8);
    transition: var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.cover-card:hover .play-icon-btn {
    transform: scale(1);
}

.play-icon-btn:hover {
    background: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 15px var(--accent-glow);
}

.card-info {
    margin-top: 8px;
    position: relative;
    z-index: 2;
}

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

.card-artist {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Active Playing Card state */
.cover-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.cover-card.active .card-play-overlay {
    opacity: 1;
    background: rgba(130, 47, 175, 0.2);
}

.cover-card.active .play-icon-btn {
    background: var(--accent);
    color: var(--text-primary);
    transform: scale(1);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(130, 47, 175, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(130, 47, 175, 0); }
    100% { box-shadow: 0 0 0 0 rgba(130, 47, 175, 0); }
}

/* Infinite scroll loader at bottom of grid */
.infinite-scroll-loading {
    grid-column: 1 / -1;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    gap: 12px;
}

.infinite-scroll-loading.active {
    display: flex;
}

.infinite-scroll-loading .mini-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(130, 47, 175, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}

/* Vertical slide buttons (Up/Down) on the right */
.slide-btn {
    position: absolute;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), #185a8f);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 5;
    transition: var(--transition-smooth);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 25px rgba(42, 117, 179, 0.45);
}

.slide-btn:hover {
    background: linear-gradient(135deg, #388ad0, var(--accent-cyan));
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(58, 134, 200, 0.6), 0 8px 25px rgba(42, 117, 179, 0.3);
}

.slide-btn.up {
    right: -26px;
    top: 30px;
    transform: none;
}

.slide-btn.down {
    right: -26px;
    top: 92px; /* 30px + 52px height + 10px gap */
    transform: none;
}

.slide-btn.up:hover {
    transform: scale(1.06);
}

.slide-btn.down:hover {
    transform: scale(1.06);
}

.slide-btn.up:active {
    transform: scale(0.95);
}

.slide-btn.down:active {
    transform: scale(0.95);
}

/* Bottom Player Bar */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px;
    background: rgba(6, 7, 12, 0.88);
    backdrop-filter: blur(25px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 100;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
}

.player-track-info {
    display: flex;
    align-items: center;
    width: 30%;
    min-width: 200px;
}

.player-thumb {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.45);
    margin-right: 16px;
    background: var(--bg-secondary);
}

.player-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-metadata {
    overflow: hidden;
}

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

.player-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Playback controls center */
.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40%;
}

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

.btn-ctrl {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-ctrl.btn-play-pause {
    background: var(--text-primary);
    color: var(--bg-primary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.btn-ctrl.btn-play-pause:hover {
    background: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: scale(1.05);
}

.progress-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.time-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 35px;
}

.progress-bar-bg {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-cyan));
    border-radius: 2px;
    width: 0%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Right volume controls */
.player-volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 30%;
    min-width: 220px;
    justify-content: flex-end;
}

.volume-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.volume-btn:hover {
    background: var(--accent-cyan);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 0 12px var(--accent-cyan-glow);
    transform: scale(1.06);
}

.volume-btn:active {
    transform: scale(0.95);
}

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

.volume-icon {
    color: var(--text-secondary);
    font-size: 1rem;
    width: 20px;
}

.volume-slider-bg {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.volume-slider-fill {
    height: 100%;
    background: var(--accent-cyan);
    border-radius: 2px;
    width: 70%;
}

.volume-value {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 30px;
    text-align: right;
    font-weight: 500;
}

/* Visible YouTube Player Iframe Container in Header */
#yt-player-container {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1; /* Creates stacking context to lock third-party iframe layering */
}
#yt-player, #yt-player-container iframe {
    width: 100%;
    height: 100%;
    pointer-events: none !important;
}

.video-window {
    width: 280px;
    height: 158px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(20, 22, 38, 0.65);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-fullscreen-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 22;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(6, 7, 12, 0.7);
    color: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    animation: videoBtnPulse 2.2s ease-in-out infinite;
}

.video-fullscreen-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 14px rgba(91, 179, 255, 0.45);
    border-color: rgba(91, 179, 255, 0.55);
}

.video-fullscreen-btn i {
    font-size: 0.78rem;
}

@keyframes videoBtnPulse {
    0% {
        color: #9ad0ff;
    }
    50% {
        color: #ffd166;
    }
    100% {
        color: #ff8fab;
    }
}

.video-window-maximized {
    position: fixed !important;
    top: var(--video-max-top, 10px) !important;
    left: var(--video-max-left, 10px) !important;
    width: var(--video-max-width, calc(100vw - 20px)) !important;
    height: var(--video-max-height, calc(100vh - 120px)) !important;
    z-index: 1200 !important;
    border-radius: 16px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.75) !important;
}

.video-placeholder-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 20, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.video-placeholder-overlay .placeholder-icon {
    font-size: 2rem;
    color: var(--accent-cyan);
    opacity: 0.6;
    animation: pulse-glow 2s infinite alternate;
}

.video-placeholder-overlay .placeholder-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Empty/Loading states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: var(--text-secondary);
    text-align: center;
    width: 100%;
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(130, 47, 175, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

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

/* Responsive adjust */
@media(max-width: 1024px) {
    .app-layout {
        flex-direction: column;
        padding: 0 20px 120px 20px;
        gap: 20px;
    }
    .sidebar-left {
        width: 100%;
        height: 220px;
        max-height: 220px;
        padding: 16px;
        display: flex;
        flex-direction: column;
    }
    .sidebar-queue-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
    }
    header {
        padding: 20px;
    }
}

@media(max-width: 768px) {
    header {
        flex-direction: column !important;
        gap: 15px !important;
        align-items: center !important;
        text-align: center !important;
        padding: 15px 10px !important;
    }
    .brand-container {
        text-align: center !important;
        order: 1 !important;
        margin-bottom: 5px;
    }
    .video-window {
        order: 2 !important;
        width: 100% !important;
        max-width: 320px !important;
        height: 180px !important;
    }
    .player-bar {
        padding: 0 20px;
        height: 110px;
        flex-wrap: wrap;
    }
    .player-track-info {
        width: 60%;
    }
    .player-volume-container {
        width: 40%;
        min-width: unset;
    }
    .player-controls {
        width: 100%;
        order: 3;
        margin-top: 8px;
    }
    .carousel-outer {
        padding: 12px !important;
        border-radius: 18px !important;
    }
    .carousel-container {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px !important;
        padding: 4px !important;
    }
    .slide-btn, .hist-slide-btn {
        display: none !important;
    }
    .keyboard-key {
        padding: 8px 10px;
        font-size: 0.85rem;
        min-width: 32px;
    }
    .keyboard-key.key-space {
        min-width: 160px;
    }
}

@media(max-width: 480px) {
    .keyboard-key {
        padding: 6px 4px !important;
        font-size: 0.75rem !important;
        min-width: 24px !important;
        height: 34px !important;
    }
    .keyboard-key.key-wide {
        min-width: 45px !important;
    }
    .keyboard-key.key-space {
        min-width: 100px !important;
    }
    .carousel-container {
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)) !important;
        gap: 8px !important;
    }
    .cover-card {
        padding: 6px !important;
        border-radius: 10px !important;
    }
    .card-info {
        margin-top: 5px !important;
    }
    .card-title {
        font-size: 0.72rem !important;
    }
    .card-artist {
        font-size: 0.65rem !important;
    }
    .genres-container {
        gap: 6px !important;
    }
    .genre-pill {
        padding: 5px 10px !important;
        font-size: 0.7rem !important;
    }
}

@media(max-width: 580px) {
    .sidebar-left {
        max-height: 200px !important;
        height: 200px !important;
    }
}

/* QR Code and Remote Control Styles */
.qr-remote-header-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px 18px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.qr-remote-header-container:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px var(--accent-cyan-glow);
    transform: translateY(-2px);
}

.qr-canvas-wrapper {
    background: #ffffff;
    border-radius: 8px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#qr-code-canvas {
    width: 120px;
    height: 120px;
    display: block;
}

.qr-text-info {
    display: flex;
    flex-direction: column;
}

.qr-text-info .qr-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.qr-text-info .qr-title i {
    color: var(--accent-cyan);
    font-size: 0.95rem;
}

.qr-text-info .qr-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Modal Overlay */
.qr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 5, 8, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.qr-modal-overlay.show {
    display: flex;
    opacity: 1;
}

/* Modal Content */
.qr-modal-content {
    background: rgba(14, 16, 27, 0.85);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 35px 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-premium), 0 0 30px rgba(130, 47, 175, 0.15);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.qr-modal-overlay.show .qr-modal-content {
    transform: scale(1);
}

.qr-modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.qr-modal-close-btn:hover {
    color: #ff7675;
    transform: scale(1.1);
}

.qr-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qr-modal-title i {
    color: var(--accent-cyan);
}

.qr-modal-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 24px;
}

.qr-modal-canvas-wrapper {
    background: #ffffff;
    border-radius: 16px;
    padding: 15px;
    width: fit-content;
    margin: 0 auto 24px auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

#qr-code-canvas-large {
    width: 180px;
    height: 180px;
    display: block;
}

.qr-modal-link-info {
    font-size: 0.82rem;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    padding-top: 15px;
}

.qr-modal-link-info span {
    display: block;
    margin-bottom: 4px;
}

.qr-modal-link-info a {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
    word-break: break-all;
}

.qr-modal-link-info a:hover {
    text-decoration: underline;
    color: #5bb3ff;
}

/* Hide QR header on mobile/tablet screens to keep layout clean */
@media (max-width: 768px) {
    .qr-remote-header-container {
        display: none;
    }
    header {
        justify-content: flex-end;
    }
}

/* Real-time Connected Status Pulse Dot */
.connected-pulse {
    animation: connection-glow 1.5s infinite alternate;
}

@keyframes connection-glow {
    from {
        box-shadow: 0 0 2px rgba(16, 185, 129, 0.4);
    }
    to {
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.85);
    }
}

/* Play Queue UI styling */
.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.queue-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(168, 85, 247, 0.35);
}

.queue-item-thumb {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.queue-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 2px;
}

.queue-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.queue-item-artist {
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.queue-item-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.queue-item-remove:hover {
    background: rgba(255, 91, 91, 0.15);
    color: var(--accent-red);
}

/* YouTube Mode Toggle Mini Slider */
.youtube-mode-pill:hover {
    background: rgba(255, 0, 0, 0.25) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
}

.slider-mini:before {
    background-color: #fff;
    bottom: 2px;
    content: "";
    height: 12px;
    left: 2px;
    position: absolute;
    transition: .4s;
    width: 12px;
    border-radius: 50%;
}

#youtube-mode-checkbox:checked + .slider-mini {
    background-color: #ff0000;
}

#youtube-mode-checkbox:checked + .slider-mini:before {
    transform: translateX(14px);
}

/* Capa transparente para bloquear clics en el iframe de YouTube */
.video-click-blocker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 12; /* Superior al reproductor e inferior a los botones y anuncios */
    background: rgba(0, 0, 0, 0.01) !important; /* Low opacity forces browser hit-testing to capture clics */
    pointer-events: auto !important; /* Intercepta clics */
    cursor: default;
}

/* Contenedor de la barra de posición del video */
.video-progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.55);
    z-index: 25; /* Superior al bloqueador de clics */
    pointer-events: auto; /* Permitir clics para adelantar */
    cursor: pointer;
    display: none;
    overflow: hidden;
    transition: height 0.15s ease;
}

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

/* Relleno indicador de la barra de posición */
.video-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-cyan));
    box-shadow: 0 0 8px var(--accent-cyan-glow);
    transition: width 0.2s linear;
}

/* Ocultar el cursor del mouse tras inactividad */
.hide-cursor, .hide-cursor * {
    cursor: none !important;
}
