/* ==========================================================================
   KURFAMÜZİK — Kurfa Sound Light Design System
   Modern Clean, Tactile Accents, Selective Glassmorphism & YouTube Engine
   ========================================================================== */

html {
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: #faf8ff;
  color: #131b2e;
  -webkit-font-smoothing: antialiased;
}

/* Ensure smooth touch scrolling across all devices */
* {
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 155, 180, 0.25) transparent;
}

.overflow-x-auto {
  touch-action: pan-x pan-y !important;
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbars on shelves and containers with scrollbar-none */
.scrollbar-none::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.scrollbar-none {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

/* Subtle modern scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(140, 155, 180, 0.25);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 155, 180, 0.45);
}

/* Material symbols styling */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}
.material-symbols-outlined.filled {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}


/* Spinning Vinyl Animation */
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.animate-spin-slow {
  animation: spin-slow 12s linear infinite;
}
.paused-animation {
  animation-play-state: paused !important;
}

/* Waveform pulse animation */
@keyframes wave-bounce {
  0%, 100% {
    height: 6px;
  }
  50% {
    height: 22px;
  }
}
.wave-bar {
  animation: wave-bounce 1s ease-in-out infinite;
}
.wave-bar:nth-child(2) { animation-delay: 0.15s; }
.wave-bar:nth-child(3) { animation-delay: 0.3s; }
.wave-bar:nth-child(4) { animation-delay: 0.45s; }
.wave-bar:nth-child(5) { animation-delay: 0.6s; }
.wave-bar:nth-child(6) { animation-delay: 0.75s; }

/* Interactive Seekbar Dragging States */
.seek-track {
  cursor: pointer;
  position: relative;
  touch-action: none;
}
.seek-track .seek-knob {
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}
.seek-track:hover .seek-knob,
.seek-track.dragging .seek-knob {
  opacity: 1;
}

/* Volume Track Dragging */
.vol-track {
  cursor: pointer;
  position: relative;
  touch-action: none;
}
.vol-track .vol-knob {
  opacity: 0;
  transition: opacity 0.15s;
}
.vol-track:hover .vol-knob,
.vol-track.dragging .vol-knob {
  opacity: 1;
}

/* Active Nav State (Desktop Sidebar) */
.nav-item.active {
  background-color: #e60d45 !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(186, 0, 52, 0.25);
}
.nav-item.active .material-symbols-outlined {
  color: #ffffff !important;
}

/* Active Mobile Nav Item */
.mobile-nav-item.active {
  color: #ba0034 !important;
}
.mobile-nav-item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  color: #ba0034 !important;
}

