/* Main CSS - Psychology of Discounts and Sales */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Body scroll lock for mobile menu */
body.menu-open {
  overflow: hidden;
}

/* Base typography */
body {
  font-size: 16px;
  line-height: 1.6;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #26b780;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 999;
  padding: 0.75rem 1.5rem;
  background: #102a43;
  color: #fff;
  font-weight: 600;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* Mobile menu transitions */
#mobile-menu {
  transition: visibility 0s linear 0.3s;
  visibility: hidden;
}

#mobile-menu.active {
  visibility: visible;
  transition-delay: 0s;
}

#mobile-menu #menu-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#mobile-menu.active #menu-backdrop {
  opacity: 1;
}

#mobile-menu > div:last-child {
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

#mobile-menu.active > div:last-child {
  transform: translateX(0);
}

/* Animation delay utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }

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

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(16, 42, 67, 0.1);
}

/* Form input transitions */
input,
textarea,
select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Error state for form inputs */
input.input-error,
textarea.input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Success state for form inputs */
input.input-success,
textarea.input-success {
  border-color: #0fa06c;
  box-shadow: 0 0 0 3px rgba(15, 160, 108, 0.1);
}

/* Button loading state */
button.loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

button.loading::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
}

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

/* FAQ accordion styles */
.faq-item {
  border-bottom: 1px solid #d9e2ec;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.faq-answer.open {
  max-height: 500px;
}

.faq-toggle .faq-icon {
  transition: transform 0.3s ease;
}

.faq-toggle.active .faq-icon {
  transform: rotate(180deg);
}

/* Cookie consent animation */
#cookie-consent {
  animation: slideInRight 0.5s ease-out;
}

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

/* Responsive image containers */
.img-container {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
}

.img-container img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Hero gradient animation */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-animate {
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
}

/* Selection colors */
::selection {
  background: rgba(15, 160, 108, 0.2);
  color: #102a43;
}

/* Print styles */
@media print {
  header,
  footer,
  #cookie-consent,
  #mobile-menu {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
  }

  a {
    text-decoration: underline;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Custom scrollbar */
@media (min-width: 768px) {
  ::-webkit-scrollbar {
    width: 8px;
  }

  ::-webkit-scrollbar-track {
    background: #f0f4f8;
  }

  ::-webkit-scrollbar-thumb {
    background: #9fb3c8;
    border-radius: 4px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #829ab1;
  }
}
