/* ========================================
   NYONGJJONGI'S PLAYLIST – STYLESHEET
   Music Player Only ✨
   ======================================== */

/* ---------- RESET & VARIABLES ---------- */
:root {
    --bg-primary: #050010;
    --neon-pink: #ff2d95;
    --neon-purple: #b44dff;
    --neon-cyan: #00e5ff;
    --gold: #ffd700;
    --white: #ffffff;
    --soft-white: #e0d6f0;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-body: 'Noto Sans KR', 'Outfit', sans-serif;
    --font-heading: 'Outfit', 'Noto Sans KR', sans-serif;
    --font-display: 'Dancing Script', cursive;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%; min-height: 100vh;
    background: var(--bg-primary);
    color: var(--white);
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    overflow-x: hidden;
}

/* ---------- MUSIC PAGE LAYOUT ---------- */
.music-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 16px 32px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(180, 77, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 30%, rgba(180, 77, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 45, 149, 0.08) 0%, transparent 50%),
        linear-gradient(160deg, #0c0020 0%, #140030 50%, #05000d 100%);
}

/* ---------- HEADER ---------- */
.music-header {
    text-align: center;
    margin-bottom: 32px;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.title-emoji {
    font-size: 2.4rem;
    animation: icon-float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.5));
}

.title-text {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan), var(--gold));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
}

.section-sub {
    font-family: var(--font-display);
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: var(--soft-white);
    opacity: 0.7;
    letter-spacing: 1px;
}

/* Playback Info Badges */
.playback-info {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.rotation-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.4s ease;
}

.rotation-badge.active {
    background: rgba(0, 229, 255, 0.12);
    border-color: rgba(0, 229, 255, 0.4);
    color: var(--neon-cyan);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
}

.rotation-badge.active .badge-dot {
    background: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
    animation: dot-pulse 1.5s ease-in-out infinite;
}

.timer-badge {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    padding: 6px 14px;
    min-width: 120px;
    text-align: center;
}

/* ---------- ALBUM GRID ---------- */
.music-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 680px;
}

.album-wrapper {
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 14px;
    overflow: hidden;
}

.album-wrapper:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 40px rgba(180, 77, 255, 0.25);
}

.album-wrapper.now-playing {
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.4), 0 0 60px rgba(0, 229, 255, 0.15);
}

.album-cover {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 6px;
    border-radius: 14px;
    overflow: hidden;
}


/* Cover art - gradient album art */
.cover-art-1 {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 40%, #c0392b 100%);
    position: relative;
}
.cover-art-1::after {
    content: '🎂';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -60%);
    font-size: clamp(2rem, 8vw, 3rem);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    z-index: 2;
    pointer-events: none;
}

.cover-art-2 {
    background: linear-gradient(135deg, #0abde3 0%, #10ac84 50%, #1289A7 100%);
}
.cover-art-2::after {
    content: '🌊';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -60%);
    font-size: clamp(2rem, 8vw, 3rem);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    z-index: 2;
    pointer-events: none;
}

.cover-art-3 {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 50%, #4834d4 100%);
}
.cover-art-3::after {
    content: '✈️';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -60%);
    font-size: clamp(2rem, 8vw, 3rem);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    z-index: 2;
    pointer-events: none;
}

.cover-art-4 {
    background: linear-gradient(135deg, #2b1055 0%, #4a2080 40%, #7597de 100%);
}
.cover-art-4::after {
    content: '🏠';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -60%);
    font-size: clamp(2rem, 8vw, 3rem);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    z-index: 2;
    pointer-events: none;
}

.cover-art-5 {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 50%, #ff6b6b 100%);
}
.cover-art-5::after {
    content: '🍖';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -60%);
    font-size: clamp(2rem, 8vw, 3rem);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    z-index: 2;
    pointer-events: none;
}

.cover-art-6 {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 60%, #1a0533 100%);
}
.cover-art-6::after {
    content: '❄️';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -60%);
    font-size: clamp(2rem, 8vw, 3rem);
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    z-index: 2;
    pointer-events: none;
}

/* Subtle overlay for depth */
.album-cover::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
    z-index: 1;
    border-radius: 14px;
}

.album-wrapper:hover .album-cover {
    filter: brightness(1.1) contrast(1.05);
}

/* Removed emoji transform styles */
/* .album-cover::before styles removed as we use abstract art now */

