/* Custom Styles for LapFlow */

/* Плавні переходи */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Кастомний скролбар */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #090d16;
}
::-webkit-scrollbar-thumb {
  background: #1f2937;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #374151;
}

/* Активні вкладки */
.tab-btn {
  border-radius: 0.75rem;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover {
  background: rgba(30, 41, 59, 0.7);
  color: #f1f5f9;
}

.tab-btn.active {
  color: #60a5fa !important;
  background: rgba(30, 41, 59, 0.95) !important;
  border-color: rgba(59, 130, 246, 0.45) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  font-weight: 600 !important;
}

.tab-btn.active i {
  color: #3b82f6;
}

.mobile-nav-btn.active {
  color: #3b82f6 !important;
  font-weight: 600;
}

/* Статусні бейджі */
.badge-in_transit {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-workshop {
  background-color: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-inventory {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-sold {
  background-color: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-parts {
  background-color: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Анімація появи карток */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.item-card {
  animation: fadeIn 0.2s ease-out forwards;
}

/* ==========================================================================
   СВІТЛА ТЕМА: НІЖНО-РОЖЕВА ЕЛЕГАНТНА ПАЛІТРА (SOFT ROSE & WARM PEARL)
   ========================================================================== */

html.light {
  color-scheme: light;
}

/* Фон сторінки та базовий колір тексту */
html.light body {
  background-color: #fff5f7 !important; /* Ніжний перламутрово-рожевий фон */
  color: #1e1b1e !important; /* Глибокий м'який чорно-сливовий — ідеально читається */
}

/* Шапка сайту */
html.light header {
  background-color: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1px solid #fce1e6 !important;
  box-shadow: 0 2px 12px -2px rgba(225, 29, 72, 0.05) !important;
}

html.light header h1 {
  color: #1e1b1e !important;
}

/* Десктопний таб-бар (Навігація вкладок) */
html.light #desktopTabBar {
  background-color: #f8fafc !important;
  border-top: 1px solid #f1f5f9 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
}

html.light #desktopTabContainer {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

/* Вкладки (Кнопки навігації) */
html.light .tab-btn {
  color: #64748b !important;
  border-radius: 0.75rem !important;
  border: 1px solid transparent !important;
  transition: all 0.18s ease !important;
}

html.light .tab-btn:hover {
  color: #0f172a !important;
  background-color: #f1f5f9 !important;
}

html.light .tab-btn.active {
  color: #2563eb !important;
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12) !important;
  font-weight: 600 !important;
}

/* Мобільна навігація внизу */
html.light #mobileBottomNav {
  background-color: rgba(255, 255, 255, 0.97) !important;
  border-top: 1px solid #fce1e6 !important;
  box-shadow: 0 -4px 16px rgba(225, 29, 72, 0.05) !important;
}

html.light .mobile-nav-btn {
  color: #71697a !important;
}

html.light .mobile-nav-btn.active {
  color: #e11d48 !important;
  font-weight: 600 !important;
}

/* ПОВНЕ ВИКОРІНЕННЯ СІРИХ ФОНІВ: Усі плитки, контейнери та блоки */
html.light [class*="bg-slate-950"],
html.light [class*="bg-slate-900"],
html.light [class*="bg-[#0f172a]"],
html.light [class*="bg-[#111827]"],
html.light [class*="bg-[#0e1424]"],
html.light .item-card {
  background-color: #ffffff !important;
  border-color: #fce1e6 !important;
  box-shadow: 0 4px 14px -2px rgba(225, 29, 72, 0.04), 0 2px 6px -1px rgba(0, 0, 0, 0.02) !important;
  color: #1e1b1e !important;
}

html.light .item-card:hover {
  border-color: #f8b4c4 !important;
  box-shadow: 0 8px 22px -4px rgba(225, 29, 72, 0.08), 0 3px 8px -1px rgba(0, 0, 0, 0.03) !important;
}

/* Внутрішні під-панелі (Характеристики, собівартість, нотатки, банківська карта) */
html.light [class*="bg-slate-800"],
html.light [class*="bg-slate-700"],
html.light .item-card [class*="bg-slate-950"],
html.light .item-card [class*="bg-slate-900"],
html.light .item-card [class*="bg-slate-800"],
html.light .item-card [class*="bg-slate-700"] {
  background-color: #fff1f4 !important;
  border-color: #fcdde3 !important;
}

/* Рамки та розділювачі */
html.light [class*="border-slate-"],
html.light .divide-slate-800 > :not([hidden]) ~ :not([hidden]),
html.light [class*="divide-slate-"] > :not([hidden]) ~ :not([hidden]) {
  border-color: #fce1e6 !important;
}

/* Чіткі та комфортні для очей кольори тексту */
html.light .text-white,
html.light .text-slate-100 {
  color: #1e1b1e !important; /* Глибокий контрастний текст */
}

html.light .text-slate-200,
html.light .text-slate-300 {
  color: #38313d !important; /* Чіткий другорядний текст */
}

html.light .text-slate-400 {
  color: #635b6b !important; /* М'які підписи */
}

html.light .text-slate-500 {
  color: #8c8294 !important; /* Додатковий підпис */
}

/* Глибокі, насичені кольори для статусів та показників, що ідеально читаються на світлому */
html.light .text-emerald-400 {
  color: #059669 !important;
}

html.light .text-teal-400,
html.light .text-teal-300 {
  color: #0d9488 !important;
}

html.light .text-purple-400,
html.light .text-purple-300 {
  color: #9333ea !important;
}

html.light .text-amber-400,
html.light .text-amber-300 {
  color: #d97706 !important;
}

html.light .text-blue-400,
html.light .text-blue-300 {
  color: #2563eb !important;
}

html.light .text-sky-300,
html.light .text-sky-400 {
  color: #0284c7 !important;
}

/* Кнопки швидкого переведення статусів на картках */
html.light .bg-amber-500\/20 {
  background-color: #fef3c7 !important;
  border-color: #fde68a !important;
  color: #b45309 !important;
}
html.light .bg-amber-500\/20:hover {
  background-color: #fde68a !important;
}

html.light .bg-blue-500\/20 {
  background-color: #dbeafe !important;
  border-color: #bfdbfe !important;
  color: #1d4ed8 !important;
}
html.light .bg-blue-500\/20:hover {
  background-color: #bfdbfe !important;
}

html.light .bg-emerald-500\/20 {
  background-color: #d1fae5 !important;
  border-color: #a7f3d0 !important;
  color: #047857 !important;
}
html.light .bg-emerald-500\/20:hover {
  background-color: #a7f3d0 !important;
}

html.light .bg-sky-500\/20 {
  background-color: #e0f2fe !important;
  border-color: #bae6fd !important;
  color: #0369a1 !important;
}
html.light .bg-sky-500\/20:hover {
  background-color: #bae6fd !important;
}

html.light .bg-purple-500\/20,
html.light .bg-purple-500\/10 {
  background-color: #fce7f3 !important;
  border-color: #fbcfe8 !important;
  color: #9d174d !important;
}

html.light .bg-teal-500\/20,
html.light .bg-teal-500\/10 {
  background-color: #ccfbf1 !important;
  border-color: #99f6e4 !important;
  color: #0f766e !important;
}

/* Віджети в шапці (Курс валют, аватар користувача, перемикач теми) */
html.light #btnThemeToggle,
html.light #userProfileBadge,
html.light header .bg-slate-900 {
  background-color: #fff1f4 !important;
  border-color: #fce1e6 !important;
  color: #1e1b1e !important;
}

html.light #btnThemeToggle:hover,
html.light #userProfileBadge:hover {
  background-color: #ffe4ea !important;
  border-color: #f8b4c4 !important;
}

/* Головні кнопки дії (Акцентні) */
html.light button.bg-blue-600 {
  background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25) !important;
  color: #ffffff !important;
}

html.light button.bg-blue-600:hover {
  background: linear-gradient(135deg, #e11d48, #be123c) !important;
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.35) !important;
}

/* Поля вводу, селекти та форми */
html.light input,
html.light select,
html.light textarea {
  background-color: #ffffff !important;
  border: 1px solid #fce1e6 !important;
  color: #1e1b1e !important;
  box-shadow: inset 0 1px 2px rgba(225, 29, 72, 0.02) !important;
}

html.light input:focus,
html.light select:focus,
html.light textarea:focus {
  border-color: #f43f5e !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15) !important;
  outline: none !important;
}

html.light input::placeholder,
html.light textarea::placeholder {
  color: #a89fae !important;
}

/* Модальні вікна */
html.light .fixed.inset-0.bg-black\/80,
html.light .fixed.inset-0.bg-black\/70,
html.light .fixed.inset-0.bg-black\/60 {
  background-color: rgba(30, 27, 30, 0.45) !important;
  backdrop-filter: blur(5px);
}

html.light #loginModal .bg-slate-900,
html.light #itemModal .bg-slate-900,
html.light #rateModal .bg-slate-900,
html.light #agentModal .bg-slate-900,
html.light #dropModal .bg-slate-900,
html.light #bulkStatusModal .bg-slate-900,
html.light #olxExportModal .bg-slate-900 {
  background-color: #ffffff !important;
  border: 1px solid #fce1e6 !important;
  box-shadow: 0 24px 48px -12px rgba(225, 29, 72, 0.12), 0 8px 16px -4px rgba(0, 0, 0, 0.05) !important;
}

