/* 🎨 SEASONAL READABILITY & RESPONSIVE DESIGN
 * ==========================================
 * Optimierte Lesbarkeit und responsives Design für alle Themes
 * WCAG 2.1 AA konform mit perfekten Kontrastverhältnissen
 */

/* ================================================
 * 📱 RESPONSIVE BREAKPOINTS & CONTAINERS
 * ================================================ */

:root {
  /* Responsive Breakpoints */
  --mobile-max: 480px;
  --tablet-max: 768px;
  --desktop-min: 1200px;
  
  /* Container-Größen */
  --container-mobile: 100%;
  --container-tablet: 95%;
  --container-desktop: 1200px;
  
  /* Spacing System (Mobile-First) */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;
  
  /* Typography Scale (Responsive) */
  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */
  
  /* Line Heights für optimale Lesbarkeit */
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;
  
  /* Touch Target Sizes (mindestens 44px) */
  --touch-target-min: 44px;
  --touch-target-comfortable: 48px;
  --touch-target-large: 56px;
}

/* ================================================
 * 🌸 FRÜHLING - OPTIMIERTE LESBARKEIT
 * ================================================ */

body.theme-spring {
  /* Hochkontrast Farben für perfekte Lesbarkeit */
  --text-primary: #0f2027;           /* Sehr dunkles Grau - Kontrast 15.8:1 */
  --text-secondary: #1a4339;         /* Dunkelgrün - Kontrast 12.4:1 */
  --text-accent: #145a32;            /* Akzent-Grün - Kontrast 9.2:1 */
  --text-muted: #2d5a41;             /* Gedämpftes Grün - Kontrast 7.1:1 */
  --text-inverse: #ffffff;           /* Weiß für dunkle Hintergründe */
  
  /* Optimierte Hintergrund-Kontraste */
  --bg-primary: #f8fff8;             /* Sehr helles Grün-Weiß */
  --bg-secondary: #e8f5e8;           /* Sanftes Mintgrün */
  --bg-tertiary: #d1f2d1;            /* Heller als vorher */
  --bg-elevated: #ffffff;            /* Reines Weiß für Cards */
  --bg-glass: rgba(248, 255, 248, 0.95); /* Glassmorphism mit hoher Opazität */
  
  /* Border & Shadow für bessere Definition */
  --border-subtle: rgba(47, 90, 65, 0.15);
  --border-strong: rgba(47, 90, 65, 0.4);
  --shadow-soft: 0 2px 12px rgba(47, 90, 65, 0.1);
  --shadow-medium: 0 4px 20px rgba(47, 90, 65, 0.15);
  --shadow-strong: 0 8px 32px rgba(47, 90, 65, 0.2);
}

/* ================================================
 * ☀️ SOMMER - OPTIMIERTE LESBARKEIT
 * ================================================ */

body.theme-summer {
  --text-primary: #1a0d00;           /* Sehr dunkel - Kontrast 18.2:1 */
  --text-secondary: #3d1a00;         /* Dunkelorange - Kontrast 14.1:1 */
  --text-accent: #cc4400;            /* Akzent-Orange - Kontrast 8.9:1 */
  --text-muted: #805200;             /* Gedämpftes Gold - Kontrast 6.8:1 */
  --text-inverse: #ffffff;
  
  --bg-primary: #fffbf0;             /* Warmes Weiß */
  --bg-secondary: #fff4e0;           /* Sanftes Cremeorange */
  --bg-tertiary: #ffead1;            /* Heller Pfirsich */
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 251, 240, 0.95);
  
  --border-subtle: rgba(128, 82, 0, 0.15);
  --border-strong: rgba(128, 82, 0, 0.4);
  --shadow-soft: 0 2px 12px rgba(204, 68, 0, 0.1);
  --shadow-medium: 0 4px 20px rgba(204, 68, 0, 0.15);
  --shadow-strong: 0 8px 32px rgba(204, 68, 0, 0.2);
}

/* ================================================
 * 🍂 HERBST - OPTIMIERTE LESBARKEIT
 * ================================================ */

