:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --star-active: #fbbf24;
    --star-inactive: #334155;
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic animated background */
.background-anim {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.15), rgba(15, 23, 42, 0) 50%),
                radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15), rgba(15, 23, 42, 0) 40%);
    z-index: -1;
    animation: pulse 15s infinite alternate ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(-2%, 2%); }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.app-header {
    text-align: center;
    margin-bottom: 3rem;
}

.app-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.app-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Loader */
.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 2rem;
}

/* Song List Grid */
.song-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Song Card (Glassmorphism) */
.song-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
}

.song-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
}

.cover-art {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    background-color: #1e293b;
    overflow: hidden;
}

.cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.song-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.song-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Static Rating Display */
.rating-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.stars-outer {
    position: relative;
    display: inline-block;
    color: var(--star-inactive);
    font-size: 1.2rem;
    line-height: 1;
}

.stars-outer::before {
    content: '★★★★★';
}

.stars-inner {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    overflow: hidden;
    color: var(--star-active);
}

.stars-inner::before {
    content: '★★★★★';
}

.rating-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Audio Player styling */
.audio-player-container {
    margin-bottom: 1.5rem;
    margin-top: auto;
}

.native-audio {
    width: 100%;
    height: 40px;
    outline: none;
    border-radius: 20px;
}
.native-audio::-webkit-media-controls-panel {
    background-color: rgba(255, 255, 255, 0.1);
}
.native-audio::-webkit-media-controls-current-time-display,
.native-audio::-webkit-media-controls-time-remaining-display {
    color: var(--text-primary);
}

/* Interactive Rating Section */
.rate-section {
    border-top: 1px solid var(--glass-border);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rate-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.interactive-stars {
    display: flex;
    gap: 0.25rem;
    cursor: pointer;
}

.interactive-stars .star {
    font-size: 1.5rem;
    color: var(--star-inactive);
    transition: color 0.2s ease, transform 0.2s ease;
}

.interactive-stars .star:hover,
.interactive-stars .star.hovered {
    color: var(--star-active);
    transform: scale(1.1);
}

.interactive-stars .star.selected {
    color: var(--star-active);
}

.rate-feedback {
    font-size: 0.85rem;
    min-height: 1.2rem;
    margin-top: 0.25rem;
}
.feedback-success { color: #4ade80; }
.feedback-error { color: #f87171; }