/* Таблиці */
html.light table {
  color: #1e1b1e !important;
  background-color: #ffffff !important;
}

html.light thead,
html.light table th {
  background-color: #fff1f4 !important;
  color: #574e5e !important;
  border-color: #fce1e6 !important;
  font-weight: 600 !important;
}

html.light tbody tr {
  border-color: #fce1e6 !important;
}

html.light tbody tr:hover td {
  background-color: #fff7f9 !important;
}

html.light table td {
  border-color: #fce1e6 !important;
  color: #1e1b1e !important;
}

/* Степер етапів логістики */
html.light .absolute.left-3.right-3.top-2\.5.h-0\.5.bg-slate-800 {
  background-color: #fce1e6 !important;
}

html.light .bg-slate-900.text-slate-600 {
  background-color: #fff1f4 !important;
  color: #a89fae !important;
  border-color: #fcdde3 !important;
}

/* Чіпи характеристик (CPU, RAM, SSD, АКБ), код товару та службові пігулки */
html.light span[class*="bg-slate-800"],
html.light span[class*="bg-slate-900"],
html.light span[class*="bg-slate-700"],
html.light .font-mono[class*="bg-slate-"] {
  background-color: #ffe4ea !important;
  color: #9d174d !important;
  border: 1px solid #fcdde3 !important;
}

