/* Default Theme - Based on original Flask template */
:root {
  --primary-color: #1a73e8;
  --secondary-bg: #12151a;
  --accent-bg: #1e232b;
  --text-color: #e7e9ee;
  --text-secondary: #9aa4b2;
  --background: #0b0d10;
  --border-color: #1e232b;
  --hover-brightness: 0.95;

  /* Background image and transparency */
  --bg-image: url('../static/default_cover.webp');
  --bg-opacity: 0.1;
  --card-bg-opacity: 0.85;
  --section-bg-opacity: 0.9;
  --blur-amount: 10px;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  margin: 0;
  background-image: var(--bg-image);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background: var(--background);
  color: var(--text-color);
}

.container {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 16px;
}

/* Mobile container adjustments */
@media (max-width: 767px) {
  .container {
    margin: 16px auto;
    padding: 0 12px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 8px;
  }
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: 2fr 1fr;
  }
}

.card {
  background: rgba(18, 23, 26, var(--card-bg-opacity));
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(var(--blur-amount));
}

/* Mobile card adjustments */
@media (max-width: 767px) {
  .card {
    padding: 12px;
    border-radius: 8px;
  }
}

.title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px;
}

/* Now Playing Styles */
.np {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}

.np img {
  width: 280px;
  height: 280px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.np h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.np .meta {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.4;
}

/* Mobile responsiveness for Now Playing */
@media (max-width: 899px) {
  .np {
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: center;
  }

  .np img {
    width: 200px;
    height: 200px;
    margin: 0 auto;
  }

  .np h2 {
    font-size: 20px;
  }

  .np .meta {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .np img {
    width: 150px;
    height: 150px;
  }

  .np h2 {
    font-size: 18px;
  }
}

/* List Styles */
ul.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.list li {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed #202632;
}

ul.list li:last-child {
  border-bottom: none;
}

.art {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--background);
  border: 1px solid var(--border-color);
}

.track-title {
  font-weight: 600;
}

.track-meta {
  color: var(--text-secondary);
  font-size: 13px;
}

/* Status Pill */
.pill {
  font-size: 12px;
  color: #cfd6e4;
  background: var(--primary-color);
  border-radius: 999px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stream-status {
  background: #22c55e;
  color: white;
}

.stream-status.checking {
  background: #f59e0b;
}

.stream-status.fast-checking {
  background: #f97316;
  animation: pulse-fast 1s infinite;
}

.stream-status.initializing {
  background: #6b7280;
}

@keyframes pulse-fast {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.stream-status.offline {
  background: #ef4444;
}

.stream-status.fallback {
  background: #f59e0b;
  border: 2px solid #d97706;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

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

/* Header */
header {
  padding: 16px 0;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 28px;
}

/* Mobile header adjustments */
@media (max-width: 767px) {
  header {
    padding: 12px 0;
  }

  header h1 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 20px;
  }
}

/* Site Navigation */
.site-nav {
  background: var(--secondary-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}

.nav-brand {
  flex-shrink: 0;
}

.brand-link {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.brand-link:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
  margin: 0 20px;
}

.nav-link {
  padding: 8px 16px;
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--accent-bg);
  color: var(--primary-color);
}

.nav-link.active {
  background: var(--primary-color);
  color: var(--button-text-color, white);
}

.nav-actions {
  flex-shrink: 0;
}

.debug-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 14px;
}

.debug-link:hover {
  background: var(--accent-bg);
  color: var(--text-color);
}

/* Responsive navigation */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 16px;
    flex-wrap: wrap;
    min-height: auto;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .nav-menu {
    order: 3;
    width: 100%;
    margin: 0;
    justify-content: center;
    gap: 4px;
  }

  .nav-link {
    padding: 6px 12px;
    font-size: 13px;
  }

  .nav-brand {
    order: 1;
  }

  .nav-actions {
    order: 2;
  }
}

@media (max-width: 480px) {
  .nav-menu {
    gap: 2px;
  }

  .nav-link {
    padding: 4px 8px;
    font-size: 12px;
  }

  .brand-link {
    font-size: 16px;
  }
}

/* Adjust container padding when navigation is present */
.container:has(.site-nav) {
  padding-top: 20px;
}

/* Track Information Modal */
.track-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.track-modal[aria-hidden="false"] {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.track-modal.modal-closing {
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.track-modal.modal-closing .modal-content {
  transform: scale(0.95) translateY(-10px);
  opacity: 0;
  transition: transform 0.2s ease-in, opacity 0.2s ease-in;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-color);
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background: var(--accent-bg);
  color: var(--text-color);
}

.modal-body {
  padding: 24px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* Responsive design for modal image */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95%;
    width: 95%;
  }

  .modal-body {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
  }

  .track-cover img {
    width: 280px;
    height: 280px;
  }
}

@media (max-width: 480px) {
  .track-cover img {
    width: 240px;
    height: 240px;
  }

  .modal-body {
    padding: 20px;
  }
}

.track-cover {
  flex-shrink: 0;
}

.track-cover img {
  width: 400px;
  height: 400px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.track-cover img:hover {
  transform: scale(1.02);
}

.track-details {
  flex: 1;
  min-width: 0;
}

.track-info h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.3;
}

.track-artist {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--primary-color);
  font-weight: 500;
}

.track-album {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
}

.track-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.meta-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.meta-item span:last-child {
  font-size: 13px;
  color: var(--text-color);
  font-weight: 400;
}

/* Mobile modal adjustments */
@media (max-width: 767px) {
  .modal-content {
    width: 95%;
    margin: 20px;
  }

  .modal-body {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .track-cover img {
    width: 100px;
    height: 100px;
  }

  .modal-header {
    padding: 16px 20px 12px;
  }

  .modal-body {
    padding: 20px;
  }
}

/* Click cursor for album art */
.cover-click {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.cover-click:hover {
  transform: scale(1.02);
}

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#lightbox.open {
  display: flex;
}

#lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

#lightbox .lb-close {
  position: fixed;
  top: 16px;
  right: 16px;
  color: var(--text-color);
  font-size: 24px;
  cursor: pointer;
}

/* Stream Controls */
.stream-controls {
  margin-top: 12px;
}

.stream-btn {
  appearance: none;
  border: 1px solid var(--border-color);
  background: var(--primary-color);
  color: var(--button-text-color, #fff);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.stream-btn:hover {
  filter: brightness(var(--hover-brightness));
}

.stream-btn:active {
  transform: translateY(1px);
}

/* Audio Player (hidden) */
#streamAudio {
  display: none;
}

/* Make album pic container relative for overlay (kept for other overlays if any) */
.np {
  position: relative;
}

/* Audio Visualization (removed) */