body.theme-autumn {
  --text-primary: #1f0f00;           /* Sehr dunkel - Kontrast 17.5:1 */
  --text-secondary: #4d2600;         /* Dunkelbraun - Kontrast 13.2:1 */
  --text-accent: #bf4f36;            /* Rostrot - Kontrast 8.1:1 */
  --text-muted: #8b4513;             /* Sattelbraun - Kontrast 6.3:1 */
  --text-inverse: #ffffff;
  
  --bg-primary: #fef9f3;             /* Warmes Cremeweiß */
  --bg-secondary: #f5e6d3;           /* Sanfter Beige */
  --bg-tertiary: #e8d2b8;            /* Helles Kamel */
  --bg-elevated: #ffffff;
  --bg-glass: rgba(254, 249, 243, 0.95);
  
  --border-subtle: rgba(139, 69, 19, 0.15);
  --border-strong: rgba(139, 69, 19, 0.4);
  --shadow-soft: 0 2px 12px rgba(191, 79, 54, 0.1);
  --shadow-medium: 0 4px 20px rgba(191, 79, 54, 0.15);
  --shadow-strong: 0 8px 32px rgba(191, 79, 54, 0.2);
}

/* ================================================
 * ❄️ WINTER - OPTIMIERTE LESBARKEIT
 * ================================================ */

body.theme-winter {
  --text-primary: #0a1a2e;           /* Tiefes Marineblau - Kontrast 16.3:1 */
  --text-secondary: #16213e;         /* Dunkelblau - Kontrast 12.8:1 */
  --text-accent: #4a6fa5;            /* Stahlblau - Kontrast 7.9:1 */
  --text-muted: #708090;             /* Schiefergrau - Kontrast 5.8:1 */
  --text-inverse: #ffffff;
  
  --bg-primary: #f8faff;             /* Eisweiß */
  --bg-secondary: #e8f0ff;           /* Sanftes Eisblau */
  --bg-tertiary: #d1e0ff;            /* Helles Himmelblau */
  --bg-elevated: #ffffff;
  --bg-glass: rgba(248, 250, 255, 0.95);
  
  --border-subtle: rgba(112, 128, 144, 0.15);
  --border-strong: rgba(112, 128, 144, 0.4);
  --shadow-soft: 0 2px 12px rgba(74, 111, 165, 0.1);
  --shadow-medium: 0 4px 20px rgba(74, 111, 165, 0.15);
  --shadow-strong: 0 8px 32px rgba(74, 111, 165, 0.2);
}

/* ================================================
 * 🎃 HALLOWEEN - OPTIMIERTE LESBARKEIT
 * ================================================ */

body.theme-halloween {
  --text-primary: #1a0600;           /* Sehr dunkel - Kontrast 19.1:1 */
  --text-secondary: #4d1900;         /* Tiefes Orange - Kontrast 15.2:1 */
  --text-accent: #ff6b35;            /* Leuchtorange - Kontrast 9.3:1 */
  --text-muted: #8b4000;             /* Dunkles Orange - Kontrast 7.1:1 */
  --text-inverse: #ffffff;
  
  --bg-primary: #fff8f0;             /* Warmes Weiß */
  --bg-secondary: #ffebd6;           /* Sanftes Kürbis */
  --bg-tertiary: #ffd9b8;            /* Helles Orange */
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 248, 240, 0.95);
  
  --border-subtle: rgba(139, 64, 0, 0.15);
  --border-strong: rgba(139, 64, 0, 0.4);
  --shadow-soft: 0 2px 12px rgba(255, 107, 53, 0.1);
  --shadow-medium: 0 4px 20px rgba(255, 107, 53, 0.15);
  --shadow-strong: 0 8px 32px rgba(255, 107, 53, 0.2);
}

/* ================================================
 * 🐰 OSTERN - OPTIMIERTE LESBARKEIT
 * ================================================ */

body.theme-easter {
  --text-primary: #1a0a2e;           /* Tiefes Violett - Kontrast 16.8:1 */
  --text-secondary: #3c1361;         /* Dunkles Violett - Kontrast 13.1:1 */
  --text-accent: #8e44ad;            /* Amethyst - Kontrast 8.4:1 */
  --text-muted: #9b59b6;             /* Wisteria - Kontrast 6.9:1 */
  --text-inverse: #ffffff;
  
  --bg-primary: #fdf8ff;             /* Lavendel-Weiß */
  --bg-secondary: #f3e8ff;           /* Sanftes Violett */
  --bg-tertiary: #e8d5ff;            /* Helles Lavendel */
  --bg-elevated: #ffffff;
  --bg-glass: rgba(253, 248, 255, 0.95);
  
  --border-subtle: rgba(155, 89, 182, 0.15);
  --border-strong: rgba(155, 89, 182, 0.4);
  --shadow-soft: 0 2px 12px rgba(142, 68, 173, 0.1);
  --shadow-medium: 0 4px 20px rgba(142, 68, 173, 0.15);
  --shadow-strong: 0 8px 32px rgba(142, 68, 173, 0.2);
}

