/* ***************************************
   RESPONSIVE DÜZENLEMELER
   Fomantic UI Breakpoint Overrides
   *************************************** */

/* Container genişliğini tüm ekranlarda %100 yap (Fomantic kısıtlamalarını kaldır) */
.ui.ui.ui.container:not(.fluid) {
  width: 100%;
  max-width: 1199.98px;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}

/* 1200px ve üzeri ekranlar için özel kural (Eğer spesifik bir genişlik istenirse buraya eklenebilir) */
@media only screen and (min-width: 1200px) {
  .ui.ui.ui.container:not(.fluid) {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ***************************************
   MOBİL ARAMA - Varsayılan (gizli)
   *************************************** */

/* Mobil arama butonu - varsayılanda gizli */
.mobil-arama-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--header-text, #333);
  font-size: 18px;
  padding: 8px;
  margin-right: 4px;
  transition: color 0.2s, transform 0.2s;
}

.mobil-arama-btn:hover {
  color: var(--link-color, #4183c4);
  transform: scale(1.1);
}

/* Mobil arama overlay - varsayılanda gizli */
.mobil-arama-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--header-bg, #ddd);
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Overlay aktif durumu */
.mobil-arama-overlay.aktif {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.mobil-arama-overlay form {
  flex: 1;
}

.mobil-arama-overlay .ui.fluid.icon.input {
  width: 100%;
}

.mobil-arama-overlay .mobil-arama-input {
  background: var(--input-bg, #fff) !important;
  color: var(--input-text, #333) !important;
  border-color: var(--input-border, rgba(34, 36, 38, .15)) !important;
  border-radius: 6px !important;
  font-size: 16px !important;
}

.mobil-arama-overlay .mobil-arama-input::placeholder {
  color: var(--text-muted, rgba(0, 0, 0, .6));
}

/* Kapatma butonu */
.mobil-arama-kapat {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--header-text, #333);
  font-size: 18px;
  padding: 8px;
  transition: color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.mobil-arama-kapat:hover {
  color: #ff4d4d;
  transform: scale(1.1);
}

/* ***************************************
   730px ALTI - MOBİL ARAMA AKTİF
   *************************************** */
@media only screen and (max-width: 730px) {
  /* Masaüstü arama formunu gizle */
  #search-block-form {
    display: none !important;
  }

  /* Mobil arama ikonunu göster */
  .mobil-arama-btn {
    display: flex !important;
  }

  /* Header'ı relative yap (overlay konumlanması için) */
  #header {
    position: relative;
    /* Zoom geçişi için animasyon */
    transition: all 0.3s ease;
  }

  #header > .ui.container {
    position: relative;
  }

  /* Arama sonuçları - Mobil slide geçişi */
  .arama-icerik-alani {
    position: relative;
    overflow: hidden;
    flex-direction: row !important;
    min-height: 300px;
  }

  .arama-kitap-listesi {
    width: 100% !important;
    min-width: 100%;
    max-height: none !important;
    border-right: none !important;
    border-bottom: none !important;
    transition: transform 0.3s ease;
    transform: translateX(0);
  }

  .arama-detay-alani {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: none !important;
    padding-left: 0 !important;
    transition: transform 0.3s ease;
    transform: translateX(100%);
    background: var(--oku-bg, #fbf0cb);
    overflow-y: auto;
  }

  /* Detay görünür hale gelince */
  .arama-icerik-alani.arama-detay-gorunur .arama-kitap-listesi {
    transform: translateX(-100%);
  }

  .arama-icerik-alani.arama-detay-gorunur .arama-detay-alani {
    transform: translateX(0);
  }
}

/* 570px Altı Zoom 0.8 */
@media only screen and (max-width: 570px) {
  :root {
    --header-h: 61px;
  }

  #header > * {
    /* zoom: 0.8; */
  }

  #header #site-name {
    width: 120px;
    font-size: 20px;
    line-height: 26px;
  }
}

/* 416px Altı Zoom 0.73 */
@media only screen and (max-width: 454px) {
  :root {
    --header-h: 55px;
  }

  #header > * {
    /*zoom: 0.73;*/
  }

  #header #site-logo {
    width: 36px;
  }

  #header #site-name {
    width: 105px;
    font-size: 17px;
    line-height: 22px;
  }
}

/* Geri butonu - varsayılanda gizli (masaüstünde) */
.arama-geri-btn {
  display: none;
}

@media only screen and (max-width: 730px) {
  .arama-geri-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--link-color, #4183c4);
    border-bottom: 1px solid var(--divider-color, rgba(34, 36, 38, .15));
    transition: background 0.2s;
  }

  .arama-geri-btn:hover {
    background: rgba(0, 0, 0, 0.04);
  }

  .arama-geri-btn i {
    font-size: 16px;
  }
}

/* ***************************************
   768px ALTI - MOBİL MENÜ AKTİF
   *************************************** */
@media only screen and (max-width: 768px) {
  /* Üst menü (Kütüphane, Vecizeler vb.) gizle */
  #ust-menu {
    display: none !important;
  }

  /* Mobil menü açma ikonunu göster */
  .mobil-menu-ac {
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 10px;
    font-size: 1.2rem;
    color: var(--header-text, #333);
  }

  /* Header içindeki dropdown ve ikon hizalaması */
  #header .header.item {
    padding-right: 0;
  }

  #header .right.floated.item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-left: 0;
    padding-right: 0;
  }
}

/* 768px üzerinde mobil menü ikonunu gizle */
@media only screen and (min-width: 769px) {
  .mobil-menu-ac {
    display: none !important;
  }
}
