:root {
    --bg-base: #000000;
    --bg-elevated: #121212;
    --bg-highlight: #1e1e1e;
    --text-base: #ffffff;
    --text-subdued: #a0a0a0;
    --brand-accent: #6366f1;
    /* Indigo-500 */
    --brand-accent-hover: #4f46e5;
    /* Indigo-600 */
    --danger: #ef4444;
    --success: #22c55e;
    --sidebar-width: 240px;
    --player-height: 90px;
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-base);
    color: var(--text-base);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
    /* Prevent double-tap zoom */
}

/* Layout */
.app-layout {
    display: grid;
    grid-template-areas:
        "sidebar main"
        "player player";
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 1fr var(--player-height);
    height: 100vh;
}

/* Mobile Header (Hidden on Desktop) */
.mobile-header {
    display: none;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background-color: var(--bg-base);
    padding: 24px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1a1a1a;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(to right, #fff, #a5b4fc, #818cf8, #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    animation: gradientText 5s linear infinite;
}

/* Specific fix for the icon inside the logo to be visible */
.logo i {
    -webkit-text-fill-color: #fff;
    /* Or match the gradient start */
    background: none;
    color: white;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item a {
    text-decoration: none;
    color: var(--text-subdued);
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-item a:hover {
    color: var(--text-base);
    background-color: var(--bg-highlight);
}

.nav-item a.active {
    color: white;
    background-color: var(--bg-highlight);
    font-weight: 600;
}

/* Main Content */
.main-view {
    grid-area: main;
    background: linear-gradient(180deg, #18181b 0%, #09090b 100%);
    overflow-y: auto;
    padding: 32px 48px;
    margin: 8px 8px 0 0;
    border-radius: 12px 12px 0 0;
    position: relative;
}

/* Scrollbar */
.main-view::-webkit-scrollbar {
    width: 10px;
}

.main-view::-webkit-scrollbar-track {
    background: transparent;
}

.main-view::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
}

.main-view::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Player Bar */
.player-bar {
    grid-area: player;
    background-color: #000;
    border-top: 1px solid #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 2100;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 30%;
}

.track-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.track-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.track-artist {
    font-size: 12px;
    color: var(--text-subdued);
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
    gap: 8px;
}

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

.control-btn {
    background: none;
    border: none;
    color: var(--text-subdued);
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.play-pause {
    background: white;
    color: black;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 16px;
    transition: transform 0.2s;
}

.play-pause:hover {
    transform: scale(1.05);
    color: black;
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-subdued);
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background-color: #333;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background-color: white;
    border-radius: 2px;
}

.progress-bar:hover .progress-fill {
    background-color: var(--brand-accent);
}

.volume-controls {
    width: 30%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

/* Components */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.content-card {
    background-color: #18181b;
    padding: 16px;
    border-radius: 12px;
    transition: background-color 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid transparent;
}

.content-card:hover {
    background-color: #27272a;
    border-color: #3f3f46;
}

.card-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.content-card:hover .card-img img {
    transform: scale(1.05);
}

.add-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    z-index: 20;
}

.content-card:hover .add-btn {
    opacity: 1;
}

.add-btn:hover {
    background: var(--brand-accent);
    transform: scale(1.1);
}

.play-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 48px;
    height: 48px;
    background-color: var(--brand-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

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

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

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

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid #282828;
    padding: 8px 0 20px 0;
    /* Extra padding for safe area */
    z-index: 900;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-subdued);
    font-size: 10px;
    gap: 4px;
    text-decoration: none;
    width: 25%;
}

.mobile-nav-item.active {
    color: white;
}

.mobile-nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

/* Full Screen Player Modal */
.full-player-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    /* Dynamic Viewport Height for Mobile */
    /* Gradient background like Spotify/Apple Music */
    background: linear-gradient(180deg, #52525b 0%, #18181b 100%);
    z-index: 2200;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
    padding-top: 60px;
}

.full-player-modal.active {
    display: flex;
    animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.full-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    width: 100%;
}

.header-text-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.header-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.header-subtitle {
    font-size: 13px;
    font-weight: 700;
    color: white;
}

.minimize-btn,
.options-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s;
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.full-player-art {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #222;
}

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

.full-player-art video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Default to contain to prevent cropping */
}

#full-player-video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
}