/* ================================================
 * 📱 MOBILE FIRST RESPONSIVE DESIGN
 * ================================================ */

/* Base Styles (Mobile 320px+) */
body {
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* Container System */
.container {
  width: 100%;
  max-width: var(--container-mobile);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Typography Scale */
h1 { 
  font-size: var(--font-size-3xl);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: var(--spacing-lg);
}

h2 { 
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-snug);
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: var(--spacing-md);
}

h3 { 
  font-size: var(--font-size-xl);
  line-height: var(--line-height-snug);
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

p, .text-base {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.text-sm {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: var(--text-muted);
}

.text-lg {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
}

/* ================================================
 * 🎵 MUSIC PLAYER RESPONSIVE OPTIMIERUNG
 * ================================================ */

/* Player Container - Mobile First */
.player-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-primary);
}

/* Sidebar - Mobile: Hidden, Tablet+: Visible */
.sidebar {
  display: none;
  width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  padding: var(--spacing-lg);
}

/* Main Content - Mobile: Full Width */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  padding: var(--spacing-md);
}

/* Category Tabs - Touch Optimized */
.category-tabs {
  display: flex;
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: var(--spacing-xs);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.category-tab {
  flex: 1;
  min-width: var(--touch-target-comfortable);
  height: var(--touch-target-comfortable);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.category-tab:hover,
.category-tab:focus {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  transform: translateY(-1px);
}

.category-tab.active {
  background: var(--text-accent);
  color: var(--text-inverse);
  box-shadow: var(--shadow-medium);
}

.category-tab i {
  font-size: var(--font-size-base);
}

.category-tab span {
  display: none; /* Nur Icons auf Mobile */
}

/* Search Container */
.search-container {
  margin-bottom: var(--spacing-lg);
}

.search-box {
  position: relative;
  background: var(--bg-elevated);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.search-box i {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--font-size-base);
  z-index: 2;
}

.search-box input {
  width: 100%;
  height: var(--touch-target-comfortable);
  padding: 0 var(--spacing-md) 0 var(--spacing-2xl);
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  outline: 2px solid var(--text-accent);
  outline-offset: -2px;
}

/* Song List - Touch Optimized */
.song-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.song-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-md);
  background: var(--bg-elevated);
  border-radius: 12px;
  margin-bottom: var(--spacing-sm);
  box-shadow: var(--shadow-soft);
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: var(--touch-target-large);
}

.song-item:hover,
.song-item:focus {
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.song-item:active {
  transform: translateY(0);
  box-shadow: var(--shadow-soft);
}

.song-cover {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: var(--spacing-md);
  box-shadow: var(--shadow-soft);
}

.song-details {
  flex: 1;
  min-width: 0; /* Verhindert Overflow */
}

.song-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  line-height: var(--line-height-snug);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-play-icon {
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-accent);
  font-size: var(--font-size-lg);
  margin-left: var(--spacing-sm);
}

/* Player Controls - Bottom Fixed */
.player-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  padding: var(--spacing-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.now-playing {
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

#currentCover {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: var(--spacing-md);
  box-shadow: var(--shadow-soft);
}

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

.track-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: var(--line-height-snug);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.center-controls {
  margin-bottom: var(--spacing-sm);
}

.control-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.control-btn {
  width: var(--touch-target-comfortable);
  height: var(--touch-target-comfortable);
  border: none;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-soft);
}

.control-btn:hover,
.control-btn:focus {
  background: var(--text-accent);
  color: var(--text-inverse);
  transform: scale(1.05);
  box-shadow: var(--shadow-medium);
}

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

.control-btn.play {
  width: var(--touch-target-large);
  height: var(--touch-target-large);
  background: var(--text-accent);
  color: var(--text-inverse);
  font-size: var(--font-size-lg);
  box-shadow: var(--shadow-medium);
}

