/* =========================================================
   MODERN HOVER SIDEBAR - GÖLGESİZ SON HALİ
   ========================================================= */

:root {
  --sidebar-width-collapsed: 72px;
  --sidebar-width-expanded: 260px;
  --sidebar-bg-staff: linear-gradient(180deg, #0c4a6e 0%, #082f49 100%);
  --sidebar-bg-default: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  --sidebar-text: #cbd5e1;
  --sidebar-text-hover: #ffffff;
  --sidebar-active: #3b82f6;
  --sidebar-active-bg: rgba(59, 130, 246, 0.15);
  --sidebar-danger: #ef4444;
  --sidebar-danger-bg: rgba(239, 68, 68, 0.15);
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  --sidebar-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-sidebar {
  position: fixed;
  left: 0;
  top: 70px;
  bottom: 0;
  width: var(--sidebar-width-collapsed);
  background: var(--sidebar-bg-default);
  z-index: 1000;
  /* ✨ GİZLE: Kapalıyken dışarı taşan alan hem görünmesin hem hover almasın */
  overflow: hidden;
  transition: width var(--sidebar-transition);
  box-shadow: none;
}

.dashboard-sidebar:hover {
  width: var(--sidebar-width-expanded);
  z-index: 2000;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.25);
  /* İstersen burada tekrar visible yapabilirsin ama şart değil */
  overflow: visible;
}


.dashboard-sidebar--staff {
  background: var(--sidebar-bg-staff);
}

/* Hover durumu - sadece burada gölge var */

/* ===== SIDEBAR NAV ===== */
.sidebar-nav {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  width: var(--sidebar-width-expanded);
  overflow-y: auto;
  overflow-x: visible;
}

/* Scrollbar */
.sidebar-nav {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* ===== HEADER - SADECE HOVER'DA ===== */
.sidebar-nav__header {
  padding: 0 20px 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--sidebar-border);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  white-space: nowrap;
  width: var(--sidebar-width-expanded);
  box-sizing: border-box;
}

.dashboard-sidebar:hover .sidebar-nav__header {
  opacity: 1;
  visibility: visible;
}

/* ===== PROPERTY BADGE ===== */
.property-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.property-badge__icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.property-badge__info {
  flex: 1;
  min-width: 0;
}

.sidebar-nav__title {
  font-size: 15px;
  font-weight: 700;
  color: white;
  margin: 0 0 4px;
  white-space: nowrap;
}

.sidebar-nav__subtitle {
  font-size: 11px;
  color: #94a3b8;
  margin: 0;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ===== NAV LIST ===== */
.sidebar-nav__list {
  list-style: none;
  margin: 0;
  padding: 0 12px;
  flex: 1;
  width: var(--sidebar-width-expanded);
  box-sizing: border-box;
}

.sidebar-nav__item {
  margin-bottom: 4px;
  position: relative;
}

/* Divider - collapsed durumda kısa, hover'da normal */
.sidebar-nav__item--divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 16px 0;
  opacity: 0.5;
  transition: all var(--sidebar-transition);
}

.dashboard-sidebar:not(:hover) .sidebar-nav__item--divider {
  width: 40px !important;
  margin: 16px auto !important;
}

.dashboard-sidebar:hover .sidebar-nav__item--divider {
  width: calc(var(--sidebar-width-expanded) - 24px);
  margin: 16px 0;
}

/* ===== NAV LINK - TEMEL STILLER ===== */
.sidebar-nav__link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
  width: calc(var(--sidebar-width-expanded) - 24px);
  box-sizing: border-box;
}

.sidebar-nav__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sidebar-text-hover);
  transform: translateX(2px);
}

/* Danger Link */
.sidebar-nav__link--danger {
  color: #f87171;
}

.sidebar-nav__link--danger:hover {
  background: var(--sidebar-danger-bg);
  color: #fca5a5;
}

/* ===== İKONLAR ===== */
.sidebar-nav__icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: currentColor;
  transition: transform 0.2s ease;
}

.sidebar-nav__link:hover .sidebar-nav__icon {
  transform: scale(1.1);
}

/* ===== METİN - SADECE HOVER'DA ===== */
.sidebar-nav__text {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  font-weight: 500;
  white-space: nowrap;
  flex: 1;
}

.dashboard-sidebar:hover .sidebar-nav__text {
  opacity: 1;
  visibility: visible;
}

/* ===== BADGE - SADECE HOVER'DA ===== */
.sidebar-nav__badge {
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 20px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  line-height: 1.5;
  flex-shrink: 0;
}

.sidebar-nav__badge--warning {
  background: #f59e0b;
}

.dashboard-sidebar:hover .sidebar-nav__badge {
  opacity: 1;
  visibility: visible;
}

/* ===== EXTERNAL ICON - SADECE HOVER'DA ===== */
.sidebar-nav__external {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  color: #94a3b8;
  display: flex;
  align-items: center;
  margin-left: 4px;
  flex-shrink: 0;
}

.dashboard-sidebar:hover .sidebar-nav__external {
  opacity: 1;
  visibility: visible;
}

/* ===== FOOTER - SADECE HOVER'DA ===== */
.sidebar-nav__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-border);
  margin-top: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  width: var(--sidebar-width-expanded);
  box-sizing: border-box;
}

.dashboard-sidebar:hover .sidebar-nav__footer {
  opacity: 1;
  visibility: visible;
}

