/* ─── Kiwify CRM PRO — Custom Styles ─── */
/* Tailwind handles most styling; this file covers custom utilities */

body { font-family: 'Inter', sans-serif; background-color: #111319; margin: 0; }
.font-manrope, .font-headline { font-family: 'Manrope', sans-serif; }

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  font-size: 24px;
}

/* Gradient */
.signature-gradient { background: linear-gradient(135deg, #6c5ce7 0%, #c6bfff 100%); }

/* Glass — Obsidian Blueprint: Glassmorphism for floating elements */
.glass-effect, .glass-panel { background: rgba(26, 29, 39, 0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* Ghost Border — Obsidian Blueprint: never use 100% opacity borders */
.ghost-border { border: 1px solid rgba(146, 142, 160, 0.15); }

/* Ambient Shadow — for floating modals/popovers (Obsidian Blueprint §4) */
.ambient-shadow { box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); }

/* Kanban Card — used in lead/photo kanban */
.kanban-card { background: #282a30; border: 1px solid rgba(255, 255, 255, 0.05); transition: all 0.2s ease; }
.kanban-card:hover { border-color: rgba(108, 92, 231, 0.3); transform: translateY(-1px); }
.kanban-card:active { transform: scale(1.02); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 8px; }
::-webkit-scrollbar-track { background: #111319; }
::-webkit-scrollbar-thumb { background: #33343b; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #474554; }
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Sidebar Nav Links */
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: #c8c4d7;
  border-radius: 12px;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border-left: 4px solid transparent;
}
.nav-link:hover { color: #fff; background: #282a30; }
.nav-link.active {
  background: #33343b;
  color: #fff;
  border-left-color: #c6bfff;
  border-radius: 0 12px 12px 0;
}
.nav-link .material-symbols-outlined { font-size: 20px; }

/* Sidebar Collapsible Groups */
.sidebar-group { margin-top: 8px; }
.sidebar-group-header { cursor: pointer; user-select: none; }
.sidebar-group.collapsed .sidebar-group-body { display: none; }
.sidebar-group.collapsed .sidebar-chevron { transform: rotate(-90deg); }

/* Sidebar Product Accordion */
.sidebar-product { margin-bottom: 4px; }
.sidebar-product-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 12px;
  color: #c8c4d7;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  font-family: 'Manrope', sans-serif;
}
.sidebar-product-header:hover { color: #fff; background: #282a30; }
.sidebar-product-header .product-chevron { margin-left: auto; transition: transform 0.2s; font-size: 16px; }
.sidebar-product.expanded .product-chevron { transform: rotate(90deg); }
.sidebar-product-body { display: none; padding-left: 8px; margin-top: 4px; }
.sidebar-product.expanded .sidebar-product-body { display: block; }
.sidebar-product-body .nav-link {
  padding: 6px 12px;
  font-size: 12px;
  border-left-width: 2px;
}

/* WhatsApp glow */
.whatsapp-glow { box-shadow: 0 0 0 2px #25d366; }

/* Kanban drag-over */
.kanban-col-over { border-color: #6c5ce7 !important; box-shadow: 0 0 0 2px rgba(108,92,231,0.3); }

/* Spinner */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #33343b;
  border-top-color: #6c5ce7;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Pulse animation for status dots */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }

/* QR code glow */
.qr-glow { box-shadow: 0 0 50px rgba(108,92,231,0.2); }

/* Modal active state */
#modal-overlay.active { display: flex !important; }

/* Kanban board horizontal scroll */
.kanban-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 260px);
}
.kanban-scroll::-webkit-scrollbar { height: 8px; }

/* Chat layout */
.chat-grid {
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  height: calc(100vh - 84px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}

/* Chat tabs */
.chat-tab { padding: 6px 14px; font-size: 12px; font-weight: 700; border-radius: 9999px; cursor: pointer; transition: all 0.15s; }
.chat-tab.active { background: #6c5ce7; color: #faf6ff; }
.chat-tab:not(.active) { background: transparent; color: #c8c4d7; }
.chat-tab:not(.active):hover { background: #33343b; color: #fff; }

/* Input tabs */
.input-tab { padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; color: #c8c4d7; }
.input-tab.active { color: #c6bfff; border-bottom-color: #6c5ce7; }

/* Toggle switch */
.toggle-switch { position: relative; width: 40px; height: 22px; border-radius: 11px; cursor: pointer; transition: background 0.2s; }
.toggle-switch::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: transform 0.2s; }
.toggle-switch.on { background: #25d366; }
.toggle-switch.on::after { transform: translateX(18px); }
.toggle-switch.off { background: #474554; }

/* Message bubbles */
.msg-in {
  background: #232733;
  border-radius: 4px 16px 16px 16px;
}
.msg-out {
  background: #6c5ce7;
  border-radius: 16px 4px 16px 16px;
}

/* Photo kanban completed column */
.col-completed { background: rgba(37,211,102,0.05); border-radius: 16px; }
.col-lost { filter: grayscale(1); opacity: 0.5; transition: all 0.3s; }
.col-lost:hover { filter: none; opacity: 1; }

/* Responsive */
@media (max-width: 1024px) {
  .chat-grid { grid-template-columns: 280px 1fr; }
  .chat-sidebar-right { display: none; }
}
@media (max-width: 768px) {
  aside { display: none !important; }
  main { margin-left: 0 !important; }
  .chat-grid { grid-template-columns: 1fr; }
  .chat-sidebar-right { display: none; }
}
