/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --banner-cover-url: none;
}

/* default */

/* Design System Variables */
:root {
    /* Music App Dark Theme */
    --background: hsl(220, 15%, 8%);
    --background-secondary: hsl(220, 15%, 12%);
    --background-tertiary: hsl(220, 15%, 16%);
    --foreground: hsl(0, 0%, 98%);
    --foreground-secondary: hsl(0, 0%, 85%);
    --foreground-muted: hsl(0, 0%, 60%);

    /* Brand Colors */
    --primary: hsl(210, 85%, 60%);
    --primary-foreground: hsl(0, 0%, 100%);
    --accent: hsl(280, 85%, 65%);
    --accent-foreground: hsl(0, 0%, 100%);

    /* Card Colors */
    --card: hsl(220, 15%, 12%);
    --card-hover: hsl(220, 15%, 18%);
    --card-foreground: hsl(0, 0%, 98%);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, hsl(210, 85%, 60%), hsl(280, 85%, 65%));
    --gradient-card: linear-gradient(135deg, hsl(220, 15%, 12%), hsl(220, 15%, 16%));
    --gradient-overlay: linear-gradient(180deg, transparent, hsl(220, 15%, 8%, 0.8));

    /* Interactive States */
    --hover: hsl(220, 15%, 20%);
    --active: hsl(220, 15%, 24%);

    /* Shadows */
    --shadow-card: 0 4px 12px hsl(220, 15%, 4%, 0.3);
    --shadow-player: 0 -4px 20px hsl(220, 15%, 4%, 0.5);

    /* Border Radius */
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --radius-lg: 1rem;

    /* Animations */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-user-select: none;
    /* Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE10+/Edge */
    user-select: none;
    /* Standard syntax */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: contain;
    font-size: 14px;
}

/* --- UPGRADED LOGIN UI --- */
/* --- UPGRADED LOGIN PAGE --- */
#loginPage {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top right, #1e293b, #080c14);
    z-index: 10000;
}

/* Add a subtle animated glow behind the card */
#loginPage::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    background: var(--primary);
    /* Uses your --primary variable */
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
    animation: pulseGlow 8s infinite alternate;
}

@keyframes pulseGlow {
    from {
        transform: scale(1);
        opacity: 0.1;
    }

    to {
        transform: scale(1.3);
        opacity: 0.2;
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem 2rem;
    border-radius: 24px;
    width: 90%;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-card button:not(.toggle-password) {
    width: 100%;
    padding: 14px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.login-card h2 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

/* Input Styling */
#tokenInput {
    width: 100%;
    padding: 14px 45px 14px 16px;
    /* 45px right padding for the icon */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    outline: none;
    box-sizing: border-box;
    /* Prevents width issues */
}

.login-card img {
    height: 50px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 8px rgba(229, 9, 20, 0.4));
}

.welcome-text {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 20px 0 5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 25px;
    line-height: 1.4;
}

#tokenInput:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

/* Remember Me Checkbox */
.login-card label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 10px 0;
}

#remember {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* Sign In Button */
.login-card button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.login-card button:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.login-card button:active {
    transform: translateY(0);
}

/* Error Message */
#error {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #f87171;
    min-height: 1.2rem;
    font-weight: 500;
}

/* Ensure the container is the reference point */
.input-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

/* Fix the button positioning */
.toggle-password {
    position: absolute;
    right: 10px;
    background: none !important;
    /* Forces removal of blue background */
    border: none !important;
    padding: 8px !important;
    margin: 0 !important;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    /* Removes glow/shadow if any */
    width: auto !important;
}

.toggle-password:hover {
    color: #fff;
}

.toggle-password i {
    width: 20px;
    height: 20px;
    pointer-events: none;
    /* Clicks go through to the button */
}

/* --- APP LAYOUT --- */
#music {
    display: none;
    /* Controlled by JS */
}

.app {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--background);
    position: relative;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3rem 1rem 1rem 1rem;
    position: relative;
}

.greeting {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--foreground);
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-button {
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--foreground-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.icon-button:hover {
    color: var(--foreground);
    transform: scale(1.1);
}

.icon-button i {
    width: 1.5rem;
    height: 1.5rem;
}

/* Main Content */
.main-content {
    padding: 0 1rem 8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Album Detail View */
.album-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    z-index: 30;
    /* Below nav and footer */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: albumFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.album-sticky-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 10;
    transition: background 0.3s ease;
    padding-top: env(safe-area-inset-top);
}

.album-sticky-header.scrolled {
    background: rgba(18, 18, 18, 0);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.album-back {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 1rem;
}

#album-sticky-title {
    font-size: 1rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.album-sticky-header.scrolled #album-sticky-title {
    opacity: 1;
}

.album-content-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 180px;
    /* Room for footer and nav */
    scrollbar-width: none;
}

