/* ==========================================================================
   Rang Mitra Painting — Global Design System (style.css)
   Modern SaaS painting-services website
   Contains: CSS variables (design tokens), reset/base, layout, typography,
   buttons, section headers, filter pills, horizontal scroll rows, utilities.
   No inline CSS/JS anywhere — everything is class-driven & reusable.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens (CSS Custom Properties)
   -------------------------------------------------------------------------- */
:root {
  /* Brand colours */
  --color-primary: #6C4CF1;        /* Purple  */
  --color-primary-dark: #5638d6;
  --color-primary-light: #8a72f6;
  --color-secondary: #4F9CF9;      /* Blue    */
  --color-accent: #22C55E;         /* Green   */

  /* Surfaces & text */
  --color-bg: #F8F9FC;             /* App background        */
  --color-surface: #FFFFFF;        /* Cards / panels        */
  --color-text: #1F2937;           /* Primary text          */
  --color-text-muted: #6B7280;     /* Secondary text        */
  --color-border: #ECEAF4;         /* Hairline borders      */

  /* Hero gradient stops (peach -> lavender, matching reference) */
  --hero-from: #FCEFE6;
  --hero-to:   #EFE8FB;

  /* Effects */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(31, 41, 55, 0.05);
  --shadow-sm: 0 4px 12px rgba(31, 41, 55, 0.06);
  --shadow-md: 0 10px 30px rgba(108, 76, 241, 0.10);
  --shadow-lg: 0 20px 50px rgba(31, 41, 55, 0.12);

  --gradient-brand: linear-gradient(135deg, var(--color-primary), var(--color-secondary));

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Layout */
  --container-max: 1120px;
  --nav-height: 76px;
  --bottom-nav-height: 70px;

  /* Typography */
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.28s var(--ease);
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* room for the fixed bottom nav on mobile */
  padding-bottom: 0;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

input, select, textarea { font-family: inherit; font-size: 1rem; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; color: var(--color-text); }

:focus-visible {
  outline: 3px solid rgba(108, 76, 241, 0.4);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.section { padding-block: var(--space-6); }

/* A white rounded panel that wraps each home-page section (matches reference) */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
}

.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --------------------------------------------------------------------------
   4. Section headers (icon + title + subtitle + "View All")
   -------------------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.section-head__main { display: flex; align-items: flex-start; gap: var(--space-3); }

.section-head__icon {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(108, 76, 241, 0.10);
  color: var(--color-primary);
}
.section-head__icon svg { width: 20px; height: 20px; }

.section-head__title { font-size: 1.4rem; }
.section-head__subtitle { color: var(--color-text-muted); font-size: 0.95rem; }

.view-all {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: gap var(--transition);
}
.view-all:hover { gap: 8px; }
.view-all svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-2px); }

.btn-secondary { background: var(--color-secondary); color: #fff; }
.btn-secondary:hover { filter: brightness(0.96); transform: translateY(-2px); }

.btn-outline {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); transform: translateY(-2px); }

.btn-ghost { background: transparent; color: var(--color-primary); }
.btn-ghost:hover { background: rgba(108, 76, 241, 0.08); }

.btn-lg { padding: 15px 30px; font-size: 1rem; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------------------
   6. Filter pills (All / Living Room / ...)
   -------------------------------------------------------------------------- */
.filter-row {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-4);
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }

.pill {
  flex: none;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
}
.pill:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pill.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* --------------------------------------------------------------------------
   7. Horizontal scroll row + floating arrow control
   -------------------------------------------------------------------------- */
.scroller { position: relative; }

.scroll-row {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 4px var(--space-3);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row > * { scroll-snap-align: start; }

.scroll-arrow {
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  color: var(--color-text);
  z-index: 3;
  transition: transform var(--transition), background var(--transition), color var(--transition);
}
.scroll-arrow:hover { background: var(--color-primary); color: #fff; transform: translateY(-50%) scale(1.08); }
.scroll-arrow svg { width: 20px; height: 20px; }
.scroll-arrow--left { left: -6px; right: auto; }

/* --------------------------------------------------------------------------
   8. Glassmorphism utility
   -------------------------------------------------------------------------- */
.glass {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* --------------------------------------------------------------------------
   9. Utilities
   -------------------------------------------------------------------------- */
.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Reveal-on-scroll animation (toggled by main.js) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Back-to-top button (injected by main.js on every public page) */
.to-top {
  position: fixed; left: 20px; bottom: 90px; z-index: 140;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  display: grid; place-items: center; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition), background var(--transition);
}
.to-top.is-show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--color-primary-dark); }
.to-top svg { width: 22px; height: 22px; }
@media (min-width: 769px) { .to-top { left: 24px; bottom: 24px; } }

/* --------------------------------------------------------------------------
   Copy deterrent (public site only — see components/CopyGuard.js)
   Form fields stay selectable so visitors can still fill in the booking form.
   -------------------------------------------------------------------------- */
body.no-copy {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body.no-copy input,
body.no-copy textarea,
body.no-copy select,
body.no-copy [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
body.no-copy img { -webkit-user-drag: none; user-drag: none; pointer-events: none; }
