/* * Plugin CSS: IELTS Sidebar Pro
 * Version: 2.5 (Modern Submenu & Dark Hover)
 */

:root {
  --primary-color: #4f46e5;
  /* İndigo Mavisi */
  --text-color: #374151;
  /* Koyu Gri Metin */
  --text-light: #6b7280;
  /* Açık Gri Metin */
  --bg-color: #ffffff;
  /* Sayfa Arka Planı */
  --sidebar-bg: #ffffff;
  /* Sidebar Arka Planı */
  --border-color: #e5e7eb;
  /* Çizgi Rengi */
  --hover-bg: #374151;
  /* Koyu Gri Hover */
  --hover-text: #ffffff;
  /* Hover Text */
}

/* --- 1. GENEL YERLEŞİM (LAYOUT) --- */
.app-layout {
  display: flex;
  position: relative;
  min-height: 100vh;
  background-color: transparent;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- 2. SIDEBAR YAPISI --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 280px;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  box-sizing: border-box;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: nowrap;
  /* Metin taşmasını önler */
}

/* --- Scrollbar Özelleştirme --- */
.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 20px;
}

/* --- 3. LOGO VE HEADER --- */
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  min-height: 60px;
  overflow: hidden;
  transition: padding 0.3s ease;
  /* Padding değişimi için */
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
  width: 100%;
  /* Hizalama için genişlik şart */
}

.logo-icon {
  /* İkon Boyutlarını KİLİTLE */
  min-width: 32px;
  min-height: 32px;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  /* Asla büzüşmesin */
  color: var(--primary-color);
  transition: margin 0.3s ease;
  object-fit: contain;
}

.logo-text {
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
  color: var(--text-color);
  opacity: 1;
  transform-origin: left center;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transition-delay: 0.1s;
}

.logo-text span {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-light);
  line-height: 1.2;
}

/* --- 4. MENÜ LİNKLERİ --- */
.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
}

.sidebar-menu li {
  margin-bottom: 0.25rem;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-light);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.4;
  overflow: hidden;
  /* Varsayılan genişlik ve yükseklik */
  width: auto;
  height: auto;
}

/* Link Metni (Span) */
.sidebar-menu li a span {
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transition-delay: 0.1s;
  display: inline-block;
}

.sidebar-menu li .menu-icon {
  /* İkon Boyutlarını KİLİTLE */
  min-width: 24px;
  min-height: 24px;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  /* Asla büzüşmesin */
  stroke-width: 2px;
}

/* Aktif (Seçili) Durum */
.sidebar-menu li.active a {
  background-color: var(--hover-bg);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(55, 65, 81, 0.1), 0 2px 4px -1px rgba(55, 65, 81, 0.06);
}

.sidebar-menu li.active a .menu-icon {
  stroke: white;
}

/* Hover Durumu */
.sidebar-menu li:not(.active) a:hover {
  background-color: var(--hover-bg);
  color: var(--hover-text);
}

.sidebar-menu li:not(.active) a:hover .menu-icon {
  stroke: var(--hover-text);
}

/* Ayıraçlar ve Rozetler */
.menu-separator {
  height: 1px;
  background-color: var(--border-color);
  margin: 1rem 0;
}

/* --- SUBMENU STİLLERİ --- */
.has-submenu {
  position: relative;
}

.submenu-toggle {
  cursor: pointer;
  position: relative;
}

.submenu-arrow {
  margin-left: auto;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.has-submenu.open .submenu-arrow {
  transform: rotate(180deg);
}

.submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  background-color: #f8fafc;
  border-radius: 8px;
  margin-top: 4px;
}

.has-submenu.open .submenu {
  max-height: 500px;
  opacity: 1;
}

.submenu li {
  margin-bottom: 0;
}

.submenu li a {
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  font-size: 0.9rem;
  border-radius: 6px;
  margin: 2px 4px;
}

.submenu li a .menu-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
}

/* Submenu içindeki linklere de hover efekti */
.submenu li:not(.active) a:hover {
  background-color: var(--hover-bg);
  color: var(--hover-text);
}

.submenu li:not(.active) a:hover .menu-icon {
  stroke: var(--hover-text);
}

.new-badge {
  margin-left: auto;
  background-color: var(--primary-color);
  color: white;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
  transition-delay: 0.1s;
}

/* --- 5. FOOTER & DARALTMA BUTONU --- */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  color: var(--text-light);
  justify-content: flex-start;
  width: auto;
  height: auto;
}

.sidebar-footer a:hover {
  background-color: var(--hover-bg);
  color: var(--text-color);
}

