/* ============================================================
   i-Squill — Custom Theme & Animations (Style 1)
   Palette: Blue (#2563EB) + Orange (#F97316)
   Tailwind handles layout; this file adds theming & motion.
   ============================================================ */

:root {
  /* Brand colors — driven by the Customizer (js/theme.js). */
  --brand-blue: #2563eb;
  --brand-blue-dark: #1e40af;
  --brand-orange: #0ea5e9;
  --brand-orange-dark: #0284c7;

  /* RGB channels so Tailwind alpha utilities (bg-brand-blue/20) theme too. */
  --brand-blue-rgb: 37 99 235;
  --brand-bluedark-rgb: 30 64 175;
  --brand-orange-rgb: 14 165 233;
  --brand-orangedark-rgb: 2 132 199;

  --ink: #0f172a;
  --muted: #64748b;

  /* Layout-template tokens — overridden by body[data-layout]. */
  --radius-card: 1.25rem;
  --radius-btn: 9999px;
  --radius-field: 0.75rem;
  --card-border: 1px solid #eef2f7;
  --card-shadow: 0 24px 40px -24px rgba(15, 23, 42, .35);
  --card-lift: -6px;
  --heading-family: 'Inter', system-ui, sans-serif;
  --heading-transform: none;
  --heading-spacing: normal;
}

/* ============================================================
   Layout templates (selectable in the Customizer)
   ============================================================ */
body[data-layout="soft"] {
  --radius-card: 1.9rem;
  --radius-field: 1rem;
  --card-border: 1px solid #f1f5f9;
  --card-shadow: 0 34px 60px -28px rgba(15, 23, 42, .42);
  --card-lift: -10px;
}
body[data-layout="sharp"] {
  --radius-card: 0.25rem;
  --radius-btn: 0.4rem;
  --radius-field: 0.4rem;
  --card-border: 1.5px solid #e2e8f0;
  --card-shadow: 0 14px 28px -22px rgba(15, 23, 42, .5);
  --card-lift: -3px;
  --heading-transform: uppercase;
  --heading-spacing: 0.04em;
}
body[data-layout="editorial"] {
  --radius-card: 0.85rem;
  --radius-btn: 0.6rem;
  --radius-field: 0.6rem;
  --card-border: 1px solid #e7e2d9;
  --card-shadow: 0 20px 36px -26px rgba(15, 23, 42, .3);
  --card-lift: -5px;
  --heading-family: 'Inter', system-ui, sans-serif;
  --heading-spacing: -0.01em;
}

* {
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
}

h1, h2, h3, h4, .font-display {
  font-family: var(--heading-family);
}
.font-display {
  text-transform: var(--heading-transform);
  letter-spacing: var(--heading-spacing);
}

/* ---------- Brand gradient helpers ---------- */
.bg-brand-gradient {
  background-image: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
}
.bg-hero-gradient {
  background-image:
    radial-gradient(1200px 600px at 100% 0%, rgb(var(--brand-orange-rgb) / .18), transparent 60%),
    radial-gradient(900px 500px at 0% 100%, rgb(var(--brand-blue-rgb) / .18), transparent 55%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
}
.text-gradient {
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  padding: .75rem 1.5rem;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
  cursor: pointer;
}
.btn-primary {
  background: var(--brand-orange);
  color: #fff;
  box-shadow: 0 10px 20px -8px rgb(var(--brand-orange-rgb) / .6);
}
.btn-primary:hover {
  background: var(--brand-orange-dark);
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -10px rgb(var(--brand-orange-rgb) / .7);
}
.btn-secondary {
  background: #fff;
  color: var(--brand-blue);
  border: 2px solid rgb(var(--brand-blue-rgb) / .25);
}
.btn-secondary:hover {
  border-color: var(--brand-blue);
  transform: translateY(-2px);
}
.btn-ghost {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, .24);
  transform: translateY(-2px);
}

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: var(--card-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
  transform: translateY(var(--card-lift));
  box-shadow: var(--card-shadow);
  border-color: rgb(var(--brand-blue-rgb) / .25);
}
.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform .5s ease;
}
.card:hover .card-img {
  transform: scale(1.06);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Floating hero art ---------- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.animate-float { animation: float 5s ease-in-out infinite; }
.animate-float-slow { animation: float 7s ease-in-out infinite; }

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgb(var(--brand-orange-rgb) / .45); }
  100% { box-shadow: 0 0 0 22px rgb(var(--brand-orange-rgb) / 0); }
}
.pulse-ring { animation: pulse-ring 2.2s infinite; }

