:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #818cf8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: radial-gradient(circle at top right, #1e1b4b, transparent),
        radial-gradient(circle at bottom left, #312e81, transparent);
}

.app-container {
    width: 100%;
    max-width: 800px;
    /* Slightly narrower for better vertical reading */
    min-height: 90vh;
    /* Allow it to grow */
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    margin: 20px auto;
    /* Center horizontally */
}

/* Header */
.app-header {
    padding: 20px 30px;
    display: flex;
    justify-content: center;
    /* Center logo */
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* No overflow hidden, let it scroll */
}

/* Player Section */
.player-section {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.1);
}

.now-playing {
    text-align: center;
    margin-bottom: 30px;
}

.album-art {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: pulse 4s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.album-art i {
    font-size: 80px;
    color: rgba(255, 255, 255, 0.8);
}

.track-info h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.track-info p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Controls */
.controls {
    width: 100%;
    max-width: 500px;
}

.progress-container {
    margin-bottom: 25px;
    cursor: pointer;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: var(--primary-color);
    transition: width 0.1s linear;
}

.time-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

.play-btn {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    font-size: 2.5rem;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.play-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
    color: white;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.volume-control input {
    flex: 1;
    accent-color: var(--primary-color);
    height: 4px;
    cursor: pointer;
}

/* Playlist Section */
.playlist-section {
    padding: 20px;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.05);
    /* No overflow hidden */
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.update-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s;
}

.update-btn:hover {
    background: var(--secondary-color);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    /* Take available space */
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    color: #666;
}

.search-input-wrapper input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border-radius: 20px;
    border: none;
    outline: none;
    font-family: 'Outfit', sans-serif;
    width: 100%;
    /* Full width of wrapper */
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 10px;
}

.playlist-header h3 {
    font-weight: 500;
}

.playlist-header span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.playlist {
    list-style: none;
    /* No fixed height or overflow */
}

.track-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

.track-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.track-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.track-item.active .track-number,
.track-item.active .track-name {
    color: var(--primary-color);
}

.track-number {
    color: var(--text-secondary);
    font-size: 0.9rem;
    width: 30px;
}

.track-name {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-icon {
    opacity: 0;
    color: var(--primary-color);
    transition: opacity 0.2s;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    opacity: 0;
    margin-left: 10px;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.track-item:hover .track-icon,
.track-item.active .track-icon,
.track-item:hover .copy-btn {
    opacity: 1;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid var(--glass-border);
}

.page-btn {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
        border: none;
    }

    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .update-btn {
        justify-content: center;
    }
}