/* Google Fonts: Outfit for modern, clean look */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

:root {
  /* Dynamic themes custom properties (default values) */
  --bg-gradient: linear-gradient(135deg, hsl(220, 60%, 15%) 0%, hsl(260, 50%, 10%) 100%);
  --primary-color: hsl(260, 100%, 75%);
  --primary-glow: hsla(260, 100%, 75%, 0.4);
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.15);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --transition-speed: 0.8s; /* Smooth theme transition */
  
  /* Soft shadow variables for premium transparent-mode readability */
  --outline-color: rgba(0, 0, 0, 0.5);
  --outline-glow: rgba(0, 0, 0, 0.35);
  --outline-ambient: rgba(0, 0, 0, 0.2);
}

/* Time zone specific style variables */
.theme-morning {
  --bg-gradient: linear-gradient(135deg, hsl(200, 95%, 85%) 0%, hsl(45, 95%, 75%) 100%);
  --primary-color: hsl(205, 90%, 50%);
  --primary-glow: hsla(205, 90%, 50%, 0.3);
  --text-main: hsl(210, 60%, 20%);
  --text-muted: hsl(210, 40%, 40%);
  --glass-bg: rgba(255, 255, 255, 0.4);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-highlight: rgba(255, 255, 255, 0.6);
  --card-shadow: 0 8px 32px 0 rgba(100, 120, 150, 0.15);
  --outline-color: rgba(255, 255, 255, 0.6);
  --outline-glow: rgba(255, 255, 255, 0.45);
  --outline-ambient: rgba(255, 255, 255, 0.25);
}

.theme-afternoon {
  --bg-gradient: linear-gradient(135deg, hsl(195, 90%, 65%) 0%, hsl(175, 70%, 55%) 100%);
  --primary-color: hsl(195, 100%, 35%);
  --primary-glow: hsla(195, 100%, 35%, 0.3);
  --text-main: hsl(200, 70%, 15%);
  --text-muted: hsl(200, 40%, 35%);
  --glass-bg: rgba(255, 255, 255, 0.35);
  --glass-border: rgba(255, 255, 255, 0.45);
  --glass-highlight: rgba(255, 255, 255, 0.55);
  --card-shadow: 0 8px 32px 0 rgba(80, 110, 130, 0.15);
  --outline-color: rgba(255, 255, 255, 0.6);
  --outline-glow: rgba(255, 255, 255, 0.45);
  --outline-ambient: rgba(255, 255, 255, 0.25);
}

.theme-evening {
  --bg-gradient: linear-gradient(135deg, hsl(15, 85%, 55%) 0%, hsl(325, 75%, 40%) 100%);
  --primary-color: hsl(15, 100%, 70%);
  --primary-glow: hsla(15, 100%, 70%, 0.4);
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --glass-bg: rgba(0, 0, 0, 0.2);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-highlight: rgba(255, 255, 255, 0.25);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --outline-color: rgba(0, 0, 0, 0.6);
  --outline-glow: rgba(0, 0, 0, 0.4);
  --outline-ambient: rgba(0, 0, 0, 0.25);
}

.theme-night {
  --bg-gradient: linear-gradient(135deg, hsl(230, 50%, 10%) 0%, hsl(265, 60%, 7%) 100%);
  --primary-color: hsl(265, 90%, 75%);
  --primary-glow: hsla(265, 90%, 75%, 0.4);
  --text-main: #f0f3ff;
  --text-muted: rgba(240, 243, 255, 0.5);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.12);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --outline-color: rgba(0, 0, 0, 0.7);
  --outline-glow: rgba(0, 0, 0, 0.5);
  --outline-ambient: rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
  padding: 20px;
}

/* Base Glass Container */
.glass-container {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--card-shadow);
  border-radius: 24px;
  width: 100%;
  max-width: 900px;
  padding: 30px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: center;
  justify-content: center;
  align-content: center;
  transition: background var(--transition-speed) ease, border var(--transition-speed) ease;
}

/* Absolute Config Toggle Button at top-right */
.config-toggle-absolute {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 50;
}