/* Фільтри (Quick Filter Chips) та посилання */
html.light button[class*="bg-slate-800"],
html.light button[class*="bg-slate-700"],
html.light a[class*="bg-slate-800"],
html.light a[class*="bg-slate-700"] {
  background-color: #ffffff !important;
  color: #574e5e !important;
  border: 1px solid #fce1e6 !important;
}

html.light button[class*="bg-slate-800"]:hover,
html.light button[class*="bg-slate-700"]:hover,
html.light a[class*="bg-slate-800"]:hover,
html.light a[class*="bg-slate-700"]:hover {
  background-color: #fff1f4 !important;
  color: #e11d48 !important;
  border-color: #fcdde3 !important;
}

/* Службові кнопки карток (Редагувати тощо) */
html.light button[onclick*="editItem"],
html.light button[onclick*="editAgent"],
html.light button[onclick*="editDrop"] {
  background-color: #fff1f4 !important;
  border: 1px solid #fce1e6 !important;
  color: #635b6b !important;
}

html.light button[onclick*="editItem"]:hover,
html.light button[onclick*="editAgent"]:hover,
html.light button[onclick*="editDrop"]:hover {
  background-color: #ffe4ea !important;
  border-color: #f8b4c4 !important;
  color: #e11d48 !important;
}

