/* CSS Variables & Reset */
:root {
    --primary-color: #ff4b1f;
    /* Vibrant Orange/Red */
    --secondary-color: #1fddff;
    /* Cyan accent */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --transition-speed: 0.3s;
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: #121212;
    background-image: url('assets/background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Container */
.app-container {
    width: 100%;
    min-height: 100vh;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background: rgba(0, 0, 0, 0.6);
    /* Dark overlay to ensure readability */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* Header */
.app-header {
    width: 100%;
    max-width: 480px;
    margin-bottom: 2rem;
    padding-top: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.app-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(to right, #fff, #ddd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* Main Player Container */
.player-container {
    width: 100%;
    max-width: 480px;
    /* Mobile first constraint */
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 2rem;
}

/* Now Playing */
.now-playing {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.album-art-container {
    width: 250px;
    height: 250px;
    margin-bottom: 1.5rem;
    position: relative;
}

.album-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s ease;
}

.album-art.playing {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 15px 40px rgba(255, 75, 31, 0.3);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
}

.track-info {
    margin-bottom: 1.5rem;
    width: 100%;
}

.track-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Progress Bar */
.progress-area {
    width: 100%;
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.progress-current {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.1s linear;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.control-btn.lg {
    font-size: 4rem;
    filter: drop-shadow(0 0 10px rgba(255, 75, 31, 0.4));
}

.control-btn.sm {
    font-size: 2.5rem;
    opacity: 0.8;
}

.control-btn.active {
    color: var(--primary-color);
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 75, 31, 0.4);
}

.extra-controls {
    display: flex;
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: background 0.3s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Playlist */
.playlist-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.playlist-section::-webkit-scrollbar {
    width: 6px;
}

.playlist-section::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.playlist-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-list {
    list-style: none;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 0.5rem;
}

.playlist-item:hover,
.playlist-item.active {
    background: rgba(255, 255, 255, 0.1);
}

.playlist-item.active .item-info h4 {
    color: var(--primary-color);
}

.item-art {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.1rem;
}

.item-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.item-action {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 400px) {
    .album-art-container {
        width: 200px;
        height: 200px;
    }

    .control-btn.lg {
        font-size: 3.5rem;
    }
}

/* Footer Disclaimer */
.app-footer {
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    /* margin-top: 2rem; */
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    line-height: 1.4;
}

.app-footer p {
    margin-bottom: 0.5rem;
}

.app-footer strong {
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-bottom: 0.25rem;
}