* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6f91;
    --primary-deep: #b8325f;
    --accent-color: #ffd1dc;
    --gold-color: #f4c76b;
    --dark-bg: #150915;
    --secondary-bg: #241020;
    --tertiary-bg: #35152d;
    --panel-bg: rgba(255, 231, 238, 0.08);
    --panel-border: rgba(255, 209, 220, 0.18);
    --text-primary: #fff7fa;
    --text-secondary: #e7b8c7;
    --text-tertiary: #b98698;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background:
        linear-gradient(135deg, #150915 0%, #2a1025 44%, #4a1635 100%);
    color: var(--text-primary);
    overflow: hidden;
}

.music-player {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(155deg, rgba(255, 111, 145, 0.16) 0%, rgba(21, 9, 21, 0) 36%),
        linear-gradient(25deg, rgba(244, 199, 107, 0.12) 0%, rgba(21, 9, 21, 0) 32%),
        linear-gradient(135deg, var(--dark-bg) 0%, var(--secondary-bg) 48%, #3a142e 100%);
    overflow: hidden;
    position: relative;
}

.music-player::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 209, 220, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 209, 220, 0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 82%);
}

/* ============ FIRST OPEN INTRO ============ */
.intro-screen {
    position: absolute;
    inset: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 32px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 34%, rgba(255, 111, 145, 0.18), transparent 34%),
        linear-gradient(135deg, rgba(21, 9, 21, 0.98), rgba(53, 21, 45, 0.98));
    color: var(--text-primary);
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.intro-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-salutation {
    margin-bottom: -6px;
    color: var(--gold-color);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: lowercase;
}

.intro-heart {
    width: 150px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: heartPulse 1.8s ease-in-out infinite;
}

.intro-heart::before {
    content: "\2665";
    color: #9d5272;
    font-size: 142px;
    line-height: 1;
    text-shadow: 0 20px 60px rgba(21, 9, 21, 0.48);
}

.intro-message {
    max-width: 420px;
    font-size: 24px;
    line-height: 1.35;
    font-weight: 750;
    color: #ffe7ee;
    text-wrap: balance;
}

.intro-btn {
    min-width: 132px;
    border: 1px solid rgba(255, 231, 238, 0.42);
    border-radius: 999px;
    padding: 13px 26px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: #2a1025;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 16px 38px rgba(255, 111, 145, 0.26);
    transition: transform 0.2s, box-shadow 0.2s;
}

.intro-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 42px rgba(255, 111, 145, 0.34);
}

/* ============ VIEW MANAGEMENT ============ */
.player-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: opacity 0.3s ease;
    opacity: 1;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

.player-view.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.playlist-fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(155deg, rgba(255, 111, 145, 0.14), transparent 38%),
        linear-gradient(135deg, var(--dark-bg), #2c1027 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.playlist-fullscreen.active {
    opacity: 1;
    pointer-events: auto;
}

/* ============ PLAYLIST HEADER ============ */
.playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(36, 16, 32, 0.84);
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    gap: 16px;
    position: relative;
    overflow: visible;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--primary-color);
}

.playlist-info-header {
    flex: 1;
    text-align: center;
}

/* ============ SEARCH CONTAINER ============ */
.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    margin: 8px 20px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    color: var(--text-secondary);
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    outline: none;
    font-size: 14px;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

/* ============ FULLSCREEN SONGS LIST ============ */
.songs-list-fullscreen {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
    padding-bottom: 120px;
}

.songs-list-fullscreen::-webkit-scrollbar {
    width: 6px;
}

.songs-list-fullscreen::-webkit-scrollbar-track {
    background: transparent;
}

.songs-list-fullscreen::-webkit-scrollbar-thumb {
    background: rgba(255, 209, 220, 0.35);
    border-radius: 10px;
}

.songs-list-fullscreen::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ============ MINI PLAYER ============ */
.mini-player {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(36, 16, 32, 0.9);
    border-top: 1px solid var(--panel-border);
    box-shadow: 0 -16px 44px rgba(21, 9, 21, 0.4);
    backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    gap: 12px;
}

.mini-player-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.mini-album-art {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--tertiary-bg);
    border: 1px solid var(--panel-border);
}

.mini-song-info {
    flex: 1;
    min-width: 0;
}