@media (min-width: 768px) {
  .glass-container {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

/* Header & Clock Section */
.clock-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px 10px;
  text-align: center;
  border-bottom: none;
}

@media (min-width: 768px) {
  .clock-section {
    border-bottom: none;
    border-right: none;
    padding: 0;
  }
}

.date-display {
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.time-display {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 15px;
  text-shadow: 0 0 20px var(--primary-glow);
  color: var(--text-main);
}

.active-period-badge {
  background: var(--primary-color);
  color: var(--bg-gradient) !important;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px var(--primary-glow);
  mix-blend-mode: normal;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Player UI Section */
.player-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.track-info {
  margin-bottom: 25px;
  text-align: center;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.track-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-folder {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Progress bar */
.progress-container {
  width: 100%;
  margin-bottom: 25px;
}

.progress-bar-wrapper {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--glass-border);
  border-radius: 3px;
  cursor: pointer;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-color);
  border-radius: 3px;
  box-shadow: 0 0 8px var(--primary-glow);
}

.time-durations {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Controls */
.controls-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 0;
}

.control-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-main);
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  width: 48px;
  height: 48px;
}

.control-btn:hover {
  background: var(--glass-highlight);
  transform: scale(1.08);
}

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

.control-btn.play-pause {
  background: var(--primary-color);
  color: var(--bg-gradient);
  width: 60px;
  height: 60px;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.control-btn.play-pause:hover {
  background: var(--primary-color);
  filter: brightness(1.1);
}

.control-btn.active-toggle {
  color: var(--primary-color);
}

/* Volume Slider */
.volume-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  margin-top: 25px;
}

.volume-slider {
  -webkit-appearance: none;
  width: 100px;
  height: 4px;
  border-radius: 2px;
  background: var(--glass-border);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 0 6px var(--primary-glow);
  cursor: pointer;
  transition: scale 0.1s;
}

.volume-slider::-webkit-slider-thumb:hover {
  scale: 1.3;
}

/* Config Section (Full Width, underneath) */
.config-container {
  grid-column: 1 / -1;
  border-top: 1px solid var(--glass-border);
  padding-top: 25px;
}

.config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.config-title {
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 24h Timeline Slider Component */
.timeline-slider-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 35px;
  padding: 10px 0;
}

.timeline-bar {
  position: relative;
  width: 100%;
  height: 48px;
  background: var(--glass-border);
  border-radius: 12px;
  overflow: visible;
  display: flex;
  border: 1px solid var(--glass-border);
}

.timeline-segment {
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: filter 0.2s;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 4px;
}

.timeline-segment:hover {
  filter: brightness(1.1);
}

.timeline-segment.active-segment {
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.4);
}

.timeline-segment-label {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.timeline-handle {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 12px;
  background: var(--primary-color);
  border: 2px solid #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  cursor: ew-resize;
  z-index: 10;
  transform: translateX(-50%);
  transition: background-color 0.2s;
}

.timeline-handle:hover {
  background: #fff;
}

/* Time Ruler labels underneath timeline */
.timeline-ruler {
  position: relative;
  width: 100%;
  height: 20px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ruler-mark {
  position: absolute;
  transform: translateX(-50%);
}

/* Time Zone Segment Settings Panel */
.segment-editor-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  display: none; /* Shown dynamically when a segment is selected */
  animation: fadeIn 0.3s ease-out;
}

.segment-editor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

@media (min-width: 768px) {
  .segment-editor-grid {
    grid-template-columns: 2fr 3fr 1fr 1.2fr;
    align-items: flex-end;
  }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.text-input {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
}

.text-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 8px var(--primary-glow);
}

/* Select element styling customization */
select.text-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 35px;
}

/* Light theme support override for select dropdown arrow */
.theme-morning select.text-input,
.theme-afternoon select.text-input {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231a3a5f'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
}

.action-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-btn:hover {
  background: var(--glass-highlight);
  border-color: var(--primary-color);
}

.action-btn.btn-primary {
  background: var(--primary-color);
  color: var(--bg-gradient);
  border: none;
}

.action-btn.btn-primary:hover {
  filter: brightness(1.15);
}

.action-btn.btn-danger {
  background: rgba(255, 75, 75, 0.15);
  border-color: rgba(255, 75, 75, 0.3);
  color: #ff8888;
}

.action-btn.btn-danger:hover {
  background: rgba(255, 75, 75, 0.3);
  border-color: #ff4444;
}

/* Debug Mode Panel */
.debug-panel {
  margin-top: 25px;
  padding: 15px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed var(--glass-border);
}

.debug-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}

.debug-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.debug-panel .debug-title,
.debug-panel .input-label {
  color: #ffffff !important;
}

/* SVG Icon styling */
.icon-svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scrollbars styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--glass-highlight);
}

