/* Theme overrides (light + dark)
   Loaded after style.css to gently modernize UI
   without changing existing class names/markup. */

:root {
  /* Light theme tokens */
  --bg: #f3f6ff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --text: #0b1220;
  --muted: #52607a;
  --border: rgba(2, 6, 23, 0.10);
  --border-2: rgba(2, 6, 23, 0.06);
  --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.05), 0 1px 1px rgba(2, 6, 23, 0.03);
  --shadow-md: 0 12px 35px rgba(2, 6, 23, 0.09);
  --shadow-lg: 0 24px 70px rgba(2, 6, 23, 0.14);
  --ring: 0 0 0 4px rgba(38, 139, 248, 0.22);
  --brand: #268bf8;
  --brand-2: #7c3aed;
  --radius: 14px;
}

html {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  color: var(--text);
  background: #292b33;
  line-height: 1.45;
}

/* Dark theme base polish (keeps Tailwind "dark:" classes working) */
.dark body {
  background: #23262b;
}

/* Layout surfaces */
.body-wrapper {
  background: transparent !important;
}

.sidebar-wrapper,
.header-wrapper > div,
.mobile-wrapper > div {
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}

/* Light theme surfaces */
html:not(.dark) .sidebar-wrapper {
  border-right: 1px solid var(--border-2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.76));
  box-shadow: var(--shadow-md);
}

html:not(.dark) .header-wrapper > div {
  border-bottom: 1px solid var(--border-2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.90), rgba(255, 255, 255, 0.72)) !important;
  box-shadow: var(--shadow-sm);
}

/* Dark theme surfaces */
.dark .header-wrapper > div,
.dark .mobile-wrapper > div {
  background: #1d1e24 !important;
  border-bottom-color: rgba(148, 163, 184, 0.12) !important;
}

.dark .sidebar-wrapper {
  background: #1d1e24 !important;
  border-right-color: rgba(148, 163, 184, 0.12) !important;
}

/* Buttons (theme + notifications) */
#theme-toggle,
#notification-btn {
  border-color: rgba(38, 139, 248, 0.25) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.55));
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

#theme-toggle:hover,
#notification-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(38, 139, 248, 0.45) !important;
}

#theme-toggle:focus-visible,
#notification-btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-md), var(--ring);
}

.dark #theme-toggle,
.dark #notification-btn {
  background: #292b33 !important;
  border-color: #1d1e24 !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* Sidebar/menu link polish (no class changes required) */
/* Sidebar/menu link polish (no class changes required) */
.sidebar-wrapper .item a > div,
.sidebar-wrapper-collapse .item a > span {
  padding: 8px; /* ✅ sabit, hover'da değişmiyor */
  transition: background-color 160ms ease, transform 160ms ease;
  border-radius: 12px;
  will-change: transform;
}

html:not(.dark) .sidebar-wrapper .item a:hover > div {
  background: rgba(38, 139, 248, 0.08);
  transform: translateX(1px);
}

.dark .sidebar-wrapper .item a:hover > div {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(1px);
  /* ❌ padding: 8px; kaldır */
}

.sidebar-wrapper .item a:focus-visible > div {
  outline: none;
  box-shadow: var(--ring);
}

/* Search bar refinements */
html:not(.dark) .searchbar-wrapper .px {
  border: 1px solid rgba(2, 6, 23, 0.10) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.78)) !important;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 160ms ease, border-color 160ms ease;
}

.searchbar-wrapper .px:focus-within {
  border-color: rgba(38, 139, 248, 0.45) !important;
  box-shadow: var(--shadow-md), var(--ring);
}

.search-input {
  color: var(--text) !important;
}

/* Dark mode: avoid "white blocks" */
.dark .searchbar-wrapper .px {
  border-color: rgba(148, 163, 184, 0.18) !important;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.60), rgba(15, 23, 42, 0.42)) !important;
}

.dark .search-input {
  color: rgba(248, 250, 252, 0.92) !important;
  background: transparent !important;
}

/* Cards / KPI polish */
.kpi-card,
.my-wallet,
.modernTable,
.marketerBarWrap,
.profile-box,
#notification-box,
#store-box {
  border-radius: var(--radius) !important;
}