/* Контейнери перемикача режимів перегляду (Картки / Таблиця) */
html.light div.flex.items-center[class*="bg-slate-800"] {
  background-color: #fff1f4 !important;
  border: 1px solid #fce1e6 !important;
}

html.light #viewBtnCards_transit:not(.bg-blue-600),
html.light #viewBtnTable_transit:not(.bg-blue-600),
html.light #viewBtnCards_warehouse:not(.bg-blue-600),
html.light #viewBtnTable_warehouse:not(.bg-blue-600),
html.light #viewBtnCards_sale:not(.bg-blue-600),
html.light #viewBtnTable_sale:not(.bg-blue-600) {
  color: #71697a !important;
}

/* Прогрес-бари лімітів та треків */
html.light [class*="bg-slate-800/90"],
html.light div[class*="rounded-full"][class*="bg-slate-800"] {
  background-color: #fce1e6 !important;
  border-color: #f8b4c4 !important;
}

/* Чекбокси */
html.light input[type="checkbox"] {
  background-color: #ffffff !important;
  border: 1px solid #f8b4c4 !important;
  accent-color: #e11d48 !important;
}

/* Статусні бейджі у світлій темі */
html.light .badge-in_transit {
  background-color: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
}

html.light .badge-workshop {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}

html.light .badge-inventory {
  background-color: #d1fae5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
}

html.light .badge-sold {
  background-color: #fce7f3 !important;
  color: #9d174d !important;
  border: 1px solid #fbcfe8 !important;
}

html.light .badge-parts {
  background-color: #fff1f4 !important;
  color: #635b6b !important;
  border: 1px solid #fce1e6 !important;
}

/* Скролбар для світлої теми */
html.light ::-webkit-scrollbar-track {
  background: #fff5f7;
}

html.light ::-webkit-scrollbar-thumb {
  background: #f8c1ce;
  border-radius: 4px;
}

html.light ::-webkit-scrollbar-thumb:hover {
  background: #f43f5e;
}

/* scrapAI адаптація для світлої теми */
html.light #btnHeaderScrapAI {
  background: #fce1e6 !important;
  border-color: #f472b6 !important;
}

html.light #btnHeaderScrapAI span {
  color: #831843 !important;
}

html.light #tab-scrapai .bg-slate-950\/40 {
  background-color: #ffffff !important;
  border-color: #fce1e6 !important;
}

html.light #scrapAiLiveLog {
  background-color: #fff1f4 !important;
  color: #831843 !important;
  border-color: #f8b4c4 !important;
}

/* ==========================================================================
   МОБІЛЬНА АДАПТАЦІЯ (SMARTPHONE & TOUCH UX)
   ========================================================================== */

/* Запобігання горизонтальному зміщенню екрана на телефонах */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

/* Безпечні відступи для сучасних смартфонів (iPhone Notch & Home Indicator) */
#mobileBottomNav {
  padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
}

body {
  padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

/* Запобігання небажаному автозуму Safari на iOS при натисканні на інпути */
@media (max-width: 640px) {
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Покращений комфорт модальних вікон на малих екранах */
  #itemModal > div,
  #sellModal > div,
  #agentModal > div,
  #dropModal > div,
  #rateModal > div {
    max-height: 90vh;
    border-radius: 1.25rem;
  }
}

/* Стилізація висувного мобільного меню "Більше" для світлої теми */
html.light #mobileMoreSheet > div {
  background-color: #ffffff !important;
  border-top-color: #fce1e6 !important;
  box-shadow: 0 -10px 25px -5px rgba(225, 29, 72, 0.08) !important;
}

html.light #mobileMoreSheet button {
  background-color: #fff1f4 !important;
  border-color: #fce1e6 !important;
  color: #1e1b1e !important;
}

html.light #mobileMoreSheet button:hover {
  background-color: #fce1e6 !important;
}

html.light #mobileMoreSheet .text-white {
  color: #1e1b1e !important;
}

html.light #mobileMoreSheet .text-slate-300,
html.light #mobileMoreSheet .text-slate-400 {
  color: #635b6b !important;
}