/* Modal Overlay & Playlist Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none; /* Controlled via JS */
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.modal-playlist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.modal-playlist-item:hover {
  background: var(--glass-highlight);
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.modal-playlist-item.active-track {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 10px var(--primary-glow);
  color: var(--primary-color);
  font-weight: 600;
}

/* Autoplay Prompt Banner Style */
.autoplay-banner {
  position: fixed;
  top: 30px;
  background: var(--primary-color);
  color: var(--bg-gradient) !important;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 40px;
  box-shadow: 0 4px 25px var(--primary-glow);
  z-index: 200;
  cursor: pointer;
  animation: pulse 1.5s infinite alternate ease-in-out;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 20px var(--primary-glow);
  }
  100% {
    transform: scale(1.06);
    box-shadow: 0 4px 30px var(--primary-glow);
  }
}

/* OBS Studio Integration Modes */
body.transparent-mode {
  background: transparent !important;
}

/* When "Keep window background" is checked: apply theme-colored semi-opaque glass style */
body.transparent-mode.keep-window-bg-mode .glass-container {
  background: var(--glass-transparent-bg, rgba(255, 255, 255, 0.05)) !important;
  border-color: var(--glass-transparent-border, rgba(255, 255, 255, 0.08)) !important;
  box-shadow: var(--card-shadow) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

/* When "Keep window background" is NOT checked: make glass container completely transparent */
body.transparent-mode:not(.keep-window-bg-mode) .glass-container {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Force text to be black in transparent mode with a soft white glow for readability ONLY when the glass container is fully transparent */
body.transparent-mode:not(.keep-window-bg-mode) .time-display,
body.transparent-mode:not(.keep-window-bg-mode) .date-display,
body.transparent-mode:not(.keep-window-bg-mode) .track-title,
body.transparent-mode:not(.keep-window-bg-mode) .track-folder,
body.transparent-mode:not(.keep-window-bg-mode) .time-durations,
body.transparent-mode:not(.keep-window-bg-mode) .input-label {
  color: #000000 !important;
  text-shadow: 
    0 1px 2px rgba(255, 255, 255, 0.8),
    0 0 8px rgba(255, 255, 255, 0.5) !important;
}

body.hide-controls-mode .controls-wrapper {
  display: none !important;
}

body.hide-controls-mode #btn-mute,
body.hide-controls-mode #volume-slider {
  display: none !important;
}

body.hide-controls-mode #track-folder {
  display: none !important;
}

body.hide-visualizer-mode .visualizer-container {
  display: none !important;
}

/* Panel Layout Swapping Options */
@media (min-width: 768px) {
  body.swap-panels-mode .glass-container {
    grid-template-columns: 0.8fr 1.2fr;
  }
  body.swap-panels-mode .clock-section {
    grid-column: 2;
    border-right: none;
    border-left: none;
    padding: 0 0 0 20px;
  }
  body.swap-panels-mode .player-section {
    grid-column: 1;
    grid-row: 1;
  }
}

/* Minimal Design Mode Overrides */
body.minimal-mode .glass-container {
  display: grid;
  grid-template-columns: 1fr 2.4fr;
  grid-template-rows: auto auto;
  align-items: center;
  justify-content: center;
  align-content: center;
  padding: 15px 24px;
  gap: 0;
  min-height: 100px;
  max-width: 900px; /* Slightly wider to accommodate side-by-side text */
}

body.minimal-mode .clock-section {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  padding: 0;
  border-bottom: none !important;
  border-right: none !important;
  text-align: left;
  gap: 12px;
}

body.minimal-mode .visualizer-container,
body.minimal-mode .active-period-badge,
body.minimal-mode .volume-slider {
  display: none !important;
}

body.minimal-mode .date-display {
  display: inline-block !important;
  font-size: 0.85rem !important;
  margin-bottom: 0 !important;
  color: var(--text-muted) !important;
  letter-spacing: 0.5px !important;
  white-space: nowrap;
}

body.minimal-mode .time-display {
  font-size: 2.2rem;
  margin-bottom: 0;
  text-shadow: 0 0 10px var(--primary-glow);
  display: inline-block;
  white-space: nowrap;
}

body.minimal-mode .player-section {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 2px; /* Uniform with date-display margin-bottom: 2px */
  min-width: 0;
}

body.minimal-mode .track-info {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 0;
  text-align: left;
  min-width: 0;
  width: 100%;
}

body.minimal-mode .track-title {
  font-size: 1.1rem;
  margin-bottom: 0;
}