/* ===== CURRENT PROPERTY ===== */
.current-property {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px;
}

.current-property__label {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.current-property__name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-property__change {
  font-size: 11px;
  font-weight: 600;
  color: #60a5fa;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: rgba(96, 165, 250, 0.1);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.current-property__change:hover {
  background: rgba(96, 165, 250, 0.2);
  text-decoration: none;
  color: #93c5fd;
}

/* ===== MAIN CONTENT - SABİT MARGIN ===== */
.fom-main.has-sidebar {
  margin-left: var(--sidebar-width-collapsed) !important;
  transition: none !important;
  position: relative;
  z-index: 1;
}

/* ===== TOOLTIP - SADECE COLLAPSED DURUMDA ===== */
.tooltip {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%) translateX(12px);
  background: #1e293b;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 3000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  letter-spacing: 0.3px;
}

.tooltip::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #1e293b;
}

/* Collapsed durumda hover'da tooltip göster */
.dashboard-sidebar:not(:hover) .sidebar-nav__link:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(16px);
}

/* ===== AKTİF LİNK - HOVER DURUMU (SIDEBAR AÇIK) ===== */
.dashboard-sidebar:hover .sidebar-nav__link--active {
  background: var(--sidebar-active-bg) !important;
  border-left: 3px solid var(--sidebar-active) !important;
  color: white !important;
}

.dashboard-sidebar:hover .sidebar-nav__link--active .sidebar-nav__icon {
  color: white !important;
}

/* ===== AKTİF LİNK - COLLAPSED DURUM (SIDEBAR KAPALI) ===== */
.dashboard-sidebar:not(:hover) .sidebar-nav__link--active {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--sidebar-text) !important;
  padding: 10px 0 !important;
  justify-content: center !important;
}

/* Aktif link ikonu - collapsed durumda SADECE ikon mavi */
.dashboard-sidebar:not(:hover) .sidebar-nav__link--active .sidebar-nav__icon {
  color: var(--sidebar-active) !important;
  transform: scale(1.1);
}

/* Aktif link tooltip - collapsed durumda mavi */
.dashboard-sidebar:not(:hover) .sidebar-nav__link--active:hover .tooltip {
  background: var(--sidebar-active) !important;
}

.dashboard-sidebar:not(:hover) .sidebar-nav__link--active:hover .tooltip::before {
  border-right-color: var(--sidebar-active) !important;
}

/* ===== TÜM LİNKLER - COLLAPSED DURUMDA ===== */
.dashboard-sidebar:not(:hover) .sidebar-nav__link {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 10px 0 !important;
  justify-content: center !important;
  gap: 0 !important;
  width: 100% !important;
}

/* İkonlar - collapsed durumda ortalanmış */
.dashboard-sidebar:not(:hover) .sidebar-nav__icon {
  margin: 0 auto !important;
}

/* Hover efekti - collapsed durumda hafif arkaplan */
.dashboard-sidebar:not(:hover) .sidebar-nav__link:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 8px;
}

/* Aktif link hover - collapsed durumda mavi arkaplan */
.dashboard-sidebar:not(:hover) .sidebar-nav__link--active:hover {
  background: rgba(59, 130, 246, 0.15) !important;
}

/* ===== HEADER/FOOTER - COLLAPSED DURUMDA TAMAMEN GİZLİ ===== */
.dashboard-sidebar:not(:hover) .sidebar-nav__header,
.dashboard-sidebar:not(:hover) .sidebar-nav__footer {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* ===== HOVER BÖLGESİ - SADECE SİDEBAR'IN KENDİSİ ===== */
/* ÖNEMLİ: ::after kaldırıldı, gölge yok, sadece sidebar'ın kendisi hover tetikler */
.dashboard-sidebar::after {
  display: none;
}

/* ===== ANİMASYON ===== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.dashboard-sidebar:hover .sidebar-nav__text,
.dashboard-sidebar:hover .sidebar-nav__badge,
.dashboard-sidebar:hover .sidebar-nav__external,
.dashboard-sidebar:hover .sidebar-nav__header,
.dashboard-sidebar:hover .sidebar-nav__footer {
  animation: slideIn 0.2s ease forwards;
}

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 768px) {
  /* 🔹 Sidebar'ı mobilde tamamen gizle */
  .dashboard-sidebar {
    display: none !important;
  }

  /* 🔹 İçerik, sidebar yokmuş gibi tam genişlikte olsun */
  .fom-main.has-sidebar {
    margin-left: 0 !important;
  }

  /* 🔹 Eski mobil overlay ve floating toggle butonunu da kapatıyoruz */
  .sidebar-overlay,
  .mobile-sidebar-toggle {
    display: none !important;
  }

  /* 🔹 Tooltip'ler mobilde gereksiz */
  .tooltip {
    display: none !important;
  }

  /* Bu kural görünmese de zararı yok; istersen silebilirsin */
  .dashboard-sidebar:not(:hover) .sidebar-nav__link {
    padding: 12px 0;
  }
}

/* ===== PERFORMANS ===== */
.dashboard-sidebar,
.dashboard-sidebar * {
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

.dashboard-sidebar {
  transform: translateZ(0);
  will-change: width;
}

.sidebar-nav__link,
.sidebar-nav__icon,
.sidebar-nav__text,
.sidebar-nav__badge,
.sidebar-nav__external,
.tooltip {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
