/* === MODAL PENCERELER (iOS TARZI - RENK TONU DÜZELTİLDİ) === */

/* Genel Modal/Gate Arka Planı */
.gate,
.modal,
#queueModal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  opacity: 1;
  transition: opacity 0.45s;
}

.modal,
#queueModal {
  display: none;
  opacity: 0;
  background: rgba(11, 10, 16, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal.show,
#queueModal[style*="display: flex"] {
  display: flex;
  opacity: 1;
  animation: fadeIn 0.35s;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal/Gate Kartları  */
.gate-card,
.modal-card {
  width: min(560px, 92vw);
  padding: 24px;
  text-align: center;
  box-shadow: 0 20px 60px #0008;
  background: rgba(30, 25, 45, 0.55);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gate input {
  width: 100%;
  margin-top: 10px;
}
.remember-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
  gap: 8px;
}
.remember-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.remember-wrap span {
  user-select: none;
}
.gate-hearts {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 10px;
}
.shake {
  animation: shake 0.4s;
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

/* Çalma Listesi (Queue) Modalı */
#queueModal {
  z-index: 950;
  background: rgba(11, 10, 16, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  height: 100dvh;
  min-height: 100dvh;
}
#queuePanel {
  /* İçerik paneli  */
  width: min(720px, 92vw);
  max-height: 70vh;
  padding: 14px;
  background: rgba(30, 25, 45, 0.75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#queuePanel > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

/* Çalma Listesi Arama Kutusu */
#queueSearch {
  display: block;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  font-family: var(--font-body);
  font-size: 15px;
  margin-bottom: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#queueSearch:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.4);
}
#queueSearch::-webkit-search-cancel-button {
  appearance: none;
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2ZmZmZmZiIgb3BhY2l0eT0iMC43Ij48cGF0aCBkPSJNMTIgMmMtNS41MyAwLTEwIDQuNDctMTAgMTBzNC40NyAxMCAxMCAxMCAxMC00LjY3IDEwLTEwUzE3LjUzIDIgMTIgMnptNCAxMi41OWwtMS40MSAxLjQxTDEyIDEzLjQxbC0yLjU5IDIuNTlMOCA MTQuNTlMMTAuNTkgMTIgOCAxMC41OUw5LjQxIDlsMi41OSAyLjU5TDE0LjU5IDlMMTYgMTAuNTlMMTMuNDEgMTIgMTYgMTQuNTl6Ii8+PC9zdmc+");
}

/* Çalma Listesi Stilleri */
#queueList {
  display: grid;
  gap: 4px;
  counter-reset: track;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 8px;
  transition: background 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-item::before {
  counter-increment: track;
  content: counter(track) ".";
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--muted);
  font-size: 14px;
  min-width: 20px;
  text-align: right;
}
.queue-title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  color: var(--text);
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-item:hover,
.queue-item:focus {
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

/* Çalan Şarkı Göstergesi (Animasyonlu) */
.queue-playing-icon {
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
  margin-left: auto;
}
.queue-playing-icon span {
  width: 3px;
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  animation: queue-wave 0.8s ease-in-out infinite alternate;
}
.queue-playing-icon span:nth-child(2) {
  animation-delay: -0.4s;
}
.queue-playing-icon span:nth-child(3) {
  animation-delay: -0.2s;
}
@keyframes queue-wave {
  from {
    height: 4px;
  }
  to {
    height: 16px;
  }
}

/* Aktif (Çalan) Şarkının Stili */
.queue-item.is-playing {
  background: rgba(168, 85, 247, 0.2);
}
.queue-item.is-playing .queue-title {
  color: var(--primary);
  font-weight: 700;
}
.queue-item.is-playing .queue-playing-icon {
  display: flex;
}
.queue-item.is-playing::before {
  color: var(--primary);
}
body.gate-blur #app,
body.lb-blur #app,
body.queue-blur #app {
  filter: blur(10px);
  transition: filter 0.25s;
}

/* iOS için Blur Düzeltmeleri */
@supports (-webkit-backdrop-filter: blur(0)) {
  #queueModal,
  .modal {
    background: rgba(11, 10, 16, 0.35);
  }
  .modal {
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
  }
  #lbOverlay {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }
  #lbOverlay,
  .gate,
  .modal,
  #queueModal {
    will-change: backdrop-filter;
  }
}

/* Lightbox (Resim Büyütme)  */
#lbOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.22s ease;
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: auto;
}
#lbInner {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
}
#lbImg {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 16px;
  border: 1px solid #ffffff33;
  box-shadow: 0 0 30px #a855f744;
  transition: transform 0.22s ease, opacity 0.22s ease;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  display: block;
}
.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #ffffff33;
  background: linear-gradient(180deg, #2b2144, #1a1630);
  color: #fff;
  display: grid;
  place-items: center;
  user-select: none;
  box-shadow: 0 6px 18px #0008, 0 0 0 2px #ffffff10 inset;
  transition: transform 0.12s;
  z-index: 100000;
}
.lb-btn:hover {
  transform: translateY(-50%) scale(1.06);
}
.lb-prev {
  left: 16px;
}
.lb-next {
  right: 16px;
}