/* ---------- Testimonials carousel ---------- */
.carousel-track {
  display: flex;
  transition: transform .55s cubic-bezier(.22, 1, .36, 1);
}
.carousel-slide {
  min-width: 100%;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  .carousel-slide { min-width: 50%; }
}
@media (min-width: 1024px) {
  .carousel-slide { min-width: 33.3333%; }
}

/* ---------- Navbar shadow on scroll ---------- */
.nav-scrolled {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px -16px rgba(15, 23, 42, .4);
}

/* ---------- Badge / chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .7rem;
  border-radius: 9999px;
  background: rgb(var(--brand-blue-rgb) / .1);
  color: var(--brand-blue);
}
.chip-orange {
  background: rgb(var(--brand-orange-rgb) / .12);
  color: var(--brand-orange-dark);
}

/* ---------- Admin tables ---------- */
.admin-table th {
  text-align: left;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .75rem 1rem;
}
.admin-table td {
  padding: .85rem 1rem;
  border-top: 1px solid #f1f5f9;
  vertical-align: middle;
}
.admin-table tbody tr:hover {
  background: #f8fafc;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 60;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  background: #fff;
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: pop .25s ease;
}
@keyframes pop {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Toast ---------- */
#toast-wrap {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 80;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: .75rem 1.1rem;
  border-radius: .75rem;
  font-size: .875rem;
  box-shadow: 0 16px 30px -16px rgba(0, 0, 0, .6);
  animation: pop .2s ease;
}
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }

/* ---------- Form inputs ---------- */
.field {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-field);
  padding: .7rem .9rem;
  font-size: .95rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgb(var(--brand-blue-rgb) / .12);
}
.label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: .35rem;
}

/* ---------- Utilities ---------- */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ============================================================
   Customizer (theme + layout switcher) — built by js/theme.js
   ============================================================ */
.cz-toggle {
  position: fixed;
  left: 1.1rem;
  bottom: 1.1rem;
  z-index: 90;
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  background: var(--brand-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 14px 28px -10px rgb(var(--brand-blue-rgb) / .7);
  cursor: pointer;
  border: none;
  transition: transform .2s ease;
}
.cz-toggle:hover { transform: rotate(45deg) scale(1.05); }

.cz-panel {
  position: fixed;
  left: 1.1rem;
  bottom: 5rem;
  z-index: 91;
  width: 320px;
  max-width: calc(100vw - 2.2rem);
  max-height: 78vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e9eef5;
  border-radius: 1.1rem;
  box-shadow: 0 30px 60px -24px rgba(15, 23, 42, .5);
  padding: 1.1rem;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.cz-panel.open { opacity: 1; transform: none; pointer-events: auto; }

.cz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .25rem;
}
.cz-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1.05rem; }
.cz-sub { font-size: .72rem; color: var(--muted); margin-bottom: 1rem; }
.cz-x { background: none; border: none; font-size: 1.4rem; line-height: 1; color: #94a3b8; cursor: pointer; }

.cz-section-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  color: #94a3b8;
  margin: 1.1rem 0 .6rem;
}
.cz-section-label:first-of-type { margin-top: .25rem; }

.cz-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.cz-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: .5rem .25rem;
  border: 1.5px solid #eef2f7;
  border-radius: .75rem;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.cz-swatch:hover { transform: translateY(-2px); }
.cz-swatch.active { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgb(var(--brand-blue-rgb) / .12); }
.cz-dot {
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.cz-swatch span { font-size: .62rem; color: #64748b; text-align: center; line-height: 1.1; }

.cz-custom { display: flex; gap: .6rem; }
.cz-custom label { flex: 1; font-size: .72rem; font-weight: 600; color: #475569; }
.cz-color {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: .25rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: .6rem;
  background: none;
  cursor: pointer;
}

.cz-layouts { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; }
.cz-layout {
  text-align: left;
  padding: .6rem .7rem;
  border: 1.5px solid #eef2f7;
  border-radius: .75rem;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.cz-layout:hover { transform: translateY(-2px); }
.cz-layout.active { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgb(var(--brand-blue-rgb) / .12); }
.cz-layout strong { display: block; font-size: .82rem; color: #1e293b; }
.cz-layout small { font-size: .66rem; color: #94a3b8; }

.cz-reset {
  width: 100%;
  margin-top: 1.1rem;
  padding: .6rem;
  font-size: .8rem;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .7rem;
  cursor: pointer;
}
.cz-reset:hover { background: #f1f5f9; color: #334155; }