#full-player-video-container video {
    width: 100%;
    height: 100%;
}

.switch-video-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    z-index: 10;
}

.switch-video-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.full-player-info {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 24px;
}

.info-text-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.info-text-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 4px;
}

.info-text-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
    margin-right: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-text-group p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    text-align: left;
}

.like-btn-large {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.progress-bar-large {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-bottom: 8px;
    position: relative;
    cursor: pointer;
}

.progress-fill-large {
    width: 0%;
    height: 100%;
    background: white;
    border-radius: 2px;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.full-player-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    width: 100%;
    padding: 0 8px;
}

.control-btn-large {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.control-btn-large:hover {
    opacity: 1;
}

.play-pause-large {
    width: 72px;
    height: 72px;
    background: white;
    border-radius: 50%;
    color: black;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.play-pause-large:hover {
    transform: scale(1.05);
}

/* Vertical Video Mode Styles */
.full-player-modal.vertical-video-mode {
    padding: 0;
    justify-content: flex-end;
    background: black;
}

.full-player-modal.vertical-video-mode .full-player-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 16px 24px;
    z-index: 10;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
    margin-bottom: 0;
}

.full-player-modal.vertical-video-mode .full-player-art {
    /* Styles handled by JS for full screen video */
    margin-bottom: 0;
    box-shadow: none;
}

.full-player-modal.vertical-video-mode .full-player-info {
    position: relative;
    z-index: 10;
    margin-bottom: 16px;
    padding: 0 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.full-player-modal.vertical-video-mode .info-text h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.full-player-modal.vertical-video-mode .info-text p {
    color: rgba(255, 255, 255, 0.9);
}

.full-player-modal.vertical-video-mode .full-player-progress {
    position: relative;
    z-index: 10;
    padding: 0 24px;
    margin-bottom: 16px;
}

.full-player-modal.vertical-video-mode .full-player-controls {
    position: relative;
    z-index: 10;
    padding: 0 24px 48px 24px;
    margin-bottom: 0;
}

/* Ensure controls are visible over video */
.full-player-modal.vertical-video-mode .control-btn-large,
.full-player-modal.vertical-video-mode .play-pause-large,
.full-player-modal.vertical-video-mode .like-btn-large {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Premium Modal */
.premium-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.premium-modal {
    background: #18181b;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-icon {
    font-size: 48px;
    color: #fbbf24;
    /* Amber-400 */
    margin-bottom: 24px;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.3));
}

.premium-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
}

.premium-desc {
    font-size: 16px;
    color: var(--text-subdued);
    margin-bottom: 32px;
    line-height: 1.5;
}

.premium-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: black;
    font-weight: 700;
    border-radius: 30px;
    text-decoration: none;
    font-size: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.premium-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.premium-close {
    margin-top: 16px;
    background: none;
    border: none;
    color: var(--text-subdued);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes gradientText {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Mobile Media Query */
@media (max-width: 768px) {
    .app-layout {
        display: block;
        /* Remove grid */
        height: 100vh;
        overflow: hidden;
    }

    .sidebar {
        display: none;
        /* Hide desktop sidebar */
    }

    .mobile-nav {
        display: flex;
        /* Show mobile nav */
    }

    /* Mobile Header - Static (Scrolls with content) */
    /* Mobile Header - Static (Scrolls with content) */
    .mobile-header {
        display: flex;
        width: 100%;
        height: auto;
        padding-top: 20px;
        padding-bottom: 20px;
        background: transparent;
        z-index: 10;
        align-items: center;
        justify-content: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 24px;
    }

    .mobile-header .logo {
        font-family: 'Outfit', sans-serif;
        font-size: 24px;
        font-weight: 700;
        margin-bottom: 0;
        display: flex;
        align-items: center;
        gap: 10px;
        background: linear-gradient(to right, #fff, #a5b4fc, #818cf8, #fff);
        background-size: 200% auto;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        letter-spacing: -0.5px;
        animation: gradientText 5s linear infinite;
    }

    .mobile-header .logo i {
        -webkit-text-fill-color: #fff;
        color: white;
    }

    .main-view {
        height: 100dvh;
        /* Full height */
        margin: 0;
        border-radius: 0;
        padding: 0 16px 120px 16px;
        /* Padding bottom for nav + potential player */
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* Transform .player-bar into Mini Player */
    .player-bar {
        position: fixed;
        bottom: 66px;
        left: 0;
        right: 0;
        width: 100%;
        height: 56px;
        background: #27272a;
        border-radius: 0;
        border: none;
        border-top: 1px solid #333;
        padding: 0 12px;
        z-index: 2100;
        margin-bottom: 0;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
        display: none !important;
    }

    .player-bar.visible {
        display: flex !important;
    }

    /* Hide unnecessary controls in mini player */
    /* Hide unnecessary controls in mini player */
    .player-bar .volume-controls,
    .player-bar .control-buttons button:not(.play-pause),
    .player-bar .now-playing img {
        display: none;
    }

    /* Mini Player Progress Bar */
    .player-bar .progress-container {
        display: block;
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 2px;
        background: transparent;
        margin: 0;
        padding: 0;
        pointer-events: none;
    }

    .player-bar .progress-container span {
        display: none;
    }

    .player-bar .progress-bar {
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 0;
        margin: 0;
    }

    .player-bar .progress-fill {
        background: white;
        border-radius: 0;
    }

    .player-bar .now-playing {
        width: auto;
        flex: 1;
        overflow: hidden;
        /* Needed for marquee */
        mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
        display: flex;
        align-items: center;
    }

    .player-bar #like-btn {
        font-size: 22px;
        color: var(--text-subdued);
        padding: 0 12px;
        display: block !important;
        /* Ensure it's visible */
    }

    /* Hide Artist in Mini Player */
    .player-bar .track-artist {
        display: none;
    }

    .player-bar .track-info {
        display: block;
        /* Change from flex to block for marquee */
        white-space: nowrap;
        overflow: hidden;
        flex: 1;
        /* Take remaining space */
    }

    /* Marquee Effect for Title */
    .player-bar .track-title {
        display: inline-block;
        padding-left: 100%;
        animation: marquee 10s linear infinite;
        font-size: 16px;
        /* Slightly larger */
        font-weight: 700;
    }

    @keyframes marquee {
        0% {
            transform: translate(0, 0);
        }

        100% {
            transform: translate(-100%, 0);
        }
    }

    .player-bar .control-buttons {
        gap: 0;
        width: auto;
        margin-right: 4px;
        flex-shrink: 0;
        /* Prevent shrinking */
    }

    .player-bar .play-pause {
        width: 42px;
        height: 42px;
        font-size: 18px;
        background: transparent;
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.2);
        /* Add border for better visibility/touch target */
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-close-btn {
        display: flex !important;
        background: none;
        border: none;
        color: var(--text-subdued);
        font-size: 24px;
        /* Larger close button */
        padding: 8px;
        margin-left: 4px;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Keep categories as 2 columns */
        gap: 12px;
    }

    /* Transform Content Cards (Tracks) into List Items */
    .content-card {
        grid-column: 1 / -1;
        /* Span full width */
        display: grid;
        grid-template-columns: 56px 1fr 40px;
        /* Added space for play button */
        grid-template-rows: auto auto;
        column-gap: 12px;
        align-items: center;
        padding: 8px;
        background: transparent;
        border: none;
    }

    .content-card:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .card-img {
        grid-row: 1 / span 2;
        grid-column: 1;
        width: 56px;
        height: 56px;
        margin-bottom: 0;
        box-shadow: none;
    }

    .card-title {
        grid-row: 1;
        grid-column: 2;
        font-size: 15px;
        margin-bottom: 2px;
        align-self: end;
    }

    .card-desc {
        grid-row: 2;
        grid-column: 2;
        font-size: 13px;
        align-self: start;
    }

    /* Adjust Add Button Position for List View */
    .add-btn {
        width: 24px;
        height: 24px;
        top: 4px;
        left: 4px;
        font-size: 10px;
    }

    .play-overlay {
        display: none;
        /* Hide play overlay on mobile list view */
    }

    /* New Mobile Play Button in List */
    .mobile-list-play-btn {
        grid-column: 3;
        grid-row: 1 / span 2;
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 50%;
        color: white;
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        cursor: pointer;
        justify-self: end;
        /* Force to the right */
        align-self: center;
        /* Force vertical center */
        margin-left: auto;
        /* Double safety */
    }

    .mobile-list-play-btn:active {
        background: rgba(255, 255, 255, 0.2);
    }

    .top-bar {
        margin-bottom: 20px;
    }
}

/* Discovery Modal */
.discovery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    animation: slideUp 0.3s ease-out;
}

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

.discovery-phone-frame {
    position: relative;
    width: 100%;
    max-width: 450px;
    height: 100%;
    max-height: 90vh;
    background: #000;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.discovery-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 16px 20px;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
}

.discovery-header-logo {
    font-size: 18px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
}

.discovery-tabs {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.discovery-tabs span.active {
    color: white;
    position: relative;
}

.discovery-tabs span.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
}

.discovery-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 30;
    padding: 8px;
}

.discovery-header>* {
    pointer-events: auto;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.discovery-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.discovery-close:hover {
    background: rgba(0, 0, 0, 0.5);
}

.discovery-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-y: contain;
}

.discovery-content::-webkit-scrollbar {
    display: none;
}

.discovery-card {
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: #18181b;
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    flex-shrink: 0;
    overflow: hidden;
}

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

.discovery-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 24px;
    padding-top: 80px;
    pointer-events: none;
    z-index: 20;
    /* Ensure above video */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.discovery-info>* {
    pointer-events: auto;
}

.discovery-actions-right {
    position: absolute;
    right: 16px;
    bottom: 100px;
    /* Above timeline and text */
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    z-index: 25;
}

@media (max-width: 768px) {
    .discovery-actions-right {
        bottom: 140px;
        /* Move up on mobile */
        right: 12px;
        gap: 16px;
    }
}

.discovery-details {
    margin-bottom: 12px;
    padding-right: 60px;
    /* Space for right actions */
    text-align: left;
}

.discovery-track-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.discovery-track-artist {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.category-tag {
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #a1a1aa;
    /* Brand accent / Purple */
    transition: color 0.2s ease;
    backdrop-filter: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.category-tag:hover {
    background: transparent;
    border-color: transparent;
    color: white;
    transform: none;
    box-shadow: none;
    text-decoration: underline;
}

.category-tag span {
    margin: 0 4px;
    opacity: 0.6;
}

.discovery-play-btn {
    position: relative;
    /* Reset absolute */
    bottom: auto;
    right: auto;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    z-index: 10;
}

.discovery-play-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.discovery-like-btn {
    position: relative;
    /* Reset absolute */
    top: auto;
    right: auto;
    background: transparent;
    border: none;
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    /* Larger icon like TikTok */
    cursor: pointer;
    transition: transform 0.2s;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.discovery-like-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.5);
}

.discovery-share-btn {
    position: relative;
    background: transparent;
    border: none;
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    /* Slightly smaller than heart */
    cursor: pointer;
    transition: transform 0.2s;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    z-index: 10;
}

.discovery-share-btn:hover {
    transform: scale(1.1);
}

.discovery-mute-btn {
    position: relative;
    background: transparent;
    border: none;
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.2s;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    z-index: 10;
}

.discovery-mute-btn:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .discovery-modal {
        background: #000;
    }

    .discovery-phone-frame {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .discovery-header {
        padding: 16px;
    }

    .discovery-info {
        padding-bottom: 80px;
        /* Space for bottom nav */
    }

    /* Fix for large H1s on mobile */
    h1,
    .playlist-title,
    .category-title {
        font-size: 32px !important;
        line-height: 1.2 !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Search Grid Mobile - 2 Columns */
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Make the last item span full width if it's the only one in the row (odd total count) */
    .card-grid>*:last-child:nth-child(odd) {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .horizontal-scroll .content-card .card-title {
        margin-bottom: 0;
        font-size: 15px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-align: left;
        text-overflow: ellipsis;
        color: white;
        line-height: 1.2;
        width: 100%;
    }
}

/* --- Home View Styles (Moved from home.php & Enhanced) --- */

/* Section Headers - Centered & Premium */
.section-header {
    margin-bottom: 32px;
    margin-top: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

.section-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-subdued);
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1px;
    transition: color 0.2s;
    position: absolute;
    right: 0;
    bottom: 5px;
}

.section-link:hover {
    color: white;
    text-decoration: underline;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 48px;
    margin-top: 32px;
}

.welcome-section h1 {
    font-size: 56px;
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    line-height: 1.1;
    /* Gradient Text */
    background: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Horizontal Scroll Grid */
.horizontal-scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.category-card {
    aspect-ratio: 1;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.category-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.category-card-title {
    position: absolute;
    top: 16px;
    left: 16px;
    font-size: 22px;
    font-weight: 800;
    color: white;
    z-index: 2;
    word-wrap: break-word;
    max-width: 85%;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.category-card-icon {
    position: absolute;
    bottom: -15px;
    right: -15px;
    font-size: 90px;
    color: rgba(255, 255, 255, 0.2);
    transform: rotate(25deg);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
}

.category-card:hover .category-card-icon {
    transform: rotate(10deg) scale(1.1) translate(-5px, -5px);
    color: rgba(255, 255, 255, 0.3);
}

/* Mobile Overrides for Home View */
@media (max-width: 768px) {
    .section-header {
        margin-bottom: 24px;
        margin-top: 32px;
    }

    .section-title {
        font-size: 24px;
        margin-bottom: 16px;
    }

    .welcome-section h1 {
        font-size: 32px !important;
    }

    .horizontal-scroll {
        display: flex;
        flex-direction: column;
        gap: 12px;
        overflow-x: visible;
        padding-bottom: 0;
        margin-right: 0;
        padding-right: 0;
    }

    .horizontal-scroll .content-card {
        width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        background-color: #18181b;
        padding: 12px;
        border-radius: 8px;
        gap: 12px;
        margin-bottom: 0;
    }

    .horizontal-scroll .content-card .card-img {
        width: 56px;
        height: 56px;
        min-width: 56px;
        margin-bottom: 0;
        border-radius: 4px;
        box-shadow: none;
    }

    .horizontal-scroll .content-card .play-overlay {
        display: none !important;
    }

    .horizontal-scroll .content-card .card-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start !important;
        flex: 1;
        min-width: 0;
        text-align: left !important;
        gap: 4px;
    }

    .horizontal-scroll .content-card .card-title {
        margin-bottom: 0;
        font-size: 15px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: left;
        color: white;
        line-height: 1.2;
        width: 100%;
    }

    .horizontal-scroll .content-card .card-desc {
        font-size: 13px;
        color: #a1a1aa;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: left;
        line-height: 1.2;
        width: 100%;
    }

    .horizontal-scroll .content-card .mobile-list-play-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background-color: transparent;
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: white;
        cursor: pointer;
        margin-left: auto;
        flex-shrink: 0;
        font-size: 12px;
    }

    .horizontal-scroll .content-card::after {
        content: none !important;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Footer Styles */
.app-footer {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 32px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-section h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: var(--text-subdued);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: var(--brand-accent);
}

.social-icons {
    display: flex;
    gap: 16px;
}

.social-icons a {
    color: white;
    font-size: 24px;
    transition: transform 0.2s, color 0.2s;
}

.social-icons a:hover {
    color: var(--brand-accent);
    transform: translateY(-2px);
}

.newsletter-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 20px;
}

.newsletter-form input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 6px;
    color: white;
    flex: 1;
    font-family: inherit;
    font-size: 14px;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--brand-accent);
}

.newsletter-form button {
    background: var(--brand-accent);
    color: white;
    border: none;
    padding: 0 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.newsletter-form button:hover {
    background: var(--brand-accent-hover);
}

.copyright {
    color: var(--text-subdued);
    font-size: 12px;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .app-footer {
        display: none;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* --- Search Redesign Styles --- */

/* Discovery Banner */
.discovery-banner-container {
    margin-bottom: 40px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.discovery-banner {
    position: relative;
    width: 100%;
    height: 240px;
    background: #111;
}

.discovery-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    animation: slideShow 15s infinite;
}

.slide:nth-child(1) {
    animation-delay: 0s;
}

.slide:nth-child(2) {
    animation-delay: 5s;
}

.slide:nth-child(3) {
    animation-delay: 10s;
}

@keyframes slideShow {
    0% {
        opacity: 0;
        transform: scale(1.1);
    }

    5% {
        opacity: 1;
        transform: scale(1);
    }

    33% {
        opacity: 1;
        transform: scale(1);
    }

    38% {
        opacity: 0;
        transform: scale(1.1);
    }

    100% {
        opacity: 0;
    }
}

.discovery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px;
}

.discovery-text h3 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.discovery-text p {
    font-size: 16px;
    color: #e0e0e0;
    margin-bottom: 24px;
    max-width: 300px;
}

.discovery-action-btn {
    background: white;
    color: black;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.discovery-action-btn:hover {
    transform: scale(1.05);
    background: #f0f0f0;
}

/* Filter Grids */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

@media (min-width: 769px) {
    .filter-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 24px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .filter-card-btn {
        width: 160px;
        height: 160px;
    }
}

.filter-card-btn {
    background: #1e1e1e;
    border: none;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    height: 140px;
    position: relative;
    overflow: hidden;
}

.filter-card-btn:hover {
    background: #2a2a2a;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.filter-icon-wrapper {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #a5b4fc;
    /* Indigo-300, matching home icons */
    transition: all 0.3s ease;
}

.filter-card-btn:hover .filter-icon-wrapper {
    background: var(--brand-accent);
    color: white;
    transform: scale(1.1);
}

.filter-name {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: #e0e0e0;
}

.filter-card-btn:hover .filter-name {
    color: white;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    /* Start hidden */
}

/* Responsive Title */
.search-section-title {
    margin-bottom: 32px;
    font-size: 32px;
    font-weight: 800;
    text-align: center;
    letter-spacing: -1px;
    width: 100%;
    display: block;
}

@media (max-width: 768px) {
    .search-section-title {
        font-size: 24px;
        /* Smaller font on mobile */
        margin-bottom: 24px;
        text-align: center;
        /* Ensure center on mobile */
    }
}

/* Duration Grid */
.duration-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.duration-btn {
    background: transparent;
    border: 1px solid #333;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.duration-btn:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .discovery-banner {
        height: 300px;
    }

    .discovery-overlay {
        background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0.9) 100%);
        justify-content: flex-end;
        align-items: flex-start;
    }

    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Search Bar Modernization */
.search-header-container {
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.search-container {
    width: 100%;
    max-width: 500px;
    /* Slightly wider for desktop */
    position: relative;
    transition: transform 0.3s ease;
}

.search-container:focus-within {
    transform: scale(1.02);
}

.search-input {
    width: 100%;
    padding: 16px 16px 16px 52px;
    border-radius: 50px;
    border: 1px solid transparent;
    font-size: 16px;
    background-color: #27272a;
    /* Dark grey */
    color: white;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-input::placeholder {
    color: #a1a1aa;
}

.search-input:focus {
    background-color: #3f3f46;
    border-color: var(--brand-accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #a1a1aa;
    font-size: 18px;
    pointer-events: none;
    transition: color 0.3s;
}

.search-input:focus+.search-icon,
.search-container:focus-within .search-icon {
    color: white;
}

/* Mobile Adaptation */
@media (max-width: 768px) {
    .search-header-container {
        margin-bottom: 24px;
        padding: 0 16px;
        /* Ensure some padding on sides */
    }

    .search-container {
        max-width: 100%;
        /* Full width on mobile */
    }

    .search-input {
        font-size: 15px;
        padding: 14px 14px 14px 48px;
    }
}

/* Goals Section Redesign */
.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.goal-card-btn {
    background-color: #18181b;
    border: 1px solid #27272a;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.goal-card-btn:hover {
    background-color: #27272a;
    border-color: #3f3f46;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.goal-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.goal-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--brand-accent);
    transition: all 0.3s ease;
}

.goal-card-btn:hover .goal-icon-wrapper {
    background-color: var(--brand-accent);
    color: white;
}

.goal-name {
    font-size: 16px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

.goal-arrow {
    color: var(--text-subdued);
    font-size: 14px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.goal-card-btn:hover .goal-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile adjustments for Goals */
@media (max-width: 768px) {
    .goals-grid {
        grid-template-columns: 1fr;
    }
}

/* Center Recommendations on Desktop */
@media (min-width: 769px) {
    #search-no-results .card-grid {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 24px;
    }

    #search-no-results .content-card {
        width: 200px;
        flex: 0 0 auto;
    }

    #search-no-results .section-title {
        text-align: center !important;
    }
}

/* Card Category Style */
.card-category {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--brand-accent);
    margin-bottom: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.card-category a {
    color: inherit;
    text-decoration: none;
}

.card-category a:hover {
    text-decoration: underline;
}

/* Mobile Search Results Redesign */
@media (max-width: 768px) {
    .results-header {
        justify-content: center;
        position: relative;
        margin-bottom: 32px !important;
    }

    .back-btn {
        position: absolute;
        left: 0;
        font-size: 24px !important;
        padding: 8px;
    }

    .results-title {
        font-size: 24px !important;
        font-weight: 700;
        text-align: center;
        width: 100%;
    }

    #search-results .card-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    #search-results .content-card {
        display: grid;
        grid-template-columns: 56px 1fr 40px;
        grid-template-areas:
            "img info btn";
        align-items: center;
        gap: 0 16px;
        padding: 12px;
        height: auto;
        background: transparent;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 0;
    }

    #search-results .content-card:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    #search-results .card-img {
        grid-area: img;
        width: 56px;
        height: 56px;
        margin: 0;
        border-radius: 4px;
    }

    #search-results .card-info {
        grid-area: info;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        /* Enable text overflow */
    }

    #search-results .card-title {
        font-size: 16px;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100% !important;
    }

    #search-results .card-desc {
        font-size: 13px;
        color: var(--text-subdued);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #search-results .mobile-list-play-btn {
        grid-area: btn;
        display: flex !important;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        align-items: center;
        justify-content: center;
        justify-self: end;
    }

    #search-results .mobile-list-play-btn:active {
        background: rgba(255, 255, 255, 0.2);
    }

    #search-results .play-overlay,
    #search-results .add-btn {
        display: none !important;
    }
}