body.minimal-mode .track-folder {
  display: none !important;
}

body.minimal-mode .progress-container {
  grid-column: 1;
  grid-row: 2;
  margin-bottom: 0;
  width: 100%;
  max-width: none;
}

body.minimal-mode .controls-wrapper {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-bottom: 0;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  padding: 3px 6px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
}

body.minimal-mode .control-btn {
  width: 28px;
  height: 28px;
}

body.minimal-mode .control-btn svg {
  width: 14px;
  height: 14px;
}

body.minimal-mode .control-btn.play-pause {
  width: 34px;
  height: 34px;
}

body.minimal-mode #play-icon {
  width: 18px !important;
  height: 18px !important;
}

body.minimal-mode .volume-container {
  grid-column: 3;
  grid-row: 1 / span 2;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.minimal-mode #btn-mute {
  width: 28px !important;
  height: 28px !important;
  margin: 0;
}

body.minimal-mode #btn-mute svg {
  width: 14px !important;
  height: 14px !important;
}

body.minimal-mode .config-container {
  grid-column: 1 / -1;
  border-top: 1px solid var(--glass-border);
  padding-top: 25px;
  margin-top: 15px;
  width: 100%;
}

@media (min-width: 768px) {
  body.swap-panels-mode.minimal-mode .glass-container {
    grid-template-columns: 2.4fr 1fr;
  }
  body.swap-panels-mode.minimal-mode .clock-section {
    grid-column: 2;
  }
  body.swap-panels-mode.minimal-mode .player-section {
    grid-column: 1;
    grid-row: 1;
  }
}

@media (max-width: 767px) {
  body.minimal-mode .glass-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    padding: 15px;
    min-height: auto;
  }
  body.minimal-mode .clock-section {
    align-items: center;
    text-align: center;
  }
  body.minimal-mode .player-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  body.minimal-mode .track-info {
    text-align: center;
  }
  body.minimal-mode .track-folder {
    justify-content: center;
  }
  body.minimal-mode .progress-container {
    max-width: none;
  }
  body.minimal-mode .controls-wrapper {
    display: inline-flex;
    justify-content: center;
    align-self: center;
  }
  body.minimal-mode .volume-container {
    justify-content: center;
    margin-top: 5px;
  }
}

/* Custom Dropdown for OBS Browser Source Interaction Support */
.custom-dropdown {
  position: relative;
  user-select: none;
}

.custom-dropdown-trigger {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 36px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.custom-dropdown.open .custom-dropdown-trigger {
  border-color: var(--primary-color);
  box-shadow: 0 0 8px var(--primary-glow);
}

.custom-dropdown-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
}

.custom-dropdown-trigger .dropdown-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
  fill: currentColor;
  flex-shrink: 0;
}

.custom-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.custom-dropdown-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  background: rgba(20, 20, 25, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  z-index: 100;
  display: none;
  box-sizing: border-box;
}

/* Light theme overrides for dropdown container */
.theme-morning .custom-dropdown-options,
.theme-afternoon .custom-dropdown-options {
  background: rgba(240, 243, 248, 0.98);
}

.custom-dropdown.open .custom-dropdown-options {
  display: block;
}

.custom-dropdown-option {
  padding: 8px 12px;
  font-size: 0.9rem;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.custom-dropdown-option:hover {
  background: var(--glass-highlight);
}

.custom-dropdown-option.selected {
  background: var(--primary-color) !important;
  color: var(--bg-gradient) !important;
  font-weight: 600;
}

/* --- Folder Connection and File Copy styles --- */
#btn-disconnect-folder:hover {
  color: var(--primary-color) !important;
}

#copy-progress-log {
  max-height: 150px;
  overflow-y: auto;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.theme-morning #copy-progress-log,
.theme-afternoon #copy-progress-log {
  background: rgba(255, 255, 255, 0.4);
  color: hsl(210, 60%, 20%);
}

#copy-progress-bar-container {
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

/* --- Track Title Slide Animation --- */
.track-title.animating {
  height: 2rem;
  line-height: 2rem;
  overflow: hidden;
  position: relative;
  margin-bottom: 6px;
}

.track-title-slider {
  display: flex;
  flex-direction: column;
  height: 4rem; /* height * 2 */
  transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
  transform: translateY(0);
}

.track-title-slider.slide-up {
  transform: translateY(-2rem);
}

.track-title-slide {
  height: 2rem;
  line-height: 2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.track-title-slide.text-artist {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
}