.album-content-scroll::-webkit-scrollbar {
    display: none;
}

.album-header-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 400px;
    background: linear-gradient(to bottom, var(--primary), transparent);
    opacity: 0.5;
    pointer-events: none;
    filter: blur(60px);
    z-index: 0;
    transition: background 0.5s ease;
}

/* Liquid Vibe Background */
.album-view::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, var(--primary), transparent 40%),
        radial-gradient(circle at 70% 60%, var(--accent), transparent 40%),
        radial-gradient(circle at 80% 20%, #ff0080, transparent 35%),
        radial-gradient(circle at 20% 80%, #00dbde, transparent 35%),
        radial-gradient(circle at 40% 80%, #2B86C5, transparent 40%);
    opacity: 0.2;
    filter: blur(80px);
    z-index: -1;
    animation: liquidMove 15s infinite alternate linear;
}

@keyframes liquidMove {
    from {
        transform: rotate(0deg) scale(1);
    }

    to {
        transform: rotate(360deg) scale(1.2);
    }
}

.album-header {
    position: relative;
    padding: 80px 1.5rem 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    text-align: center;
    z-index: 1;
}

.album-cover-wrapper {
    width: 200px;
    height: 200px;
    margin-bottom: 1.5rem;
    perspective: 1000px;
}

#album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

#album-cover:hover {
    transform: scale(1.02);
}

.album-info-meta {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#album-title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.album-artist-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mini-artist-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

#album-artist {
    font-weight: 700;
    font-size: 0.9rem;
}

.album-stats {
    font-size: 0.8rem;
    color: var(--foreground-muted);
}

.album-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    width: 100%;
}

.album-big-play {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background 0.2s ease;
}

.album-big-play:hover {
    transform: scale(1.05);
    background: hsl(210, 85%, 65%);
}

.album-big-play i {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.album-action-icon {
    background: none;
    border: none;
    color: var(--foreground-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.album-action-icon:hover {
    color: var(--foreground);
}

.album-tracks {
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
}

.album-track {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
    cursor: pointer;
}

.album-track:hover {
    background: rgba(255, 255, 255, 0.1);
}

.track-index {
    color: var(--foreground-muted);
    font-size: 0.8rem;
    width: 20px;
    text-align: center;
}

.track-name-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Important for truncation */
    overflow: hidden;
}

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

.track-artist {
    font-size: 0.8rem;
    color: var(--foreground-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-duration {
    font-size: 0.8rem;
    color: var(--foreground-muted);
    margin-right: 0.5rem;
}

.track-more {
    color: var(--foreground-muted);
}

/* Sections */
.section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--foreground);
}

.horizontal-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.music-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

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

.music-card img {
    width: 9rem;
    height: 9rem;
    border-radius: var(--radius);
    object-fit: cover;
    box-shadow: var(--shadow-card);
    margin-bottom: 0.75rem;
}

.music-card span {
    color: var(--foreground);
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Music Player */
.music-player {
    position: fixed;
    bottom: 4rem;
    left: 0;
    right: 0;
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--background-tertiary);
    box-shadow: var(--shadow-player);
    z-index: 40;
    padding: 0.75rem 1rem;
}

.player-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.track-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.track-image {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--background-tertiary);
}

.track-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-details {
    flex: 1;
    overflow: hidden;
}

.track-details h4 {
    color: var(--foreground);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-details p {
    color: var(--foreground-muted);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.control-button {
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--foreground-secondary);
    cursor: pointer;
}

.control-button i {
    width: 1.25rem;
    height: 1.25rem;
}

.play-button {
    width: 3rem;
    height: 3rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px hsl(210, 85%, 60%, 0.3);
}

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

.play-button i {
    width: 1.25rem;
    height: 1.25rem;
    color: white;
}

.progress-bar {
    width: 100%;
}

.progress-track {
    width: 100%;
    height: 0.3rem;
    background: var(--background-tertiary);
    border-radius: 0.125rem;
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    overflow: visible;
}

.progress-fill {
    width: 35%;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 0.25rem;
}

.progress-handle-circle {
    position: absolute;
    top: 50%;
    left: 35%;
    /* Should be updated by JS */
    width: 0.8rem;
    height: 0.8rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    opacity: 1;
    /* Changed from 0 to 1 */
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}

/* REMOVE THIS RULE */
.progress-track:hover .progress-handle-circle,
.progress-track:active .progress-handle-circle {
    opacity: 1;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: -0.1rem;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 55;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: var(--foreground-muted);
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: var(--transition-smooth);
    font-size: 0.75rem;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:hover {
    color: var(--foreground-secondary);
}

.nav-item.active:hover {
    color: var(--primary);
}

.nav-item i {
    width: 1.5rem;
    height: 1.5rem;
}

/* Music Banner (Full-Screen Player) */
.music-banner {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    z-index: 1000;
    padding: 0px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.player-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 100%;
    background: transparent;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.player-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--banner-cover-url, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(20px) brightness(0.6);
    transform: scale(1.1);
    z-index: 0;
}

.player-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--background), rgba(0, 0, 0, 0.25));
    z-index: 0;
}

