:root {
    --bg-color: #000000;
    --panel-bg: #18181b; /* Neutral very dark gray */
    --panel-border: #27272a;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent-color: #ffffff; /* Pure white accent */
    --accent-hover: #d4d4d8; /* Light gray for hover */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(255, 255, 255, 0.4); /* White glow */
    --transition: all 0.3s ease;
}

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

body {
    width: 100%;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-color);
    background-image: url('/img/bg1'); /* Assuming bg1 exists. Will add fallback */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    overflow-x: hidden;
}

/* Dark gradient overlay to make text readable */
.bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.6); /* Neutral dark semi-transparent overlay */
    z-index: -1;
}

.app-container {
    width: 100%;
    max-width: 500px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

/* Solid Minimalist Panels */
.solid-panel {
    background-color: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    width: 100%;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
}

.solid-panel:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Header */
.main-header {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.logo {
    height: 70px;
    width: auto;
}

/* Player Section */
.player-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.station-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.live-badge.offline {
    color: var(--text-secondary);
    background: rgba(161, 161, 170, 0.1);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.live-badge.offline .pulse-dot {
    background-color: var(--text-secondary);
    animation: none;
    box-shadow: none;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.frequency {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Now Playing Info */
.now-playing-container {
    width: 100%;
    /* Max width ensures the container doesn't force the panel to expand on small screens */
    max-width: 250px; 
    margin-top: 5px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.title-wrapper {
    flex: 1 1 auto;
    min-width: 0; /* Critical magic property for text truncation inside flexbox */
    overflow: hidden; /* Ensures text stays within the container boundaries */
}

#now-playing-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    display: inline-block; /* Changed from block to inline-block for transform */
}

/* LED Scrolling Effect */
.scrolling-text {
    /* Bounces back and forth within the container based on the overflow amount calculated by JS */
    animation: scroll-left-bounce 5s ease-in-out infinite alternate;
}

@keyframes scroll-left-bounce {
    0%, 15% { transform: translateX(0); }
    85%, 100% { transform: translateX(var(--scroll-dist, 0px)); } 
}

/* Play Button */
.controls {
    margin-top: 1rem;
}

.play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: none;
    color: var(--bg-color); /* Play icon will be pure black to contrast the white button */
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    position: relative;
}

.play-btn:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

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

/* Playing animation */
.play-btn.playing {
    box-shadow: var(--shadow-glow);
}

.play-btn.playing::before {
    content: '';
    position: absolute;
    top: -5px; bottom: -5px; left: -5px; right: -5px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    animation: ripple 1.5s linear infinite;
    opacity: 0;
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* Now Playing Animation */
#now-playing-title i {
    display: inline-block; /* Required for transforms to apply to inline icons */
    animation: music-bounce 2s infinite ease-in-out;
    color: var(--accent-hover); /* Give it a slight highlight color */
}

@keyframes music-bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-2px) rotate(-10deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-2px) rotate(10deg); }
}

/* Audio Spectrum Visualizer */
.audio-spectrum {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 18px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.audio-spectrum.playing {
    opacity: 1;
}

.audio-spectrum .bar {
    width: 3px;
    background-color: var(--accent-hover);
    border-radius: 2px;
    animation: spectrum-bounce 1s ease-in-out infinite;
    transform-origin: bottom;
}

.audio-spectrum .bar:nth-child(1) { height: 10px; animation-delay: 0s; }
.audio-spectrum .bar:nth-child(2) { height: 16px; animation-delay: -0.2s; }
.audio-spectrum .bar:nth-child(3) { height: 12px; animation-delay: -0.4s; }
.audio-spectrum .bar:nth-child(4) { height: 18px; animation-delay: -0.6s; }
.audio-spectrum .bar:nth-child(5) { height: 8px; animation-delay: -0.8s; }

.audio-spectrum:not(.playing) .bar {
    animation: none;
    height: 3px;
}

@keyframes spectrum-bounce {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

/* Verse Section */
.verse-section {
    padding: 1.5rem;
}

.verse-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.verso-content {
    font-size: 1.1rem;
    line-height: 1.6;
    font-style: italic;
    color: var(--text-primary);
}

.verso-content a {
    text-decoration: none;
    display: block;
    margin-top: 0.8rem;
    font-weight: 600;
    font-style: normal;
    font-size: 0.9rem;
    color: var(--accent-hover);
}

/* Footer Section */
.main-footer {
    width: 100%;
    padding: 1rem 1rem 0.5rem; /* Reduced padding */
    background-color: var(--panel-bg);
    border-top: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem; /* Reduced gap */
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.5rem; /* Reduced gap */
    width: 100%;
    max-width: 500px;
}

.social-group {
    display: flex;
    flex-direction: row; /* Make horizontal by default to save space */
    align-items: center;
    gap: 0.8rem;
}

.footer-logo {
    height: 25px; /* Smaller logo */
    width: auto;
    opacity: 0.8;
}

.links {
    display: flex;
    gap: 0.5rem; /* Reduced gap */
}

.social-btn {
    width: 32px; /* Smaller button */
    height: 32px; /* Smaller button */
    border-radius: 50%;
    background-color: var(--bg-color);
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 1rem; /* Smaller icon */
    transition: var(--transition);
    border: 1px solid var(--panel-border);
}

.social-btn:hover {
    color: white;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px); /* Subtle lift */
    box-shadow: var(--shadow-sm);
}

.social-btn:hover.fb-btn { background-color: #1877F2; border-color: #1877F2; }
.social-btn:hover.ig-btn { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); border-color: transparent; }

.divider {
    width: 1px;
    height: 30px; /* Reduced height */
    background-color: var(--panel-border);
}

.copyright {
    font-size: 0.75rem; /* Slightly smaller text */
    color: var(--text-secondary);
    text-align: center;
}

/* Responsive Overrides */
@media screen and (max-width: 380px) {
    .title { font-size: 1.6rem; }
    .play-btn { width: 70px; height: 70px; font-size: 1.5rem; }
    .app-container { padding: 1.5rem 1rem; }
    .social-links { gap: 1rem; }
    .divider { display: none; }
    .social-group { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; border-bottom: 1px solid var(--panel-border); padding-bottom: 0.5rem;}
    .social-group:last-child { border-bottom: none; padding-bottom: 0;}
    .links { gap: 0.5rem; }
}
