/* ============================================================
   Avlu Collections — Custom Styles
   Glassmorphism, animations, and design system overrides
   ============================================================ */

/* ============================================================
   Theme Variables — Light (default) & Dark
   Brand palette: warm earth tones from PDF branding
   ============================================================ */
:root {
  /* Light Theme — warm cream base + earthy-blue accents */
  --hero-brightness: 0.55;
  --c-surface-bright: 248 236 215;
  --c-on-primary-container: 58 15 0;
  --c-secondary: 111 100 98;
  --c-secondary-container: 243 228 206;
  --c-on-background: 28 27 27;
  --c-surface: 247 234 212;
  --c-on-primary: 255 255 255;
  --c-on-secondary: 255 255 255;
  --c-background: 247 233 210;
  --c-error: 186 26 26;
  --c-error-container: 250 228 214;
  --c-surface-container-lowest: 248 236 216;
  --c-surface-variant: 244 232 212;
  --c-on-surface-variant: 91 65 56;
  --c-surface-container: 242 230 210;
  --c-primary-container: 255 95 31;
  --c-surface-container-highest: 236 224 204;
  --c-surface-container-low: 246 234 214;
  --c-tertiary: 37 82 148;
  --c-tertiary-container: 230 234 242;
  --c-on-tertiary: 255 255 255;
  --c-on-tertiary-container: 12 40 78;
  --c-primary: 184 77 26;
  --c-outline-variant: 220 206 190;
  --c-surface-container-high: 239 227 208;
  --c-on-surface: 28 27 27;
  --c-outline: 139 112 104;
  --c-inverse-surface: 53 53 52;
}

:root.dark {
  /* Dark Theme — original */
  --hero-brightness: 0.4;
  --c-surface-bright: 58 57 57;
  --c-on-primary-container: 86 23 0;
  --c-secondary: 200 198 197;
  --c-secondary-container: 74 73 73;
  --c-on-background: 229 226 225;
  --c-surface: 19 19 19;
  --c-on-primary: 92 25 0;
  --c-on-secondary: 49 48 48;
  --c-background: 19 19 19;
  --c-error: 255 180 171;
  --c-error-container: 147 0 10;
  --c-surface-container-lowest: 14 14 14;
  --c-surface-variant: 53 53 52;
  --c-on-surface-variant: 227 191 179;
  --c-surface-container: 32 31 31;
  --c-primary-container: 255 95 31;
  --c-surface-container-highest: 53 53 52;
  --c-surface-container-low: 28 27 27;
  --c-tertiary: 255 181 156;
  --c-tertiary-container: 255 95 31;
  --c-on-tertiary: 92 25 0;
  --c-on-tertiary-container: 255 219 198;
  --c-primary: 255 181 156;
  --c-outline-variant: 91 65 56;
  --c-surface-container-high: 42 42 42;
  --c-on-surface: 229 226 225;
  --c-outline: 170 137 127;
  --c-inverse-surface: 229 226 225;
}