.mini-song-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-song-artist {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-controls {
    display: flex;
    gap: 8px;
}

.mini-control-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.mini-control-btn:hover {
    transform: scale(1.1);
}

.mini-play-icon {
    opacity: 1;
}

.mini-pause-icon {
    opacity: 0;
    display: none;
}

.mini-pause-icon:not(.hidden) {
    opacity: 1;
    display: block;
}
.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(21, 9, 21, 0.72);
    border-bottom: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    gap: 16px;
    position: relative;
    overflow: visible;
}

.header-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.header-btn:hover {
    color: var(--primary-color);
}

.player-menu {
    position: fixed;
    top: 56px;
    right: 16px;
    z-index: 10000;
    display: none;
    min-width: 112px;
    padding: 6px;
    background: rgba(36, 16, 32, 0.96);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(21, 9, 21, 0.46);
    backdrop-filter: blur(16px);
}

.player-menu.open {
    display: block;
}

.player-menu-item {
    width: 100%;
    border: 0;
    border-radius: 9px;
    padding: 10px 12px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
}

.player-menu-item:hover {
    background: rgba(255, 111, 145, 0.14);
    color: var(--accent-color);
}

.playlist-info {
    flex: 1;
    text-align: center;
}

.playlist-label {
    font-size: 12px;
    color: var(--gold-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.playlist-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: capitalize;
    text-shadow: 0 2px 18px rgba(255, 111, 145, 0.28);
}

/* ============ ALBUM SECTION ============ */
.album-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px 20px 34px;
    min-height: 300px;
}

.album-container {
    width: 100%;
    max-width: 318px;
    aspect-ratio: 1;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 209, 220, 0.28);
    box-shadow:
        0 26px 80px rgba(21, 9, 21, 0.62),
        0 0 0 10px rgba(255, 209, 220, 0.055),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    animation: fadeIn 0.3s ease-in;
    position: relative;
}

.album-container::after {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(255, 231, 238, 0.18);
    border-radius: 20px;
    pointer-events: none;
}

.album-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--tertiary-bg);
    transform-origin: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============ SONG INFO ============ */
.song-info-section {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 22px 20px;
    gap: 16px;
}

.song-details {
    flex: 1;
    min-width: 0;
}

.song-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    word-break: break-word;
    white-space: normal;
}

.song-artist {
    font-size: 14px;
    color: var(--text-secondary);
}

.like-btn {
    background: rgba(255, 209, 220, 0.08);
    border: 1px solid rgba(255, 209, 220, 0.16);
    border-radius: 999px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
    transition: color 0.2s, transform 0.2s;
}

.like-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
    background: rgba(255, 111, 145, 0.14);
}

.like-btn.liked {
    color: var(--primary-color);
    fill: var(--primary-color);
}

/* ============ PROGRESS SECTION ============ */
.progress-section {
    padding: 20px;
    padding-top: 0;
}

.progress-bar {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(255, 111, 145, 0.32), rgba(255, 209, 220, 0.12));
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    margin-bottom: 12px;
}

.progress-bar::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 2px solid var(--primary-deep);
    box-shadow: 0 0 0 5px rgba(255, 111, 145, 0.14);
    cursor: pointer;
    transition: transform 0.2s;
}

.progress-bar::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.progress-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-tertiary);
}

.time {
    font-variant-numeric: tabular-nums;
}

/* ============ CONTROLS SECTION ============ */
.controls-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 28px 20px;
}

.control-btn {
    background: rgba(255, 231, 238, 0.045);
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
    position: relative;
}

.control-btn:hover {
    color: var(--text-primary);
    transform: scale(1.05);
    background: rgba(255, 209, 220, 0.1);
    border-color: rgba(255, 209, 220, 0.14);
}

.control-btn.active {
    color: var(--primary-color);
    background: rgba(255, 111, 145, 0.14);
    border-color: rgba(255, 111, 145, 0.26);
}

.shuffle-btn,
.repeat-once-btn {
    font-size: 12px;
}

.shuffle-icon-img {
    filter: brightness(0) saturate(100%) invert(83%) sepia(16%) saturate(550%) hue-rotate(296deg) brightness(98%) contrast(90%);
    transition: filter 0.2s;
}

.shuffle-btn.active .shuffle-icon-img {
    filter: brightness(0) saturate(100%) invert(62%) sepia(71%) saturate(963%) hue-rotate(306deg) brightness(101%) contrast(101%);
}

.control-icon-img {
    filter: brightness(0) saturate(100%) invert(83%) sepia(16%) saturate(550%) hue-rotate(296deg) brightness(98%) contrast(90%);
    transition: filter 0.2s;
}