html:not(.dark) .kpi-card,
html:not(.dark) .rounded-lg.bg-white,
html:not(.dark) .rounded-xl.bg-white {
  border: 1px solid var(--border-2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.84));
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dark .kpi-card,
.dark .rounded-lg.bg-white,
.dark .rounded-xl.bg-white {
  background: #1d1e24 !important;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.kpi-card:hover,
.rounded-lg.bg-white:hover,
.rounded-xl.bg-white:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(38, 139, 248, 0.24);
}

.kpi-icon {
  border: 1px solid rgba(34, 197, 94, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* Tables (light) */
html:not(.dark) .modernTable {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border-2);
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}

html:not(.dark) .modernTable thead th {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.88));
  color: rgba(2, 6, 23, 0.82);
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border-2);
}

html:not(.dark) .modernTable tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(2, 6, 23, 0.06);
  color: rgba(2, 6, 23, 0.80);
}

html:not(.dark) .modernTable tbody tr:nth-child(2n) td {
  background: rgba(248, 250, 252, 0.60);
}

html:not(.dark) .modernTable tbody tr:hover td {
  background: rgba(38, 139, 248, 0.06);
}

/* Tables (dark) */
.dark .modernTable {
  background: rgba(15, 28, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.dark .modernTable thead th {
  background: #292b33;
  color: rgba(248, 250, 252, 0.86);
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

.dark .modernTable tbody td {
  color: rgba(248, 250, 252, 0.84);
  border-bottom-color: rgba(148, 163, 184, 0.12);
  background: transparent;
}

.dark .modernTable tbody tr:nth-child(2n) td {
  background: rgba(255, 255, 255, 0.04);
}

.dark .modernTable tbody tr:hover td {
  background: rgba(38, 139, 248, 0.12);
}

/* Premium tables (siparis_onay) */
.premium-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}

html:not(.dark) .premium-table {
  background: var(--surface-solid);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-sm);
}

html:not(.dark) .premium-table thead {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.9));
}

html:not(.dark) .premium-table th {
  padding: 12px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

html:not(.dark) .premium-table td {
  padding: 11px 14px;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.86);
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

html:not(.dark) .premium-table tbody tr:nth-child(2n) td {
  background: rgba(248, 250, 252, 0.6);
}

html:not(.dark) .premium-table tbody tr:hover td {
  background: rgba(38, 139, 248, 0.06);
}

.dark .premium-table {
  background: rgba(15, 23, 42, 0.72);
}

.dark .premium-table thead {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.78));
}

.dark .premium-table th {
  padding: 12px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background-color: #19191e;
}

.dark .premium-table td {
  padding: 11px 14px;
  font-size: 0.85rem;
  color: rgba(248, 250, 252, 0.86);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.dark .premium-table tbody tr:nth-child(2n) td {
  background: #1d1e24;
}

.dark .premium-table tbody tr:hover td {
  background: rgba(38, 139, 248, 0.14);
}

/* Generic dashboard tables (Lead/Form pages use .table-content + plain table) */
.table-content > table,
.table-content table.w-full {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

html:not(.dark) .table-content > table,
html:not(.dark) .table-content table.w-full {
  background: var(--surface-solid);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-sm);
}

html:not(.dark) .table-content thead {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.88)) !important;
}

html:not(.dark) .table-content th {
  color: rgba(2, 6, 23, 0.78) !important;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 12px 14px !important;
  border-bottom: 1px solid rgba(2, 6, 23, 0.06);
  white-space: nowrap;
}

html:not(.dark) .table-content td {
  padding: 12px 14px !important;
  border-bottom: 1px solid rgba(2, 6, 23, 0.06);
  color: rgba(2, 6, 23, 0.78);
}

html:not(.dark) .table-content tbody tr:nth-child(2n) td {
  background: rgba(248, 250, 252, 0.60);
}

html:not(.dark) .table-content tbody tr:hover td {
  background: rgba(38, 139, 248, 0.06);
}

.dark .table-content > table,
.dark .table-content table.w-full {
  background: #19191e;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.dark .table-content thead {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.78)) !important;
}

.dark .table-content th {
  color: rgba(248, 250, 252, 0.86) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  padding: 12px 14px !important;
  white-space: nowrap;
}

