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

:root {
    --font-heading: 'Rozha One', 'Yatra One', serif;
    --font-sans: 'Poppins', sans-serif;
    --player-bg: rgba(65, 30, 25, 0.75);
    --player-border: rgba(255, 255, 255, 0.15);
    --accent-color: #ff4747;
    --text-main: #ffffff;
    --text-sub: rgba(255, 255, 255, 0.75);
}

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-sans);
    color: var(--text-main);
    user-select: none;
    background-color: #120907;
}

/* Background Crossfade Rotator Layers */
.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    transition: opacity 1.2s ease-in-out;
    z-index: 1;
}

#bgLayer1 {
    opacity: 1;
}

#bgLayer2 {
    opacity: 0;
}

/* Main App Wrapper */
.app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 24px 36px;
    z-index: 2;
}

/* Header Navbar */
.top-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.header-left .live-clock {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    color: var(--text-main);
}

/* Header Center Text Logo */
.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo-text {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.8),
        0 1px 3px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cat-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 18px;
    border-radius: 24px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
}

.cat-filter-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.cat-filter-btn.active {
    background: rgba(255, 71, 71, 0.85);
    border-color: #ff4747;
    box-shadow: 0 4px 18px rgba(255, 71, 71, 0.45);
    color: #ffffff;
}

/* Hero Title Section */
.hero-content {
    position: absolute;
    top: calc(50% - 45px);
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 90%;
    max-width: 950px;
    z-index: 5;
    pointer-events: none;
}

.save-badge {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #e60023;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.save-badge:hover {
    transform: scale(1.05);
}

.main-title {
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 7.5vw, 6.2rem);
    line-height: 0.95;
    color: #ffffff;
    text-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.6);
    letter-spacing: -1px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-title span {
    display: block;
}

/* Floating Glassmorphic Audio Player */
.player-container {
    width: min(92%, 680px);
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.glass-player {
    background: var(--player-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--player-border);
    border-radius: 50px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.6),
        inset 0 1px 1px rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
}

.glass-player:hover {
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.7),
        inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

/* Album Art */
.album-cover-wrapper {
    position: relative;
    width: 58px;
    height: 58px;
    flex-shrink: 0;
}

.album-cover {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: transform 0.5s ease;
}

.album-cover.playing {
    animation: rotate-album 15s linear infinite;
}

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

/* Track Info & Progress */
.track-details-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.track-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.track-info {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

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

/* Progress Slider */
.progress-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.timeline-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.25);
    outline: none;
    cursor: pointer;
    transition: height 0.15s ease;
}

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

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s ease;
}

.timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.time-display {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-sub);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Player Control Buttons */
.player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.control-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.08);
}

.control-btn.play-btn {
    background: #ffffff;
    color: #2b110a;
    width: 42px;
    height: 42px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.control-btn.play-btn:hover {
    background: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255,255,255,0.4);
}

.control-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.control-btn.play-btn svg {
    width: 18px;
    height: 18px;
    margin-left: 2px;
}

.control-btn.play-btn.playing svg {
    margin-left: 0;
}

/* Extra Controls: Volume & Playlist Toggle */
.extra-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding-left: 10px;
    margin-left: 4px;
}

/* Modal / Dropdown Playlist */
.playlist-modal {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: rgba(35, 15, 12, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    gap: 10px;
    max-height: 350px;
    overflow-y: auto;
    z-index: 30;
    animation: fadeIn 0.25s ease-out;
}

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

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

.playlist-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-sub);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.playlist-item.active {
    background: rgba(255, 255, 255, 0.2);
    border-left: 3px solid #ff4747;
}

.playlist-item img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
}

.playlist-item-info {
    flex: 1;
    overflow: hidden;
}

.playlist-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item-artist {
    font-size: 0.75rem;
    color: var(--text-sub);
}

/* Custom Scrollbar */
.playlist-modal::-webkit-scrollbar {
    width: 4px;
}
.playlist-modal::-webkit-scrollbar-track {
    background: transparent;
}
.playlist-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 16px;
    }

    .hero-content {
        top: calc(50% - 35px);
    }

    .main-title {
        font-size: clamp(2.4rem, 10vw, 3.6rem);
    }

    .glass-player {
        padding: 10px 16px;
        gap: 10px;
        border-radius: 35px;
    }

    .album-cover-wrapper {
        width: 46px;
        height: 46px;
    }

    .extra-controls {
        display: none;
    }
}