/* Tab Transitions */
.view-tab {
  display: none !important;
}
.view-tab.active {
  display: flex !important;
  animation: fadeIn 0.2s ease-out forwards;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Toast Notification */
.kurfa-toast {
  position: fixed;
  bottom: calc(8.5rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #131b2e;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 2rem);
  white-space: nowrap;
}
.kurfa-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Lyrics Karaoke Highlight */
.lyric-line,
.lyrics-line {
  transition: all 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  cursor: pointer;
  scroll-margin: 50px 0;
}
.lyric-line:hover,
.lyrics-line:hover {
  color: #ba0034;
}
.lyric-line.active,
.lyric-line.active-lyric,
.lyrics-line.active {
  color: #ba0034 !important;
  background-color: rgba(186, 0, 52, 0.1) !important;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 800;
  transform: scale(1.02);
  border-left: 3px solid #ba0034;
}
body.dark-mode .lyric-line.active,
body.dark-mode .lyric-line.active-lyric,
body.dark-mode .lyrics-line.active {
  color: #ffb3b8 !important;
  background-color: rgba(255, 179, 184, 0.12) !important;
  border-left: 3px solid #ffb3b8;
}

/* Equalizer Bars */
.eq-bar {
  transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sub-Tab Pills */
.sub-tab-pill {
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}
.sub-tab-pill.active {
  background-color: #ba0034 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(186, 0, 52, 0.25);
  font-weight: 700;
}
.sub-tab-pill.active .material-symbols-outlined {
  color: #ffffff !important;
}

/* EQ Preset Buttons */
.eq-preset-btn {
  transition: all 0.15s ease;
  user-select: none;
}
.eq-preset-btn.active {
  background-color: #4648d4 !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(70, 72, 212, 0.25);
}

/* Download Progress Bar */
.download-progress-fill {
  transition: width 0.3s ease-out;
}

/* =============================================================================
   DARK MODE THEME OVERRIDES (Rich Obsidian & Midnight Slate Palette)
   ============================================================================= */

html.dark-mode,
html.dark-mode body,
body.dark-mode {
  background-color: #0c1017 !important;
  color: #e6edf3 !important;
}

html.dark-mode main,
html.dark-mode .bg-background,
body.dark-mode main,
body.dark-mode .bg-background {
  background-color: #0c1017 !important;
}

body.dark-mode header {
  background-color: rgba(12, 16, 23, 0.9) !important;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode aside {
  background-color: #111722 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode footer {
  background-color: #0c1017 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode #desktop-player-bar {
  background-color: rgba(17, 23, 34, 0.96) !important;
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode #mobile-bottom-nav,
body.dark-mode #mobile-mini-player {
  background-color: rgba(17, 23, 34, 0.96) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .bg-surface-container-lowest,
body.dark-mode .bg-white {
  background-color: #151c28 !important;
  color: #e6edf3 !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.dark-mode .bg-surface-container-low {
  background-color: #1a2332 !important;
}

body.dark-mode .bg-surface-container {
  background-color: #212c3e !important;
}

body.dark-mode .bg-surface-container-high {
  background-color: #2b3950 !important;
}

body.dark-mode .bg-surface-container-highest {
  background-color: #354662 !important;
}

body.dark-mode .text-on-surface {
  color: #f0f6fc !important;
}

body.dark-mode .text-on-surface-variant {
  color: #8b9bb4 !important;
}

body.dark-mode .border-surface-container {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode input {
  background-color: #1a2332 !important;
  color: #f0f6fc !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode input::placeholder {
  color: #64748b !important;
}

/* Modals */
body.dark-mode #downloader-modal-card,
body.dark-mode #profile-modal-card,
body.dark-mode #share-modal-card,
body.dark-mode #download-queue-modal-card {
  background-color: #151c28 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7) !important;
}

body.dark-mode #queue-drawer {
  background-color: #151c28 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Karaoke Deck & Lyrics */
body.dark-mode #karaoke-lyrics-card {
  background-color: #151c28 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode #karaoke-lyrics-box {
  background-color: #101620 !important;
}

body.dark-mode #lyrics-offset-controls {
  background-color: #1a2332 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Sub-Tab Pills and Filters */
body.dark-mode .sub-tab-pill:not(.active) {
  background-color: #1a2332 !important;
  color: #8b9bb4 !important;
}
body.dark-mode .sub-tab-pill:not(.active):hover {
  background-color: #212c3e !important;
  color: #f0f6fc !important;
}

body.dark-mode .filter-pill:not(.active) {
  background-color: #1a2332 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #8b9bb4 !important;
}
body.dark-mode .filter-pill:not(.active):hover {
  background-color: #212c3e !important;
  color: #f0f6fc !important;
}

/* Track list table rows in dark mode */
body.dark-mode .track-row:hover {
  background-color: rgba(255, 255, 255, 0.04) !important;
}
body.dark-mode .track-row.active {
  background-color: rgba(230, 13, 69, 0.15) !important;
  border-left: 3px solid #e60d45 !important;
}

/* Navigation items in dark mode */
body.dark-mode .nav-item:not(.active) {
  color: #8b9bb4 !important;
}
body.dark-mode .nav-item:not(.active):hover {
  background-color: #1a2332 !important;
  color: #f0f6fc !important;
}

body.dark-mode .mobile-nav-item:not(.active) {
  color: #8b9bb4 !important;
}

/* Toast */
body.dark-mode .kurfa-toast {
  background: #1e283a !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f0f6fc !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

/* Lyrics in dark mode */
body.dark-mode .lyric-line,
body.dark-mode .lyrics-line {
  color: #8b9bb4;
}
body.dark-mode .lyric-line:hover,
body.dark-mode .lyrics-line:hover {
  color: #f0f6fc;
}

/* EQ Presets */
body.dark-mode .eq-preset-btn:not(.active) {
  background-color: #1a2332 !important;
  color: #8b9bb4 !important;
}
body.dark-mode .eq-preset-btn:not(.active):hover {
  background-color: #212c3e !important;
  color: #f0f6fc !important;
}

/* Tables */
body.dark-mode thead {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
body.dark-mode th {
  color: #8b9bb4 !important;
}
body.dark-mode tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

/* Range Inputs */
body.dark-mode input[type="range"] {
  background: #212c3e !important;
}

/* Kbd */
body.dark-mode kbd {
  background: #1a2332 !important;
  color: #8b9bb4 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Scrollbars */
body.dark-mode ::-webkit-scrollbar-thumb {
  background: #253346;
}
body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #33445c;
}
body.dark-mode ::-webkit-scrollbar-track {
  background: #0c1017;
}

/* =============================================================================
   MOBILE SMARTPHONE OPTIMIZATIONS (Touch Targets, Notch & Dynamic Island)
   ============================================================================= */

@media (max-width: 768px) {
  /* Dynamic Island & Notch Safe Areas */
  #mobile-bottom-nav {
    height: calc(3.85rem + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
  
  #mobile-mini-player {
    bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  main {
    padding-top: calc(4.25rem + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(9.5rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  header {
    height: calc(3.75rem + env(safe-area-inset-top, 0px)) !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
  }

  /* Modals: fit inside mobile screens with scrolling if keyboard opens */
  #downloader-modal-card,
  #profile-modal-card,
  #share-modal-card,
  #download-queue-modal-card {
    max-height: calc(92dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 0.5rem !important;
    padding: 1.25rem !important;
    border-radius: 1.25rem !important;
  }

  /* Queue drawer on mobile */
  #queue-drawer {
    right: 0.5rem !important;
    left: 0.5rem !important;
    width: auto !important;
    bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px)) !important;
    max-height: 65vh !important;
  }

  /* Scrollbars on phone */
  ::-webkit-scrollbar {
    width: 3px;
    height: 3px;
  }

  /* Compact typography & touch buttons */
  .filter-pill, .sub-tab-pill, .filter-chip {
    touch-action: manipulation;
  }
}

/* Responsive Deck Video Styling (16:9 proportional video fitting) */
#deck-video-wrapper {
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  max-height: 420px !important;
  background-color: #000 !important;
}

#deck-video-slot {
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
}

#deck-video-slot iframe,
#yt-player {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 1rem !important;
}

/* =============================================================================
   14. FLOATING HORIZONTAL SHELF ARROWS & DRAG-TO-SCROLL
   ============================================================================= */

.btn-shelf-arrow {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  z-index: 25;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.15s ease, background-color 0.15s ease;
  cursor: pointer;
  touch-action: manipulation;
}

.group\/shelf:hover .btn-shelf-arrow {
  opacity: 0.95;
  pointer-events: auto;
}

.btn-shelf-arrow:hover {
  opacity: 1 !important;
  transform: translateY(-50%) scale(1.08);
  background-color: #ffffff;
  color: #ba0034;
}

.btn-shelf-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

body.dark-mode .btn-shelf-arrow {
  background-color: rgba(28, 34, 48, 0.95);
  color: #f1f3f9;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

body.dark-mode .btn-shelf-arrow:hover {
  background-color: #273042;
  color: #ffb3b5;
}

/* Horizontal scroll styling */
#trendler-cards-grid,
#popular-artists-grid {
  touch-action: pan-y;
  scroll-behavior: smooth;
  user-select: none;
  -webkit-user-select: none;
}

/* When grabbing/dragging */
.cursor-grab {
  cursor: grab;
}

.cursor-grabbing {
  cursor: grabbing !important;
}

/* =============================================================================
   15. ETKİLEŞİMLİ AKILLI TAHTA & ESKİ CİHAZ (VESTEL / ARÇELİK / PARDUS) PERFORMANS MODU
   ============================================================================= */

/* 1. Sıfır Blur & Katman Birleştirme: Eski Intel HD Graphics ve Celeron işlemcileri rahatlatır */
body.tahta-mode,
html.tahta-mode,
body.tahta-mode * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.tahta-mode {
  transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeSpeed;
}

/* 2. Katı, Opak ve Hızlı Çizilen Yüzeyler */
body.tahta-mode header,
body.tahta-mode footer,
body.tahta-mode aside,
body.tahta-mode #mobile-mini-player,
body.tahta-mode #mobile-bottom-nav {
  background-color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
}

body.dark-mode.tahta-mode header,
body.dark-mode.tahta-mode footer,
body.dark-mode.tahta-mode aside,
body.dark-mode.tahta-mode #mobile-mini-player,
body.dark-mode.tahta-mode #mobile-bottom-nav {
  background-color: #11151f !important;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35) !important;
}

/* Modallarda CPU yoran blur yerine düz ve hızlı koyu perde */
body.tahta-mode .fixed.inset-0 {
  background-color: rgba(0, 0, 0, 0.65) !important;
}

/* 3. Ağır CSS Gölgelerini ve GPU Isınmasını Kaldır */
body.tahta-mode .shadow-2xl,
body.tahta-mode .shadow-xl,
body.tahta-mode .shadow-lg {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* 4. Etkileşimli Tahta Dokunmatik Hedefleri: 65"-84" Tahtalarda Kolay Tıklama */
body.tahta-mode button,
body.tahta-mode .cursor-pointer,
body.tahta-mode .nav-item {
  touch-action: manipulation !important;
  min-height: 40px;
}

body.tahta-mode #trendler-cards-grid .btn-shelf-arrow,
body.tahta-mode #popular-artists-grid .btn-shelf-arrow {
  opacity: 0.9 !important;
  pointer-events: auto !important;
  width: 3rem !important;
  height: 3rem !important;
}

/* 5. Donanım Hızlandırması & Ağır Animasyonları Kapat */
body.tahta-mode #trendler-cards-grid,
body.tahta-mode #popular-artists-grid,
body.tahta-mode #home-tracklist-table {
  contain: content;
}