.album-info {
    position: relative;
    z-index: 3;
    text-align: left; /* Center -> Left 정렬 변경 */
    padding: 12px 14px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    width: 100%;
    margin-top: auto; /* 하단 고정 */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0 0 14px 14px;
}

.album-info h3 {
    font-family: var(--font-heading);
    font-size: clamp(0.85rem, 2.5vw, 1rem); /* 폰트 키움 */
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.02em;
}

.album-info p {
    font-family: var(--font-body);
    font-size: clamp(0.65rem, 2vw, 0.75rem);
    opacity: 0.8;
    margin-top: 4px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* Play overlay */
.play-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 36px; height: 36px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 4;
}

.play-overlay::before {
    content: '▶';
    font-size: 0.75rem;
    color: white;
    margin-left: 2px;
}

.album-wrapper:hover .play-overlay {
    opacity: 1;
    background: rgba(255, 45, 149, 0.6);
    box-shadow: 0 0 10px rgba(255, 45, 149, 0.4);
}

/* Now Playing Indicator (eq bars) */
.now-playing-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    z-index: 5;
}

.now-playing-indicator.hidden { display: none; }

.now-playing-indicator span {
    width: 3px;
    background: var(--neon-cyan);
    border-radius: 2px;
    animation: eq-bar 0.8s ease-in-out infinite;
    box-shadow: 0 0 4px var(--neon-cyan);
}

.now-playing-indicator span:nth-child(1) { animation-delay: 0s; height: 60%; }
.now-playing-indicator span:nth-child(2) { animation-delay: 0.15s; height: 100%; }
.now-playing-indicator span:nth-child(3) { animation-delay: 0.3s; height: 40%; }

/* ======= POPUP PLAYER ======= */
.music-popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}

.music-popup.hidden {
    opacity: 0;
    pointer-events: none;
}

.music-popup.visible {
    opacity: 1;
    pointer-events: auto;
}

.popup-backdrop {
    position: absolute;
    inset: 0;
    /* 스포트라이트 효과: 중앙은 약간 밝고 주변은 어둡게 */
    background: radial-gradient(circle at center, rgba(20, 10, 40, 0.95) 0%, rgba(5, 0, 10, 0.98) 70%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.popup-player {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 28px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Vinyl */
.popup-vinyl {
    width: 240px; height: 240px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 레코드판이 배경에 묻히지 않게 네온 글로우 & 테두리 추가 */
    box-shadow: 
        0 0 0 2px rgba(255, 255, 255, 0.1), /* 얇은 테두리 */
        0 0 60px rgba(180, 77, 255, 0.25), /* 보라색 글로우 */
        0 0 120px rgba(0, 229, 255, 0.15); /* 청록색 글로우 */
    transition: box-shadow 0.5s ease;
}

/* 재생 중일 때 글로우 더 강하게 */
.popup-vinyl.playing {
    box-shadow: 
        0 0 0 2px rgba(255, 255, 255, 0.2), 
        0 0 80px rgba(180, 77, 255, 0.5), 
        0 0 160px rgba(0, 229, 255, 0.3);
}

.popup-vinyl-disc {
    width: 100%; height: 100%;
    border-radius: 50%;
    /* 더 진한 검정 + 메탈릭 반사광 */
    background: conic-gradient(from 0deg,
        #222 0%, #111 25%, #333 45%, #000 50%, #333 55%, #111 75%, #222 100%);
    box-shadow: 
        inset 0 0 40px rgba(0,0,0,0.9), 
        inset 0 0 10px rgba(255,255,255,0.1); /* 미세한 광택 */
    animation: popupSpin 3s linear infinite;
}

.popup-vinyl-disc::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 200px; height: 200px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow:
        inset 0 0 40px rgba(0,0,0,0.5),
        0 0 1px rgba(255,255,255,0.06);
}

.popup-vinyl-disc::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, #333, #111);
    border: 2px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.popup-cover {
    position: absolute;
    width: 80px; height: 80px;
    border-radius: 50%;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    animation: popupSpin 3s linear infinite;
}

/* Popup Details */
.popup-details {
    text-align: center;
}

.popup-details h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.popup-details p {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 12px;
}

/* Progress bar */
.popup-progress {
    width: 260px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 6px;
}

.popup-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan));
    border-radius: 2px;
    transition: width 0.3s linear;
}

.popup-time-row {
    display: flex;
    justify-content: space-between;
    width: 260px;
    margin: 0 auto;
}