.player-container>* {
    position: relative;
    z-index: 1;
}

/* Fix the close button positioning */
.close-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: none;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--foreground);
    transition: var(--transition-smooth);
    z-index: 100;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.close-btn i {
    width: 1rem;
    height: 1rem;
}

.album-cover {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.overlay-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    margin: 0 !important;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.875rem;
    transition: var(--transition-smooth);
}

.overlay-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.05);
}

#banner-cover-image {
    width: 80%;
    max-width: 300px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.song-info {
    text-align: center;
    margin-bottom: 2rem;
}

#banner-song-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground-secondary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

#banner-artist-name {
    font-size: 1rem;
    color: var(--foreground-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

/* Flip Animation */
.flip-container {
    perspective: 1000px;
    width: 100%;
    height: 300px;
    margin-bottom: 20px;
}

.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-inner.flipped {
    transform: rotateY(180deg);
}

.flip-inner.flipped .overlay-btn {
    display: none;
}

.flip-front,
.flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.flip-back {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 auto;
    height: 130%;
    transform: rotateY(180deg);
    background: none;
    border-radius: 20px;
    padding: 20px 30px;
}

/* Lyrics Styling - Premium Vibe */
.lyrics-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
    opacity: 0.8;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.lyrics-content {
    flex: 1;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    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: 2rem 0;
}

.lyrics-line {
    margin: 1rem 0;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    opacity: 0.6;
    font-size: 1rem;
    font-weight: 500;
    color: var(--foreground);
    transform: scale(1);
    cursor: pointer;
    max-width: 90%;
}

.lyrics-line.active-line {
    opacity: 1;
    font-size: 1.2rem;
    font-weight: 700;
    transform: scale(1.05);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary);
    margin: 1.5rem 0;
    text-shadow: none;
}

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

.flip-btn {
    margin: 0 !important;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: var(--foreground);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.flip-2-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--foreground);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.song-info {
    margin-top: 20px;
    text-align: center;
}

.progress-container {
    width: 100%;
    margin-bottom: 1.5rem;
}

.time-stamps {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--foreground-muted);
    margin-top: 0.5rem;
}

.main-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.popup {
    position: fixed;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--background-secondary);
    color: var(--foreground);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}

.popup.active {
    opacity: 1;
}

.music-banner.active~.header,
.music-banner.active~.main-content,
.music-banner.active~.music-player,
.music-banner.active~.bottom-nav,
.music-banner.active~#settings-sheet {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .player-container {
        padding: 1rem;
    }

    #banner-cover-image {
        margin-top: 40%;
        width: 100%;
        max-width: 300px;
    }

    #banner-song-title {
        margin-top: 70px;
        font-size: 1.25rem;
    }

    #banner-artist-name {
        font-size: 0.875rem;
    }

    .profile-dropdown {
        right: 0.5rem;
        width: 220px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--background-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--background-tertiary);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hover);
}

/* Responsive optimizations */
@media (max-width: 320px) {
    .quick-grid {
        gap: 0.25rem;
    }

    .playlist-card {
        padding: 0.5rem;
    }

    .playlist-card img {
        width: 2.5rem;
        height: 2.5rem;
    }

    .music-card {
        min-width: 8rem;
    }

    .music-card img {
        width: 8rem;
        height: 8rem;
    }

    .profile-dropdown {
        width: 200px;
        right: 0.5rem;
    }
}

/* Settings full screen */
#settings-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -100%;
    height: 60%;
    background: var(--background);
    border-top-left-radius: 20px;
    background: blur(20px);
    border-top-right-radius: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    transition: bottom 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 9999;
}

