/* ============================================================
   Framekozijn - Custom Styles
   Supplements Tailwind CSS with animations and effects
   that cannot be achieved with utility classes alone.
   ============================================================ */

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --green: #114933;
  --green-dark: #0a2e20;
  --green-light: #1a6b4a;
  --gold: #e3cca0;
  --gold-light: #f0e0c0;
  --gold-dark: #c4a870;
  --cream: #faf6ef;
  --cream-dark: #f0e8d8;
  --white: #ffffff;
  --black: #0a0a0a;
  --gray: #6b6b6b;
  --gray-light: #e8e8e8;
}

/* ── Container (theme standard) ───────────────────────── */
.container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 40px;
}
@media (max-width: 768px) {
  .container { padding: 0 20px; }
}

/* ── Base / Reset Additions ────────────────────────────── */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Custom Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--cream);
}

::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green-dark);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--green) var(--cream);
}

/* ── Keyframe Animations ───────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes heroZoom {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(227, 204, 160, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(227, 204, 160, 0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Scroll Reveal System ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ── Navigation Scroll State ───────────────────────────── */
.nav-main {
  transition: all 0.5s var(--ease);
}

.nav-main.scrolled {
  background: rgba(10, 46, 32, 0.97) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-main.scrolled .nav-inner-wrap {
  height: 70px !important;
}

/* ── Hero Background ───────────────────────────────────── */
.hero-bg-gradient {
  background: linear-gradient(180deg,
    rgba(10, 46, 32, 0.15) 0%,
    rgba(10, 46, 32, 0.5) 50%,
    rgba(10, 46, 32, 0.92) 100%
  );
}

.hero-bg-image {
  animation: heroZoom 20s var(--ease) forwards;
}

/* Architectural grid overlay */
.hero-grid-overlay {
  background:
    linear-gradient(90deg, rgba(227, 204, 160, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(227, 204, 160, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* Hero entry animations */
.hero-animate-1 {
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.3s forwards;
}
.hero-animate-2 {
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.5s forwards;
}
.hero-animate-3 {
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.7s forwards;
}
.hero-animate-4 {
  opacity: 0;
  animation: fadeUp 1s var(--ease) 0.9s forwards;
}

/* ── Primary & Ghost Buttons ──────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 36px;
  background: var(--gold);
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--white);
  transform: translateX(-101%);
  transition: transform 0.5s var(--ease);
}

.btn-primary:hover::before { transform: translateX(0); }
.btn-primary span,
.btn-primary svg { position: relative; z-index: 1; }

.btn-primary svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s var(--ease);
}

.btn-primary:hover svg { transform: translateX(4px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 0;
  color: var(--gold-light);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.3s;
}

.btn-ghost:hover { color: var(--white); gap: 14px; }

.btn-ghost svg {
  width: 16px;
  height: 16px;
}

/* ── Button Hover Sweep Effect ─────────────────────────── */
.btn-sweep {
  position: relative;
  overflow: hidden;
}

.btn-sweep::before {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-101%);
  transition: transform 0.5s var(--ease);
}

.btn-sweep:hover::before {
  transform: translateX(0);
}

.btn-sweep > * {
  position: relative;
  z-index: 1;
}

.btn-sweep-white::before {
  background: var(--white);
}

.btn-sweep-green::before {
  background: var(--green-light);
}

.btn-sweep-gold::before {
  background: var(--gold-light);
}

/* ── Service Card Effects ──────────────────────────────── */
.service-card-line::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}

.service-card-line:hover::after {
  transform: scaleX(1);
}

/* ── Product Card Overlay ──────────────────────────────── */
.product-overlay {
  background: linear-gradient(0deg,
    rgba(10, 46, 32, 0.9) 0%,
    rgba(10, 46, 32, 0.1) 50%,
    transparent 100%
  );
  transition: background 0.5s var(--ease);
}

.group:hover .product-overlay {
  background: linear-gradient(0deg,
    rgba(10, 46, 32, 0.95) 0%,
    rgba(10, 46, 32, 0.3) 40%,
    rgba(10, 46, 32, 0.1) 100%
  );
}

/* ── Page Hero Banner ──────────────────────────────────── */
.page-hero-overlay {
  background: linear-gradient(180deg,
    rgba(10, 46, 32, 0.7) 0%,
    rgba(10, 46, 32, 0.9) 100%
  );
}

/* ── Form Styles ───────────────────────────────────────── */
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 14px 18px;
  border: 1.5px solid rgba(17, 73, 51, 0.12);
  background: var(--white);
  font-family: 'Rubik', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--black);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(17, 73, 51, 0.08);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

.form-input.error,
.form-textarea.error,
.form-select.error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.form-input.success,
.form-textarea.success,
.form-select.success {
  border-color: var(--green);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23114933' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ── File Upload Drop Zone ─────────────────────────────── */
.upload-zone {
  border: 2px dashed rgba(17, 73, 51, 0.2);
  transition: all 0.3s ease;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--green);
  background: rgba(17, 73, 51, 0.03);
}

.upload-zone.has-file {
  border-color: var(--green);
  border-style: solid;
  background: rgba(17, 73, 51, 0.03);
}

/* ── Mobile Menu Overlay ───────────────────────────────── */
.mobile-menu-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Hide hamburger when menu is open */
.mobile-menu-overlay.active ~ nav #mobile-toggle,
body:has(.mobile-menu-overlay.active) #mobile-toggle {
  opacity: 0;
  pointer-events: none;
}

/* ── Nav Dropdown ──────────────────────────────────────── */
.nav-dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s var(--ease);
  pointer-events: none;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Active nav link gold underline */
.nav-link-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--gold);
}

/* ── Nav link hover underline ──────────────────────────── */
.nav-link-hover::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--gold);
  transition: width 0.4s var(--ease);
}

.nav-link-hover:hover::after {
  width: 100%;
}

/* ── Footer Giant Text ─────────────────────────────────── */
.footer-giant-text {
  -webkit-text-stroke: 1.5px rgba(227, 204, 160, 0.12);
  color: transparent;
  transition: -webkit-text-stroke-color 0.6s var(--ease);
  user-select: none;
  pointer-events: none;
}

.footer-giant-text::after {
  content: 'Framekozijn';
  position: absolute;
  inset: 0;
  color: rgba(227, 204, 160, 0.04);
  -webkit-text-stroke: 0;
  transition: color 0.6s var(--ease);
}

footer:hover .footer-giant-text {
  -webkit-text-stroke: 1.5px rgba(227, 204, 160, 0.2);
}

footer:hover .footer-giant-text::after {
  color: rgba(227, 204, 160, 0.07);
}

/* ── Counter Animation ─────────────────────────────────── */
.counter-animate {
  display: inline-block;
}

/* ── Alert Messages ────────────────────────────────────── */
.alert-success {
  background: rgba(17, 73, 51, 0.08);
  border-left: 4px solid var(--green);
}

.alert-error {
  background: rgba(220, 38, 38, 0.06);
  border-left: 4px solid #dc2626;
}

/* ── Loading Spinner ───────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── Responsive Helpers ────────────────────────────────── */
@media (max-width: 1024px) {
  .nav-main {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

/* ── Print Styles ──────────────────────────────────────── */
@media print {
  .nav-main,
  .mobile-menu-overlay,
  .hero-grid-overlay {
    display: none !important;
  }

  .reveal,
  .reveal-left,
  .reveal-right {
    opacity: 1 !important;
    transform: none !important;
  }
}