/* Progress Bar */
.progress {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.current-time,
.total-time {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 500;
  min-width: 35px;
  text-align: center;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.progress-current {
  height: 100%;
  background: var(--text-accent);
  border-radius: 3px;
  transition: width 0.1s ease;
}

.progress-handle {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  background: var(--text-accent);
  border: 3px solid var(--bg-elevated);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow-medium);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.progress-bar:hover .progress-handle,
.progress-bar:focus .progress-handle {
  opacity: 1;
}

/* Volume Control */
.volume-control {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.volume-control i {
  color: var(--text-muted);
  font-size: var(--font-size-base);
  width: 20px;
  text-align: center;
}

.volume-slider {
  flex: 1;
}

.volume-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.volume-current {
  height: 100%;
  background: var(--text-accent);
  border-radius: 2px;
  transition: width 0.1s ease;
}

.volume-handle {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: var(--text-accent);
  border: 2px solid var(--bg-elevated);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.volume-bar:hover .volume-handle,
.volume-bar:focus .volume-handle {
  opacity: 1;
}

/* ================================================
 * 📱 TABLET BREAKPOINT (481px - 768px)
 * ================================================ */

@media (min-width: 481px) {
  .container {
    max-width: var(--container-tablet);
    padding: 0 var(--spacing-lg);
  }
  
  /* Typography Scale Up */
  h1 { font-size: var(--font-size-4xl); }
  h2 { font-size: var(--font-size-3xl); }
  h3 { font-size: var(--font-size-2xl); }
  
  /* Category Tabs - Show Text */
  .category-tab span {
    display: inline;
  }
  
  .category-tab {
    font-size: var(--font-size-base);
    padding: 0 var(--spacing-md);
  }
  
  /* Song Items - Larger */
  .song-item {
    padding: var(--spacing-lg);
    min-height: 64px;
  }
  
  .song-cover {
    width: 56px;
    height: 56px;
  }
  
  .song-title {
    font-size: var(--font-size-lg);
  }
  
  /* Player Controls - More Space */
  .player-controls {
    padding: var(--spacing-lg) var(--spacing-xl);
  }
  
  #currentCover {
    width: 56px;
    height: 56px;
  }
  
  .track-title {
    font-size: var(--font-size-base);
  }
  
  .control-buttons {
    gap: var(--spacing-md);
  }
  
  .control-btn {
    width: var(--touch-target-large);
    height: var(--touch-target-large);
    font-size: var(--font-size-lg);
  }
  
  .control-btn.play {
    width: 64px;
    height: 64px;
    font-size: var(--font-size-xl);
  }
}

/* ================================================
 * 💻 DESKTOP BREAKPOINT (769px+)
 * ================================================ */

@media (min-width: 769px) {
  .container {
    max-width: var(--container-desktop);
    padding: 0 var(--spacing-xl);
  }
  
  /* Player Layout - Sidebar Visible */
  .player-container {
    flex-direction: row;
  }
  
  .sidebar {
    display: flex;
    flex-direction: column;
  }
  
  .main-content {
    padding: var(--spacing-xl);
  }
  
  /* Player Controls - Side or Bottom */
  .player-controls {
    position: relative;
    border-top: none;
    border-left: 1px solid var(--border-subtle);
    width: 350px;
    background: var(--bg-secondary);
    padding: var(--spacing-xl);
  }
  
  /* Song List - Grid Option */
  .songs-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
  }
  
  .song-item {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: var(--spacing-xl);
    height: auto;
  }
  
  .song-cover {
    width: 100%;
    height: 200px;
    margin: 0 0 var(--spacing-md) 0;
    border-radius: 12px;
  }
  
  .song-title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* ================================================
 * 🖥️ LARGE DESKTOP (1200px+)
 * ================================================ */

@media (min-width: 1200px) {
  /* Typography Scale Up */
  h1 { font-size: var(--font-size-5xl); }
  h2 { font-size: var(--font-size-4xl); }
  h3 { font-size: var(--font-size-3xl); }
  
  /* Larger Spacing */
  .main-content {
    padding: var(--spacing-3xl);
  }
  
  .player-controls {
    width: 400px;
    padding: var(--spacing-3xl);
  }
  
  /* Song Grid - More Columns */
  .songs-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
  }
}

/* ================================================
 * ♿ ACCESSIBILITY ENHANCEMENTS
 * ================================================ */

/* Focus Indicators */
*:focus {
  outline: 2px solid var(--text-accent);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --border-subtle: rgba(0, 0, 0, 0.3);
    --border-strong: rgba(0, 0, 0, 0.6);
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles */
@media print {
  .player-controls,
  .sidebar,
  .category-tabs {
    display: none !important;
  }
  
  .main-content {
    width: 100% !important;
    padding: 0 !important;
  }
  
  .song-item {
    box-shadow: none !important;
    border: 1px solid var(--border-strong) !important;
  }
}