#settings-sheet.active {
    bottom: 0;
}

.sheet-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.sheet-header h2 {
    flex: 1;
    text-align: center;
    margin: 0;
}

.sheet-header button {
    background: none;
    border: none;
    color: var(--foreground);
    font-size: 20px;
}

.drag-line {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
}

.sheet-body {
    padding: 20px;
    overflow-y: auto;
}

.quality-options {
    display: grid;
    gap: 12px;
    margin-top: 15px;
}

.quality-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    background: var(--surface);
    color: var(--foreground);
    text-align: left;
    transition: background 0.2s;
}

.quality-btn.active {
    background: var(--primary);
    color: white;
}

.quality-btn:hover {
    background: var(--primary-hover, #444);
}

/* Search Bar */
.search-container {
    display: flex;
    align-items: center;
    background: var(--card);
    border-radius: var(--radius);
    padding: 0.5rem;
    gap: 0.5rem;
    box-shadow: var(--shadow-card);
}

.search-container input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--foreground);
    font-size: 0.9rem;
    padding: 0.4rem;
}

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

.search-container button {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-foreground);
    transition: var(--transition-smooth);
}

.search-container button:hover {
    transform: scale(1.05);
}

.search-results {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    background: var(--card);
    border-radius: var(--radius);
    padding: 0.5rem;
    cursor: pointer;
    gap: 0.75rem;
    transition: var(--transition-smooth);
}

.search-result-item:hover {
    background: var(--card-hover);
}