.sound-icon-img {
    filter: brightness(0) saturate(100%) invert(83%) sepia(16%) saturate(550%) hue-rotate(296deg) brightness(98%) contrast(90%);
    transition: filter 0.2s;
}

.repeat-once-btn.active .repeat-once-icon-img {
    filter: brightness(0) saturate(100%) invert(62%) sepia(71%) saturate(963%) hue-rotate(306deg) brightness(101%) contrast(101%);
}

.repeat-once-icon-img {
    filter: brightness(0) saturate(100%) invert(83%) sepia(16%) saturate(550%) hue-rotate(296deg) brightness(98%) contrast(90%);
    transition: filter 0.2s;
}

.main-play-btn {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color) 58%, var(--primary-deep));
    border-radius: 50%;
    color: #2a1025;
    border: 1px solid rgba(255, 231, 238, 0.42);
    box-shadow: 0 12px 34px rgba(255, 111, 145, 0.26);
    transition: transform 0.2s, box-shadow 0.2s;
}

.main-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 16px 38px rgba(255, 111, 145, 0.38);
}

.main-play-btn:active {
    transform: scale(0.95);
}

.play-icon {
    opacity: 1;
}

.play-icon.hidden {
    opacity: 0;
    display: none;
}

.pause-icon {
    opacity: 0;
    display: none;
}

.pause-icon.hidden {
    opacity: 0;
}

.pause-icon:not(.hidden) {
    opacity: 1;
    display: block;
}

/* ============ VOLUME SECTION ============ */
.volume-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: var(--text-secondary);
}

.volume-slider {
    flex: 1;
    max-width: 150px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(255, 111, 145, 0.35), rgba(255, 209, 220, 0.14));
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 2px solid var(--primary-deep);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: none;
}

/* ============ PLAYLIST SECTION ============ */
.playlist-section {
    padding: 20px;
    border-top: 1px solid var(--panel-border);
    background: linear-gradient(to bottom, rgba(255, 231, 238, 0.035), transparent);
}

.playlist-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.songs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.songs-list::-webkit-scrollbar {
    width: 6px;
}

.songs-list::-webkit-scrollbar-track {
    background: rgba(255, 231, 238, 0.06);
    border-radius: 10px;
}

.songs-list::-webkit-scrollbar-thumb {
    background: rgba(255, 209, 220, 0.35);
    border-radius: 10px;
}

.songs-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.song-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.song-item:hover {
    background: rgba(255, 111, 145, 0.16);
    transform: translateX(4px);
}

.song-item.active {
    background: linear-gradient(135deg, rgba(255, 209, 220, 0.95), rgba(255, 111, 145, 0.9));
    color: #2a1025;
    border-color: rgba(255, 231, 238, 0.48);
}

.song-item .song-number {
    font-size: 12px;
    color: var(--text-tertiary);
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.song-item.active .song-number {
    color: #5b173d;
}

.song-item .song-info {
    flex: 1;
    min-width: 0;
}

.song-item .song-info-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-item .song-info-artist {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-item.active .song-info-artist {
    color: rgba(42, 16, 37, 0.72);
}

/* ============ ANIMATIONS ============ */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes heartPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

.album-art.playing {
    animation: spin 12s linear infinite;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 480px) {
    .playlist-label {
        font-size: 11px;
    }

    .playlist-name {
        font-size: 16px;
    }

    .album-section {
        padding: 30px 15px;
        min-height: 250px;
    }

    .album-container {
        max-width: 280px;
    }

    .song-title {
        font-size: 18px;
    }

    .controls-section {
        gap: 15px;
        padding: 20px 15px;
    }

    .main-play-btn {
        width: 48px;
        height: 48px;
    }

    .songs-list {
        max-height: 300px;
    }

    .mini-player {
        height: 70px;
    }

    .mini-album-art {
        width: 50px;
        height: 50px;
    }

    .mini-song-title {
        font-size: 13px;
    }

    .mini-song-artist {
        font-size: 11px;
    }

    .songs-list-fullscreen {
        padding-bottom: 100px;
    }

    .intro-message {
        font-size: 20px;
    }

    .intro-heart {
        width: 124px;
        height: 108px;
    }

    .intro-heart::before {
        font-size: 118px;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

/* Smooth scrolling for whole page */
html {
    scroll-behavior: smooth;
}