.dark .table-content td {
  color: rgba(248, 250, 252, 0.82);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding: 12px 14px !important;
  background: transparent;
}

.dark .table-content tbody tr:nth-child(2n) td {
  background: rgba(255, 255, 255, 0.04);
}

.dark .table-content tbody tr:hover td {
  background: rgba(38, 139, 248, 0.12);
}

/* Order create form (siparis_olustur) – unify input/select look */
#orderCreateForm input,
#orderCreateForm select {
  border-radius: 0.75rem;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(148, 163, 184, 0.6);
  background-color: #f3f4f6;
  color: #0b1220;
  font-size: 0.875rem;
}

html:not(.dark) #orderCreateForm input[readonly],
html:not(.dark) #orderCreateForm input[disabled],
html:not(.dark) #orderCreateForm select[disabled] {
  background-color: #e5e7eb;
}

.dark #orderCreateForm input,
.dark #orderCreateForm select {
  border-color: rgba(148, 163, 184, 0.6);
  background-color: #111827;
  color: #f9fafb;
}

.dark #orderCreateForm input[readonly],
.dark #orderCreateForm input[disabled],
.dark #orderCreateForm select[disabled] {
  background-color: #020617;
}

#orderCreateForm input:focus,
#orderCreateForm select:focus {
  outline: none;
  border-color: rgba(34, 197, 94, 0.85);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.6);
}

/* Select dropdown readability (esp. dark mode) */
html:not(.dark) #orderCreateForm select option {
  background-color: #ffffff;
  color: #0b1220;
}

.dark #orderCreateForm select option {
  background-color: #020617;
  color: #f9fafb;
}

/* Slick dots (slider) */
.slick-dots {
  bottom: 10px !important;
}

.slick-dots li button:before {
  font-size: 10px !important;
  color: rgba(255, 255, 255, 0.75) !important;
  opacity: 1 !important;
}

.slick-dots li.slick-active button:before {
  color: #ffffff !important;
  text-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

/* Slider image overlay polish */
.robotics-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 600ms ease;
}

.card-slider:hover .robotics-slide-img {
  transform: scale(1.06);
}

.robotics-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(900px 420px at 20% 0%, rgba(38, 139, 248, 0.25), transparent 60%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.05), rgba(2, 6, 23, 0.62));
}

.robotics-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 18px;
}

.robotics-glass {
  width: 100%;
  border-radius: 16px;
  padding: 14px 14px 12px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

.robotics-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

/* Popups */
.profile-box,
#notification-box,
#store-box {
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-lg) !important;
}

.dark .profile-box,
.dark #notification-box,
.dark #store-box {
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45) !important;
}

/* Scrollbars (webkit) */
.sidebar-body::-webkit-scrollbar,
.scroll-style-1::-webkit-scrollbar,
.overflow-y-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.sidebar-body::-webkit-scrollbar-thumb,
.scroll-style-1::-webkit-scrollbar-thumb,
.overflow-y-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.sidebar-body::-webkit-scrollbar-thumb:hover,
.scroll-style-1::-webkit-scrollbar-thumb:hover,
.overflow-y-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.75);
  background-clip: content-box;
}


      /* aktif sidebar */
.sidebar-wrapper .item a.is-active > div {
  background: rgba(38, 139, 248, 0.14);
}

.dark .sidebar-wrapper .item a.is-active > div {
  background: rgb(34 197 94);
}

