* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000000;
    min-height: 100vh;
    color: #e2e8f0;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #f0f4ff;
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.info-box {
    background: #1a1a2e;
    border-left: 4px solid #5a67d8;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    color: #a0aec0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.info-box strong {
    color: #e2e8f0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #5a67d8, #667eea);
    color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    user-select: none;
}

.header:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(90, 103, 216, 0.5);
}

.header.connected {
    background: #1a1a2e;
    color: #e2e8f0;
    cursor: default;
    pointer-events: none;
}

.header.connected:hover {
    transform: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.footer {
    margin-top: 25px;
}

.footer #signout-btn {
    width: 100%;
    padding: 20px;
    border-radius: 15px;
    font-size: 1.1rem;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #5a67d8, #667eea);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(90, 103, 216, 0.4);
}

.btn-secondary {
    background: #2d2d3f;
    color: #e2e8f0;
}

.btn-secondary:hover {
    background: #3a3a52;
}

.btn-small {
    padding: 5px 15px;
    font-size: 12px;
}

.main-content {
    display: grid;
    gap: 25px;
}

.search-section {
    background: #1a1a2e;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.search-container {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #2d2d3f;
    border-radius: 25px;
    font-size: 16px;
    background: #0f0f1a;
    color: #e2e8f0;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #5a67d8;
}

.playlist-select-container {
}

.playlist-select {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #2d2d3f;
    border-radius: 25px;
    font-size: 16px;
    background: #0f0f1a;
    color: #e2e8f0;
    cursor: pointer;
    transition: border-color 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e2e8f0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
}

.playlist-select:focus {
    outline: none;
    border-color: #5a67d8;
}

.playlist-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-banner.banner-success {
    color: #68d391;
}

.loading-banner.banner-success .spinner {
    display: none;
}

.loading-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: #1a1a2e;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    color: #667eea;
    font-weight: 600;
    font-size: 1rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #2d2d3f;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.player-section {
    background: #1a1a2e;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.now-playing {
    margin-bottom: 25px;
}

.track-info h3 {
    font-size: 1.4rem;
    color: #f0f4ff;
    margin-bottom: 5px;
}

.track-info p {
    color: #a0aec0;
    font-size: 1rem;
}

.album-art-section {
    background: #1a1a2e;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    padding: 25px;
}

.album-art {
    width: 220px;
    height: 220px;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: white;
    overflow: hidden;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: #2d2d3f;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover:not(:disabled) {
    background: #3a3a52;
    transform: translateY(-2px);
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.control-btn-main {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #5a67d8, #667eea);
    color: white;
    font-size: 1.4rem;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    color: #a0aec0;
}

.progress-bar {
    flex: 1;
    position: relative;
    height: 6px;
    background: #2d2d3f;
    border-radius: 3px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5a67d8, #667eea);
    width: 0%;
    transition: width 0.1s ease;
}

#progress-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    color: #a0aec0;
}

.cache-btn-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.btn-cache {
    background: transparent;
    border: 1px solid #4a4a6a;
    color: #a0aec0;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cache:hover {
    border-color: #667eea;
    color: #667eea;
}

#volume-slider {
    width: 100px;
}

.playlist-section {
    background: #1a1a2e;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 25px 0;
}

.playlist-header h2 {
    color: #f0f4ff;
    font-size: 1.5rem;
}

.playlist-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #a0aec0;
}

.playlist {
    max-height: 400px;
    overflow-y: auto;
    padding: 25px;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 5px;
    background: transparent;
    color: #e2e8f0;
}

.playlist-item:hover {
    background: rgba(90, 103, 216, 0.15);
}

.playlist-item.active {
    background: linear-gradient(135deg, #5a67d8, #667eea);
    color: white;
}

.playlist-item.active .track-number {
    background: rgba(255, 255, 255, 0.2);
}

.drag-handle {
    cursor: grab;
    padding: 5px;
    margin-right: 10px;
    color: #4a4a6a;
    font-size: 1.2rem;
}

.drag-handle:active {
    cursor: grabbing;
}

.track-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #2d2d3f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.5625rem;
    margin-right: 15px;
    color: #a0aec0;
}

.track-details {
    flex: 1;
}

.track-name {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 0.625rem;
}

.track-duration {
    font-size: 0.5625rem;
    opacity: 0.7;
}

.track-name--prefetched {
    color: #68d391;
}

.track-name--user-cached {
    color: #90cdf4;
}

.empty-playlist {
    text-align: center;
    padding: 60px 20px;
    color: #4a4a6a;
}

.empty-playlist p {
    margin-bottom: 10px;
}

.empty-playlist p:first-child {
    font-size: 2rem;
    margin-bottom: 15px;
}

/* Drag and drop styles */
.playlist-item.dragging {
    opacity: 0.4;
}

.playlist-item.drag-over {
    border-top: 2px solid #5a67d8;
    margin-top: -2px;
}

/* Loop button states */
.loop-btn.loop-off {
    opacity: 0.4;
}

.loop-btn.loop-track {
    opacity: 1;
    background: linear-gradient(135deg, #5a67d8, #667eea);
    color: white;
}

.loop-btn.loop-playlist {
    opacity: 1;
    background: linear-gradient(135deg, #38a169, #48bb78);
    color: white;
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .search-container {
        flex-direction: column;
    }

    .now-playing {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .progress-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .playlist-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* Custom scrollbar */
.playlist::-webkit-scrollbar {
    width: 6px;
}

.playlist::-webkit-scrollbar-track {
    background: #0f0f1a;
    border-radius: 3px;
}

.playlist::-webkit-scrollbar-thumb {
    background: #2d2d3f;
    border-radius: 3px;
}

.playlist::-webkit-scrollbar-thumb:hover {
    background: #4a4a6a;
}