/* ---- Glassmorphism Panels ---- */
.glass-panel {
  background: rgba(var(--c-surface-variant), 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(var(--c-outline-variant), 0.1);
}

.glass-chip {
  background: rgba(var(--c-surface-variant), 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ---- Material Symbols ---- */
.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* ---- Navbar ---- */
#navbar {
  background: transparent;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, padding 0.3s ease;
}

#navbar.navbar-scrolled {
  background: rgba(var(--c-surface-container), 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(var(--c-outline-variant), 0.08);
}

.nav-link.active {
  color: rgb(var(--c-tertiary));
  border-bottom: 1px solid rgb(var(--c-tertiary));
  padding-bottom: 2px;
}

/* ---- Hero Background ---- */
.hero-bg {
  background-image: url("images/hero-bg.jpg");
  background-size: cover;
  background-position: center;
  filter: brightness(var(--hero-brightness, 0.4)) saturate(0.8);
}

/* ---- Scroll Animations ---- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

/* ---- Hide Scrollbar (horizontal showcase) ---- */
.hide-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ---- Showcase Cards ---- */
.showcase-card {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-card:hover {
  transform: translateY(-4px);
}

#showcase-track {
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

#showcase-track:active {
  cursor: grabbing;
}

/* ---- Form Error State ---- */
.border-error {
  border-color: rgb(var(--c-error)) !important;
}

/* ---- Selection ---- */
::selection {
  background: rgb(var(--c-tertiary-container));
  color: rgb(var(--c-on-tertiary-container));
}

/* ---- Custom Scrollbar (body) ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgb(var(--c-background));
}

::-webkit-scrollbar-thumb {
  background: rgb(var(--c-tertiary-container));
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--c-tertiary));
}

/* ---- Focus Styles (Accessibility) ---- */
*:focus-visible {
  outline: 2px solid rgb(var(--c-tertiary));
  outline-offset: 2px;
}

/* ---- Smooth scrolling ---- */
html {
  scroll-behavior: smooth;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}

/* ---- Mobile adjustments ---- */
@media (max-width: 768px) {
  .hero-bg {
    background-position: 60% center;
  }
}

/* ---- Loading animation for images ---- */
.showcase-card img,
.model-card img {
  background-color: rgb(var(--c-surface-container-high));
}

/* ---- Form Inputs (contact / quote forms) ---- */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  /* Light-theme default: subtle dark pocket */
  background-color: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  color: rgb(var(--c-on-surface));
  font-size: 0.95rem;
  line-height: 1.4;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

:root.dark .form-input,
:root.dark .form-select,
:root.dark .form-textarea {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.20);
}

.form-textarea {
  resize: vertical;
  min-height: 7rem;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(var(--c-on-surface), 0.45);
  text-transform: none;
  letter-spacing: 0;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  background-color: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.18);
}

:root.dark .form-input:hover,
:root.dark .form-select:hover,
:root.dark .form-textarea:hover {
  background-color: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgb(var(--c-tertiary));
  box-shadow: 0 0 0 3px rgba(var(--c-tertiary), 0.20), inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-textarea:-webkit-autofill {
  -webkit-text-fill-color: rgb(var(--c-on-surface));
  -webkit-box-shadow: 0 0 0 1000px rgb(var(--c-surface-container-high)) inset;
  transition: background-color 5000s ease-in-out 0s;
}

.form-select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3e%3cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 111.08 1.04l-4.25 4.39a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 1.25rem;
  padding-right: 2.75rem;
  cursor: pointer;
}

.form-select option {
  background-color: rgb(var(--c-surface-container));
  color: rgb(var(--c-on-surface));
}

.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: rgb(var(--c-error));
  box-shadow: 0 0 0 3px rgba(var(--c-error), 0.15);
}

.form-label {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgb(var(--c-on-surface-variant));
  margin-bottom: 0.5rem;
}

.form-label .req {
  color: rgb(var(--c-tertiary));
  margin-left: 0.15rem;
}

/* ---- Filter Tabs (modeller.html) ---- */
.filter-tab {
  color: rgb(var(--c-on-surface-variant));
  background: transparent;
  border: 1px solid rgba(var(--c-outline-variant), 0.15);
  cursor: pointer;
  white-space: nowrap;
}

.filter-tab:hover {
  color: rgb(var(--c-tertiary));
  border-color: rgba(var(--c-tertiary), 0.3);
}

.filter-tab.active {
  background: linear-gradient(135deg, rgb(var(--c-tertiary)), rgb(var(--c-tertiary-container)));
  color: rgb(var(--c-on-tertiary));
  border-color: transparent;
  font-weight: 600;
}

/* ---- Model Cards ---- */
.model-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s ease;
}

.model-card:hover {
  transform: translateY(-4px);
}

/* ---- FAQ Accordion ---- */
.faq-trigger {
  cursor: pointer;
}

.faq-trigger:hover {
  background: rgba(var(--c-surface-variant), 0.3);
}

.faq-icon {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-content {
  animation: faqSlideDown 0.3s ease;
}

@keyframes faqSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Page Transition ---- */
#page-transition {
  pointer-events: none;
}

/* ---- WhatsApp Floating Button ---- */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  width: 3.5rem;
  height: 3.5rem;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.35);
  transition: transform 0.3s ease;
}

.whatsapp-float:hover {
  transform: scale(1.1);
}

.whatsapp-float:active {
  transform: scale(0.95);
}

/* ---- Lightbox ---- */
#lightbox {
  transition: opacity 0.3s ease;
}

#lightbox img {
  transition: opacity 0.2s ease;
}

[data-gallery] img {
  cursor: zoom-in;
}