/* aktif + hover olunca */
.sidebar-wrapper .item a.is-active:hover > div {
  transform: translateX(1px);
}

  .autocomplete-item {
    color: #ffffff;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .autocomplete-item:hover,
  .autocomplete-item:focus,
  .autocomplete-item:focus-visible {
    background: rgba(12, 175, 96, 0.18);
    color: #ffffff;
    outline: none;
  }

  #cityFilterMenu,
  #districtFilterMenu,
  #customerFilterMenu,
  #marketerFilterMenu {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.08);
  }



  /* Autocomplete dropdown kutusu */
  #cityFilterMenu,
  #districtFilterMenu,
  #customerFilterMenu,
  #marketerFilterMenu {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }

  /* Dropdown item */
  .autocomplete-item {
    color: #ffffff !important;
    background: transparent !important;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  /* Desktop + mobil hover/focus/active */
  .autocomplete-item:hover,
  .autocomplete-item:focus,
  .autocomplete-item:focus-visible,
  .autocomplete-item:active {
    background: rgba(12, 175, 96, 0.18) !important;
    color: #ffffff !important;
    outline: none !important;
  }

  /* Mobilde tap highlight beyaz parlamasını kapat */
  .autocomplete-item,
  .autocomplete-item * {
    -webkit-tap-highlight-color: transparent;
  }

  /* Seçili/pressed anda iOS-Safari beyaz görünmesin */
  @media (hover: none) and (pointer: coarse) {
    .autocomplete-item:hover {
      background: transparent !important;
      color: #ffffff !important;
    }

    .autocomplete-item:active,
    .autocomplete-item:focus,
    .autocomplete-item:focus-visible {
      background: rgba(12, 175, 96, 0.22) !important;
      color: #ffffff !important;
    }
  }

/* iOS Safari selection fix */
@supports (-webkit-touch-callout: none) {

  .autocomplete-item:hover {
    background: transparent !important;
  }

  .autocomplete-item:active {
    background: rgba(12,175,96,0.25) !important;
  }

}

  /* Autocomplete dropdown container */
#cityFilterMenu,
#districtFilterMenu,
#customerFilterMenu,
#marketerFilterMenu {
  background: #0b1220 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: 0 10px 35px rgba(0,0,0,0.45);
}

/* Dropdown item */
.autocomplete-item {
  color: #ffffff !important;
  background: transparent !important;
  -webkit-tap-highlight-color: transparent;
}

/* hover / focus / active */
.autocomplete-item:hover,
.autocomplete-item:focus,
.autocomplete-item:active {
  background: rgba(12,175,96,0.20) !important;
  color: #ffffff !important;
}

  @media (min-width: 1280px) {
    .search-input::placeholder {
      opacity: 0.9;
    }
  }

  /* Desktopta sağ alan kaydırılabilir ama scrollbar rahatsız etmesin */
  @media (min-width: 1280px) {
    .xl\:overflow-x-auto::-webkit-scrollbar {
      height: 6px;
    }

    .xl\:overflow-x-auto::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.12);
      border-radius: 999px;
    }

    .xl\:overflow-x-auto::-webkit-scrollbar-track {
      background: transparent;
    }
  }


  @media (max-width: 639px) {
    .search-input::placeholder {
      font-size: 13px;
    }

    #openLeadModalBtn,
    button[onclick="toggleFilters()"] {
      min-width: 0;
    }
  }


  /* Filtre kartı */
  #filtersPanel {
    position: relative;
  }

  


  .filter-input {
    background: #162033 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
    transition: all 0.18s ease;
  }

  .filter-input::placeholder {
    color: rgba(203, 213, 225, 0.72) !important;
    opacity: 1;
  }

  .filter-input:hover {
    background: #1a263d !important;
    border-color: rgba(12, 175, 96, 0.35) !important;
  }

  .filter-input:focus,
  .filter-input:focus-visible {
    background: #1a263d !important;
    color: #ffffff !important;
    border-color: rgba(12, 175, 96, 0.85) !important;
    box-shadow:
      0 0 0 4px rgba(12, 175, 96, 0.10),
      0 10px 30px rgba(12, 175, 96, 0.06) !important;
    outline: none !important;
  }

  /* Yazılmış değer rengi */
  .filter-input:not(:placeholder-shown) {
    color: #ffffff !important;
  }

  /* Date input value görünürlüğü */
  input[type="date"].filter-input {
    color-scheme: dark;
    color: #ffffff !important;
  }

  /* Webkit date metni */
  input[type="date"].filter-input::-webkit-datetime-edit {
    color: #ffffff !important;
  }

  input[type="date"].filter-input::-webkit-datetime-edit-text {
    color: rgba(255,255,255,0.7) !important;
  }

  input[type="date"].filter-input::-webkit-datetime-edit-month-field,
  input[type="date"].filter-input::-webkit-datetime-edit-day-field,
  input[type="date"].filter-input::-webkit-datetime-edit-year-field {
    color: #ffffff !important;
  }

  input[type="date"].filter-input::-webkit-calendar-picker-indicator {
    opacity: 0.9;
    cursor: pointer;
    filter: invert(1);
  }