.popup-time, .popup-duration {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Controls */
/* Controls */
.popup-progress-wrapper {
    width: 100%;
    margin: 20px 0 8px;
    display: flex;
    align-items: center;
}

.popup-seek-bar {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: background 0.3s;
}

/* Slider Thumb */
.popup-seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: transform 0.1s;
    margin-top: -4px; /* Center thumb on track */
}

.popup-seek-bar::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: transparent;
    border-radius: 2px;
}
/* Firefox styles */
.popup-seek-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.popup-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin: 24px 0 10px;
}

.popup-ctrl-btn {
    width: 44px; height: 44px;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.popup-play-btn {
    width: 64px; height: 64px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.popup-play-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.popup-play-btn:active {
    transform: scale(0.95);
}

.popup-stop-btn {
    /* Main controls (play/pause) are central, stop is auxiliary now */
    background: transparent;
    border: none;
    color: rgba(255, 107, 107, 0.8);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-stop-btn:hover {
    color: #ff6b6b;
    transform: scale(1.1);
}

/* Queue info */
.popup-queue-info {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    font-style: italic;
}

/* Lyrics Panel */
.popup-lyrics {
    margin-top: 15px;
    height: 140px;
    overflow-y: auto;
    text-align: center;
    font-size: 15px;
    line-height: 2;
    color: rgba(255, 255, 255, 0.6);
    mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
    padding: 20px 0;
    scroll-behavior: smooth;
    width: 100%;
}

.popup-lyrics::-webkit-scrollbar {
    display: none;
}

.lyrics-line {
    padding: 6px 10px;
    transition: all 0.4s ease;
    border-radius: 8px;
    margin: 0 auto;
    max-width: 90%;
}

.lyrics-line.active {
    color: #fff;
    font-weight: 700;
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
}

.lyrics-section {
    color: var(--neon-cyan);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 20px 0 10px;
    opacity: 0.8;
}

/* ---------- FOOTER ---------- */
.site-footer {
    margin-top: auto;
    padding-top: 40px;
    text-align: center;
    opacity: 0.3;
    font-size: 0.8rem;
}

/* ======= MOBILE ======= */
@media (max-width: 768px) {
    .music-page {
        padding: 24px 16px 24px;
    }

    .music-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        max-width: 100%;
        width: 100%;
    }

    .album-wrapper {
        border-radius: 16px;
    }

    .album-cover {
        border-radius: 16px;
        min-height: 140px;
    }

    .album-info h3 {
        font-size: 0.9rem;
    }

    .album-info p {
        font-size: 0.7rem;
    }

    /* Popup: full-screen bottom sheet style */
    .music-popup {
        align-items: flex-end;
    }

    .popup-backdrop {
        background: rgba(5, 0, 13, 0.85);
    }

    .popup-player {
        width: 100%;
        max-height: 92vh;
        border-radius: 28px 28px 0 0;
        background: linear-gradient(180deg, #1a0a30 0%, #0c0020 100%);
        border-top: 1px solid rgba(255,255,255,0.1);
        padding: 20px 24px 40px;
        gap: 16px;
        box-shadow: 0 -20px 60px rgba(0,0,0,0.5);
    }

    .popup-vinyl {
        width: 160px;
        height: 160px;
    }

    .popup-vinyl-disc::before {
        width: 140px; height: 140px;
    }

    .popup-cover {
        width: 55px; height: 55px;
    }

    .popup-details {
        width: 100%;
    }

    .popup-details h3 {
        font-size: 1.2rem;
    }

    .popup-progress-wrapper {
        width: 100%;
        margin: 12px 0 4px;
    }

    .popup-time-row {
        width: 100%;
    }

    .popup-lyrics {
        width: 100%;
        max-height: 120px;
        font-size: 0.8rem;
        padding: 10px 0;
    }

    .popup-controls {
        gap: 20px;
        margin: 12px 0 6px;
    }

    .popup-play-btn {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }

    .popup-ctrl-btn {
        width: 42px;
        height: 42px;
    }

    .popup-player {
        gap: 12px;
    }
}

@media (max-width: 380px) {
    .music-container {
        gap: 12px;
    }

    .album-cover {
        min-height: 120px;
    }
}

/* ======= ANIMATIONS ======= */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes popupSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes coverSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.popup-cover {
    animation: coverSpin 3s linear infinite;
}

@keyframes lyricsFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes eq-bar {
    0%, 100% { height: 30%; }
    50% { height: 100%; }
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}