/* Discovery Timeline */
.discovery-timeline-container {
    position: relative;
    width: 100%;
    height: 30px;
    /* Larger hit area */
    background: transparent;
    margin-top: 16px;
    z-index: 100;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
}

/* Visual Rail */
.discovery-timeline-container::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    top: 50%;
    transform: translateY(-50%);
    transition: height 0.2s, background 0.2s;
}

.discovery-timeline-container:hover::before {
    height: 10px;
    background: rgba(255, 255, 255, 0.7);
}



.discovery-timeline-progress {
    height: 6px;
    background: var(--brand-accent);
    width: 0%;
    transition: width 0.1s linear, height 0.2s;
    position: relative;
    border-radius: 3px;
    z-index: 2;
    /* Above rail */
}

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

.discovery-timeline-progress::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.discovery-timeline-container:hover .discovery-timeline-progress::after {
    opacity: 1;
}

/* Video Loading Spinner */
.video-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -25px;
    margin-left: -25px;
    z-index: 5;
    display: none;
    /* Hidden by default */
}

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

/* Discovery Profile Button */
.discovery-profile-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    text-decoration: none;
    transition: transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.discovery-profile-btn:hover {
    transform: scale(1.1);
}

.discovery-profile-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-initial {
    font-size: 20px;
    font-weight: 700;
    color: white;
}