/* --- 6. MAIN CONTENT (İÇERİK ALANI) --- */
.main-content {
  margin-left: 280px;
  padding: 2rem 3rem;
  width: calc(100% - 280px);
  box-sizing: border-box;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: transparent;
}

/* --- 7. DARALTILMIŞ (COLLAPSED) DURUM - MASAÜSTÜ --- */
.sidebar.collapsed {
  width: 80px;
  /* Sidebar genişliği */
  padding: 1.5rem 0.5rem;
  /* Yan boşlukları daralt */
}

/* Metinleri ve Badge'i Gizle */
.sidebar.collapsed .logo-text,
.sidebar.collapsed .sidebar-menu li a span,
.sidebar.collapsed .new-badge {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  left: 100%;
  transition-delay: 0s;
}

.sidebar.collapsed .submenu-arrow {
  display: none;
}

/* === İKONLARI ORTALA VE SABİTLE (KARE GÖRÜNÜM) === */

/* 1. Header ve Logo */
.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sidebar.collapsed .logo-container {
  justify-content: center;
  margin: 0;
}

.sidebar.collapsed .logo-icon {
  margin: 0;
}

/* 2. Menü Linklerini Kare Yap ve Ortala */
.sidebar.collapsed .sidebar-menu li a {
  justify-content: center;
  /* İkonu ortala */
  padding: 0;
  /* İç boşluğu sıfırla */
  width: 48px;
  /* Sabit genişlik */
  height: 48px;
  /* Sabit yükseklik */
  margin: 0 auto;
  /* Kutuyu ortala */
  border-radius: 12px;
}

/* 3. Footer Butonunu Kare Yap ve Ortala */
.sidebar.collapsed .sidebar-footer a {
  justify-content: center;
  padding: 0;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 12px;
}

/* İkonu ters çevir */
.sidebar.collapsed #desktop-collapse-btn .menu-icon {
  transform: rotate(180deg);
}

/* İçerik alanını daralan menüye göre genişlet */
.sidebar.collapsed+.main-content {
  margin-left: 80px;
  width: calc(100% - 80px);
}

/* --- 8. MOBİL / RESPONSIVE (MASAÜSTÜ AYARLARINI SIFIRLA) --- */
.sidebar-close-btn {
  display: none;
}

.mobile-menu-toggle {
  display: none;
}

.overlay {
  display: none;
}

@media (max-width: 992px) {

  /* 1. Sidebar Mobil Temel */
  .sidebar {
    transform: translateX(-100%);
    width: 280px !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: normal;
    padding: 1.5rem 1rem !important;
    /* Masaüstü padding değişimini iptal et */
  }

  /* 2. Sidebar AÇIK Durumu */
  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  }

  /* 3. Collapsed Modunun Mobilde Görünmesini Engelle */
  .sidebar.collapsed {
    width: 280px !important;
    transform: translateX(-100%);
  }

  /* Collapsed olsa bile menü açıldıysa GÖSTER */
  .sidebar.collapsed.open {
    transform: translateX(0) !important;
  }

  /* 4. MASAÜSTÜNDEKİ "KARE İKON" AYARLARINI MOBİLDE İPTAL ET */
  .sidebar.collapsed .sidebar-menu li a {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0.75rem 1rem !important;
    justify-content: flex-start !important;
  }

  .sidebar.collapsed .sidebar-footer a {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0.75rem 1rem !important;
    justify-content: flex-start !important;
  }

  .sidebar.collapsed .logo-container {
    justify-content: flex-start !important;
  }

  .sidebar.collapsed .sidebar-header {
    justify-content: space-between !important;
  }

  /* 5. Mobilde Yazıları Geri Getir */
  .sidebar.collapsed .logo-text,
  .sidebar.collapsed .sidebar-menu li a span,
  .sidebar.collapsed .new-badge {
    opacity: 1 !important;
    position: static !important;
    pointer-events: auto !important;
    display: inline-block;
  }

  .sidebar.collapsed #desktop-collapse-btn .menu-icon {
    transform: rotate(0deg);
  }

  /* 6. İçerik Alanı Mobil */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 1.5rem;
  }

  .sidebar.collapsed+.main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* 7. Toggle Butonlar */
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 998;
    background-color: #1f2937;
    border: none;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }

  .sidebar-close-btn {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
  }

  #desktop-collapse-btn {
    display: none;
  }

  /* 8. Karartma Katmanı */
  .overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
  }

  .overlay.active {
    display: block;
  }
}