:root {
    --bg-dark: #07090e;
    --bg-card: rgba(15, 18, 26, 0.75);
    --bg-card-hover: rgba(26, 31, 46, 0.85);
    --border-color: rgba(212, 175, 55, 0.15);
    --border-color-active: rgba(212, 175, 55, 0.4);
    
    --primary: #d4af37; /* Premium Gold */
    --primary-glow: rgba(212, 175, 55, 0.35);
    --primary-light: #f3e5ab;
    
    --text-main: #f0f2f5;
    --text-muted: #8a92a6;
    --text-dark: #4b5263;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-premium: 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* Reset & Basis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ambient Background Glow */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    mix-blend-mode: screen;
}

.glow-1 {
    top: -10%;
    right: 10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    animation: floatGlow 25s infinite alternate;
}

.glow-2 {
    bottom: -10%;
    left: 10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #8a6d3b 0%, transparent 70%);
    animation: floatGlow 35s infinite alternate-reverse;
}

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(5%, 5%) scale(1.1); }
    100% { transform: translate(-5%, -5%) scale(0.9); }
}

/* Container */
.app-container {
    width: 92%;
    max-width: 1200px;
    height: 90vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 1;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2rem;
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
}

.logo-text h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Suche */
.search-box {
    position: relative;
    width: 300px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    transition: var(--transition);
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.search-box input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.search-box input:focus + .search-icon {
    color: var(--primary);
}

/* Main Grid Layout */
.player-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 25px;
    flex: 1;
    min-height: 0;
}

/* Glassmorphism Cards */
.player-card, .playlist-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: var(--transition);
}

.player-card:hover, .playlist-card:hover {
    border-color: rgba(212, 175, 55, 0.25);
}

/* PLAYER CARD CONTENTS */
.now-playing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    gap: 20px;
}

.album-art-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 5px;
}

.album-art {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(145deg, #11141e, #090a0f);
    border: 6px solid rgba(255, 255, 255, 0.03);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: transform 0.5s ease;
}

.album-art::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid rgba(212, 175, 55, 0.2);
    z-index: 2;
}

.disc-icon {
    font-size: 6rem;
    color: rgba(212, 175, 55, 0.15);
    transition: var(--transition);
}

/* Vinyl Rotation Animation */
@keyframes rotateDisc {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.playing .album-art {
    animation: rotateDisc 15s linear infinite;
    border-color: rgba(212, 175, 55, 0.3);
}

.playing .disc-icon {
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
}

/* Visualizer Bars */
.visualizer {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 30px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.playing .visualizer {
    opacity: 1;
}

.visualizer .bar {
    width: 4px;
    height: 5px;
    background-color: var(--primary);
    border-radius: 2px;
    animation: bounce 1s ease-in-out infinite alternate;
}

.visualizer .bar:nth-child(2) { animation-delay: 0.15s; }
.visualizer .bar:nth-child(3) { animation-delay: 0.3s; animation-duration: 0.8s; }
.visualizer .bar:nth-child(4) { animation-delay: 0.45s; }
.visualizer .bar:nth-child(5) { animation-delay: 0.6s; animation-duration: 1.2s; }

@keyframes bounce {
    0% { height: 5px; }
    100% { height: 28px; }
}

.song-details {
    text-align: center;
    margin-top: 15px;
    width: 100%;
}

.song-details h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

/* Pulsieren während des Ladens */
.loading-text {
    animation: textPulse 1.5s infinite ease-in-out;
}

@keyframes textPulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

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

/* Timeline Slider */
.timeline-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 15px;
    margin-top: 10px;
}

.time-display {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-muted);
    width: 40px;
}

#current-time {
    text-align: right;
}

.slider-wrapper, .volume-slider-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

/* Custom Range Inputs */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    cursor: pointer;
    z-index: 2;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.progress-bar-fill, .volume-bar-fill {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #b8860b, var(--primary));
    pointer-events: none;
    z-index: 1;
}

/* Controls */
.controls-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    margin-top: 10px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon.active {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

.btn-play {
    background: linear-gradient(135deg, var(--primary) 0%, #8a6d3b 100%);
    border: none;
    color: #07090e;
    font-size: 1.4rem;
    cursor: pointer;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

.btn-play:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.45);
}

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

/* Volume Control */
.volume-container {
    display: flex;
    align-items: center;
    width: 70%;
    gap: 10px;
    margin-top: 10px;
}

.volume-container .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
}

/* PLAYLIST CARD CONTENTS */
.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.playlist-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
}

#track-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
}

.playlist-list-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 5px;
}

/* Playlist Scrollbar Styling */
.playlist-list-container::-webkit-scrollbar {
    width: 6px;
}

.playlist-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 10px;
}

.playlist-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: var(--transition);
}

.playlist-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.3);
}

/* Playlist Item */
.playlist-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 14px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    transition: var(--transition);
}

.playlist-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.playlist-item.active {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.25);
}

/* Index Spalte mit Play-Hover-Verhalten */
.item-index {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 5px;
}

.play-hover-icon, .playing-gif {
    display: none;
    font-size: 0.9rem;
}

.playlist-item:hover .num {
    display: none;
}

.playlist-item:hover .play-hover-icon {
    display: block;
    color: var(--primary);
}

/* Aktiver Wiedergabestatus in Playlist */
.playlist-item.active .num {
    display: none;
}

.playlist-item.active .play-hover-icon {
    display: block;
    color: var(--primary);
}

.playlist-item.active.playing-state .play-hover-icon {
    display: none;
}

.playlist-item.active.playing-state .playing-gif {
    display: block;
    color: var(--primary);
    animation: pulseGlow 1.2s infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.15); opacity: 1; }
}

.item-info {
    flex: 1;
    min-width: 0;
    padding-right: 15px;
}

.item-title {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition);
}

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

.item-artist {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Offline Status Spalte */
.item-offline-status {
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
}

.download-icon {
    color: var(--text-dark);
    opacity: 0.5;
    transition: var(--transition);
}

.playlist-item:hover .download-icon {
    color: var(--text-muted);
    opacity: 0.8;
}

.item-offline-status:hover .download-icon {
    color: var(--primary-light);
    opacity: 1;
    transform: scale(1.15);
}

.cached-icon {
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.loading-icon {
    color: var(--primary);
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Loading & Empty State */
.loading-indicator, .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: var(--text-muted);
    font-size: 0.9rem;
    gap: 12px;
}

.loading-indicator i {
    font-size: 1.8rem;
    color: var(--primary);
}

.empty-state i {
    font-size: 2.2rem;
    color: var(--text-dark);
}

/* Responsive Anpassungen */
@media (max-width: 900px) {
    .app-container {
        height: auto;
        max-height: none;
        padding: 20px 0;
    }
    
    .player-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .player-card, .playlist-card {
        height: auto;
    }

    .playlist-list-container {
        max-height: 400px;
    }
}

@media (max-width: 600px) {
    .app-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .search-box {
        width: 100%;
    }
    
    .player-card {
        padding: 20px;
    }
    
    .album-art-wrapper {
        width: 160px;
        height: 160px;
    }
    
    .controls-container {
        gap: 10px;
    }
    
    .volume-container {
        width: 90%;
    }
}