/* Play/Pause Animation Overlay */
.play-pause-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    color: rgba(255, 255, 255, 0.9);
    /* Increased opacity */
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    animation: fadeOutIcon 0.8s ease-out forwards;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
    /* Add shadow for visibility */
}

@keyframes fadeOutIcon {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* Discovery Search Scroll Hint Animation */
@keyframes verticalScrollHint {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.scroll-hint-animation {
    animation: verticalScrollHint 1.5s ease-in-out 3;
    /* Run 3 times */
}

/* Hide Discovery Play Button only for Videos */
.discovery-card.is-video .discovery-play-btn {
    display: none !important;
}

/* Hide Native Video Play Button Overlay */
video::-webkit-media-controls-start-playback-button,
video::-webkit-media-controls-overlay-play-button {
    display: none !important;
    -webkit-appearance: none;
}

/* --- Ad System Styles --- */

/* Ad Track Row (List Item) */
.ad-track-row {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: #18181b;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ad-track-row:hover {
    background-color: #27272a;
    border-color: rgba(255, 255, 255, 0.1);
}

.ad-track-img {
    width: 64px;
    height: 64px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 16px;
    flex-shrink: 0;
}

.ad-track-info {
    display: flex;
    flex-direction: column;
}

.ad-track-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.ad-track-subtitle {
    font-size: 12px;
    color: var(--text-subdued);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ad-badge {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-subdued);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ad Banner (Home) */
.ad-home-banner {
    display: block;
    width: 100%;
    margin-bottom: 32px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 4;
    /* Wide generic banner */
    background-color: #222;
    text-decoration: none;
    transition: transform 0.2s;
}

.ad-home-banner:hover {
    transform: scale(1.01);
}

.ad-home-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ad-banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ad-banner-badge {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ad-banner-cta {
    background: white;
    color: black;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .ad-home-banner {
        aspect-ratio: 16 / 9;
        /* Taller on mobile */
    }
}

/* Ad Card (Grid) */
.ad-card-component {
    /* Inherits card styles mostly */
    background-color: #18181b;
    border-radius: 12px;
    padding: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: background-color 0.3s ease;
    border: 1px solid transparent;
}

.ad-card-component:hover {
    background-color: #27272a;
    border-color: #3f3f46;
}

.ad-card-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    object-fit: cover;
}

.ad-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    z-index: 10;
}

/* Toast Notifications System */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: #18181b;
    border: 1px solid #333;
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 90vw;
    animation: slideInToast 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: auto;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform-origin: right center;
    opacity: 0;
}

.toast.success {
    border-left: 4px solid var(--success, #22c55e);
}

.toast.error {
    border-left: 4px solid var(--danger, #ef4444);
}

.toast.info {
    border-left: 4px solid var(--brand-accent, #6366f1);
}

.toast-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.success .toast-icon {
    color: var(--success, #22c55e);
}

.toast.error .toast-icon {
    color: var(--danger, #ef4444);
}

.toast.info .toast-icon {
    color: var(--brand-accent, #6366f1);
}

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

.toast-close {
    background: none;
    border: none;
    color: var(--text-subdued);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.toast-close:hover {
    color: white;
}

@keyframes slideInToast {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOutToast {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Mobile Toast Adjustments */
@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 110px;
        /* Above nav/player */
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 92%;
        align-items: center;
    }

    .toast {
        width: 100%;
        min-width: auto;
        justify-content: flex-start;
        animation: slideUpToast 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        transform-origin: bottom center;
    }

    @keyframes slideUpToast {
        from {
            transform: translateY(20px);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}