:root {
  /* Colors from DESIGN.md */
  --color-primary: #1275e2;
  --color-secondary: #0f172a;
  --color-tertiary: #c55b00;
  --color-neutral: #74777f;
  --color-surface: #f8fafc;
  --color-on-surface: #1a1c1e;
  --color-on-surface-variant: #43474e;
  --color-outline: #73777f;

  /* Typography - Elite Duo */
  --font-main: 'Inter', sans-serif;
  --font-headline: 'Inter', sans-serif;

  /* Shape and Form */
  --radius-moderate: 8px;

  /* Spacing */
  --spacing-base: 16px;
}

/* Global Transition - Exclude filter/transform for performance */
* { transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
*, *::before, *::after { box-sizing: border-box; }

/* Base Styles */
body {
  font-family: var(--font-main);
  background-color: var(--color-surface);
  color: var(--color-on-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Force Contrast on Headlines */
h1, h2, h3, h4, h5, .font-headline {
  font-family: var(--font-headline);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Glassmorphism Classes (From code.html styles) */
.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Premium Pulse Effect for WhatsApp */
@keyframes pulse-soft {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.whatsapp-pulse {
    animation: pulse-soft 2s infinite;
}

/* Hover Lift Interactions */
.hover-lift {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.hover-lift:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.15);
}

/* Refined Typography and Spacing */
.font-headline {
    letter-spacing: -0.04em;
    line-height: 0.95;
    text-wrap: balance;
}

.glass-dark {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glow-blue {
  box-shadow: 0 0 20px rgba(18, 117, 226, 0.3);
}

.text-header-shadow {
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 0, 0, 0.4);
}

.sidebar-glass {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Animations */
.reveal-animation {
  opacity: 0;
  animation: reveal 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

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

.scroll-indicator {
  animation: float 2.5s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(18, 117, 226, 0.6));
}

@keyframes float {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(10px); opacity: 1; }
}

.mouse-wheel {
  animation: wheel-move 1.5s infinite;
}

@keyframes wheel-move {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(8px); }
}

/* Special Animations */
.animate-pulsate {
  animation: pulsate 2s infinite ease-in-out;
}

@keyframes pulsate {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(18, 117, 226, 0.4); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(18, 117, 226, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(18, 117, 226, 0); }
}

/* Smart Header Transition */
header {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Card Hover Effects */
.service-card {
  transition: all 0.3s ease;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.service-card:hover .service-button {
  background-color: var(--color-primary);
  color: white;
}

/* Desktop Communication Dock */
.dock-item {
  position: relative;
  display: flex;
  align-items: center;
}

.dock-label {
  position: absolute;
  right: 110%;
  white-space: nowrap;
  background: rgba(15, 23, 42, 0.8);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.dock-item:hover .dock-label {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile Sticky Bar */
.mobile-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 12px 6px;
  z-index: 100;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* FAQ Accordion Stilleri */
.faq-header[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
}

.faq-header[aria-expanded="true"] {
  color: var(--color-primary);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease;
}

.faq-item.active .faq-content {
  max-height: 500px;
  padding-bottom: 1.5rem;
}

/* Before/After Image Hover */
.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-moderate);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
  color: white;
  padding: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
  transform: translateY(0);
}

.gallery-card img {
  transition: transform 0.5s ease;
}

.gallery-card:hover img {
  transform: scale(1.1);
}

/* Testimonial Cards */
.testimonial-card {
  perspective: 1000px;
}

.testimonial-inner {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card:hover .testimonial-inner {
  transform: translateY(-10px);
  box-shadow: 0 25px 50px -12px rgba(18, 117, 226, 0.15);
}

.star-rating {
  color: #ffb400;
  font-family: "Material Symbols Outlined";
  font-variation-settings: 'FILL' 1;
}

/* Micro-interactions */

/* Button click feedback */
button:active, 
.btn-click:active {
  transform: scale(0.97);
  transition: transform 0.1s ease;
}

/* Form input focus animation */
input:focus, 
select:focus, 
textarea:focus {
  animation: input-glow 0.3s ease;
}

@keyframes input-glow {
  0% { box-shadow: 0 0 0 0 rgba(18, 117, 226, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(18, 117, 226, 0.2); }
  100% { box-shadow: 0 0 0 2px rgba(18, 117, 226, 0.3); }
}

/* Form validation feedback */
input.error, select.error {
  animation: shake 0.5s ease;
  border-color: #ef4444;
}

input.success, select.success {
  border-color: #22c55e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2322c55e'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* Toast notification animation */
.toast-enter {
  animation: toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast-exit {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(10px); }
}

/* Card hover lift */
.card-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Link underline animation */
.link-animate {
  position: relative;
}

.link-animate::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}

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

/* Checkbox custom animation */
input[type="checkbox"]:checked {
  animation: check-bounce 0.3s ease;
}

@keyframes check-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* --- Advanced Functional Components --- */

/* Comparison Slider - Premium Overhaul */
.comparison-slider {
    position: relative; width: 100%; height: 450px; overflow: hidden;
    border-radius: 32px; box-shadow: 0 30px 60px -12px rgba(0,0,0,0.25);
    cursor: ew-resize; touch-action: none; background-color: #f1f5f9;
}
.comparison-slider img {
    width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0;
    pointer-events: none; user-select: none;
}
/* After-img logic is handled via JS clip-path dynamically */
.comparison-slider .slider-handle {
    position: absolute; top: 0; bottom: 0; width: 4px; background: white;
    left: 0; z-index: 3;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}
.comparison-slider .slider-handle::after {
    content: ''; position: absolute; top: 50%; left: 50%; width: 48px; height: 48px;
    background: var(--color-primary); border: 4px solid white; border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 25px rgba(18,117,226,0.5);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M8 7l-5 5 5 5V7zm8 0l5 5-5 5V7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center; background-size: 24px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}
.comparison-slider:hover .slider-handle::after {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 12px 35px rgba(18,117,226,0.6);
}
.comparison-label {
    position: absolute; bottom: 20px; font-weight: 900; font-size: 10px;
    letter-spacing: 2px; padding: 6px 12px; border-radius: 6px; z-index: 5;
    pointer-events: none; text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.before-label { right: 20px; background: #ef4444; color: white; }
.after-label { left: 20px; background: #22c55e; color: white; }

/* Slider Touch Zone - Large Hit Area */
.comparison-slider::before {
    content: ''; position: absolute; inset: 0; z-index: 1;
}

@media (max-width: 768px) {
    .comparison-slider { height: 350px; }
}



/* Global Accessibility & Focus Patch - exclude bg-color from transition to prevent white flash */
a, button { transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease, color 0.2s ease, border-color 0.2s ease; }
/* Removed 'nav a:hover' which caused white-out bugs on primary buttons */
/* Absolute Reset & Protection */
html, body { 
  overflow-x: hidden; 
  width: 100%; 
  max-width: 100vw; 
  margin: 0; 
  padding: 0;
  position: relative;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}
* { box-sizing: border-box; }
img { max-width: 100%; height: auto; }
video { max-width: 100%; }
