/* Main Stylesheet - Gamified Finance 2026 */

/* Base reset and typography */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

main {
  flex: 1;
}

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

/* Smooth transitions for interactive elements */
a,
button {
  transition: all 0.2s ease;
}

/* Form input styles */
input[type="text"],
input[type="email"],
textarea {
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Validation states */
input:required:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

input:required:valid:not(:placeholder-shown) {
  border-color: #22c55e;
}

/* Error message styling */
.field-error {
  color: #ef4444;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  display: none;
}

.field-error.visible {
  display: block;
}

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

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Gradient text effect for headings */
.gradient-text {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

#mobile-menu .absolute.inset-0 {
  opacity: 0;
  transition: opacity 0.3s ease;
}

#mobile-menu.active .absolute.inset-0 {
  opacity: 1;
}

#mobile-menu .absolute.inset-y-0 {
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

#mobile-menu.active .absolute.inset-y-0 {
  transform: translateX(0);
}

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

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

/* Section fade-in on scroll */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

.faq-question {
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  font-weight: 600;
  color: #1f2937;
  transition: color 0.2s ease;
}

.faq-question:hover {
  color: #4f46e5;
}

.faq-question .icon-toggle {
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item.open .faq-question .icon-toggle {
  transform: rotate(180deg);
}

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

.faq-item.open .faq-answer {
  max-height: 500px;
  padding-bottom: 1.25rem;
}

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

  main {
    font-size: 12pt;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* Reduced motion preference */
@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;
  }
}

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

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

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Image placeholder background */
img[src=""] {
  background: linear-gradient(135deg, #e0e7ff, #ede9fe);
  min-height: 60px;
}