.search-result-item img {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.search-result-info {
    flex: 1;
    overflow: hidden;
}

.search-result-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-info p {
    font-size: 0.75rem;
    color: var(--foreground-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Touch optimizations */
@media (hover: none) and (pointer: coarse) {
    .playlist-card:active {
        background: var(--card-hover);
        transform: scale(0.98);
    }

    .music-card:active {
        transform: scale(1.02);
    }

    .play-button:active {
        transform: scale(0.95);
    }

    .profile-avatar:active {
        transform: scale(0.95);
    }
}


/* Spotify Sections Styles */
.spotify-section {
    margin-bottom: 2rem;
}

.spotify-section .section-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spotify-section .section-title::before {
    content: '🎵';
    font-size: 1.1rem;
}

.spotify-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 0.5rem;
    transition: var(--transition-smooth);
    min-width: 150px;
}

.spotify-card:hover {
    transform: translateY(-5px);
    background: var(--card-hover);
}

.spotify-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.spotify-card h4 {
    font-size: 0.9rem;
    margin: 0;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-card p {
    font-size: 0.8rem;
    color: var(--foreground-muted);
    margin: 0.25rem 0 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive adjustments for Spotify sections */
@media (max-width: 768px) {
    .spotify-card {
        min-width: 120px;
    }

    .spotify-card img {
        height: 100px;
    }
}

/* Compact Footer */
.compact-footer {
    position: fixed;
    bottom: 3.7rem;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    transition: var(--transition-smooth);
    margin: 0 1rem 1rem 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glow);
}

.footer-track-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.footer-track-image {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--background-tertiary);
    flex-shrink: 0;
}

.footer-track-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.footer-track-details {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.footer-track-details h4 {
    color: var(--foreground);
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.footer-track-details p {
    color: var(--foreground-muted);
    font-size: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.footer-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.footer-play-button {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.footer-play-button:hover {
    transform: scale(1.05);
}

.footer-play-button i {
    width: 1rem;
    height: 1rem;
    color: white;
}

.footer-next-button {
    background: none;
    border: none;
    color: var(--foreground-secondary);
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition-smooth);
}

.footer-next-button:hover {
    color: var(--foreground);
}

.footer-next-button i {
    width: 1.2rem;
    height: 1.2rem;
}

/* Progress bar for footer */
.footer-progress {
    position: absolute;
    top: -2px;
    left: 0.4rem;
    right: 0.4rem;
    height: 2px;
    background: transparent;
}

.footer-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 1px;
}

/* Hide original music player when footer is active */
.compact-footer.active~.music-player {
    display: none;
}

/* Adjust main content padding when footer is active */
.compact-footer.active~.main-content {
    padding-bottom: 5rem;
}

/* Enhanced card animations */
.music-card {
    position: relative;
    overflow: hidden;
}

.music-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 1;
}

.music-card:hover::before {
    opacity: 0.1;
}

.music-card img {
    transition: var(--transition-smooth);
    position: relative;
    z-index: 2;
}

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

/* Enhanced section titles */
.section-title {
    position: relative;
    padding-left: 1rem;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1.2em;
    background: var(--gradient-primary);
    border-radius: 3px;
}

/* Improved search results */
.search-result-item {
    position: relative;
    overflow: hidden;
}

.search-result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0.1;
    transition: left 0.3s ease;
}

.search-result-item:hover::before {
    left: 0;
}

/* Enhanced buttons */
.play-button,
.footer-play-button {
    position: relative;
    overflow: hidden;
}

.play-button::before,
.footer-play-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: var(--transition-smooth);
}

.play-button:hover::before,
.footer-play-button:hover::before {
    opacity: 1;
}

/* Smooth scrolling for horizontal sections */
.horizontal-scroll {
    scroll-behavior: smooth;
}

/* Loading animation for cards */
.music-card,
.search-result-item {
    animation: fadeInUp 0.6s ease-out;
}

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

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

/* Responsive adjustments for footer */
@media (max-width: 768px) {
    .compact-footer {
        height: 55px;
        padding: 0.4rem 0.8rem;
    }

    .footer-track-image {
        width: 2.2rem;
        height: 2.2rem;
    }

    .footer-track-details h4 {
        font-size: 0.75rem;
    }

    .footer-track-details p {
        font-size: 0.65rem;
    }

    .footer-play-button {
        width: 2.2rem;
        height: 2.2rem;
    }
}

/* Visual feedback for active states */
.nav-item {
    position: relative;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}

/* Enhanced music banner transitions */
.music-banner {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* End of enhanced styles */
/*End of styles.css */

/* Language Selection Overlay - IMPROVED UI */
.language-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    animation: fadeIn 0.3s ease;
}

.lang-header {
    text-align: center;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.lang-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, hsl(210, 85%, 60%), hsl(280, 85%, 65%));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lang-header p {
    color: var(--foreground-muted);
    font-size: 0.95rem;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    overflow-y: auto;
    padding: 0.5rem;
    padding-bottom: 120px;
    /* Space for footer */
    flex: 1;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.album-action-icon.active i {
    transform: scale(1.2);
    transition: transform 0.2s ease;
}

.album-action-icon:active {
    transform: scale(0.9);
}

.language-grid::-webkit-scrollbar {
    width: 4px;
}

.language-grid::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.lang-card {
    position: relative;
    height: 100px;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
    /* default border */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.lang-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.5;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.lang-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.lang-card:hover .lang-card-bg {
    transform: scale(1.1);
    opacity: 0.7;
}

.lang-card-content {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lang-name {
    font-size: 1.1rem;
    font-weight: 700;
    display: block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
    color: white;
}

.lang-native {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Selected State */
.lang-card.selected {
    border-color: #a855f7;
    /* Accent color border */
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.4);
}

.lang-card.selected .lang-card-bg {
    filter: brightness(1.2);
}

/* Add a dark gradient overlay for better text readability */
.lang-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    z-index: 0;
}

.lang-check {
    position: absolute;
    color: white;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(135deg, hsl(210, 85%, 60%), hsl(280, 85%, 65%));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.lang-card.selected .lang-check {
    opacity: 1;
    transform: scale(1);
}

.lang-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem 2rem 1.5rem;
    background: linear-gradient(to top, var(--background) 90%, transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 2001;
    backdrop-filter: blur(5px);
}

#selected-count {
    font-size: 0.9rem;
    color: var(--foreground-secondary);
    font-weight: 500;
}

.lang-next-btn {
    width: 100%;
    max-width: 400px;
    height: 50px;
    border-radius: 25px;
    border: none;
    background: var(--card);
    /* Disabled state */
    color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
    font-size: 1rem;
    cursor: not-allowed;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
}

.lang-next-btn.active {
    background: linear-gradient(135deg, hsl(210, 85%, 60%), hsl(280, 85%, 65%));
    color: white;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    pointer-events: auto;
}

.lang-next-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.5);
    filter: brightness(1.1);
}

.lang-next-btn.active:active {
    transform: scale(0.98);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Card Container */
.music-card {
    min-width: 140px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.music-card:active {
    transform: scale(0.95);
}

/* Image with Play Overlay */
.card-image-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1/1;
    margin-bottom: 8px;
    background: #1e293b;
}

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

.play-hint {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.music-card:hover .play-hint {
    opacity: 1;
}

/* Typography Polish */
.card-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Truncates long names */
}

.card-artist {
    display: block;
    font-size: 0.75rem;
    color: var(--foreground-muted);
}

/* Animation */
.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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