/* Main CSS - Financial Resilience for Freelancers */

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

/* Base body styles */
body {
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Body scroll lock for mobile menu */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Focus visible styles for accessibility */
*:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to content link for keyboard users */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 999;
  padding: 0.75rem 1.5rem;
  background: #0d9488;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  transition: top 0.2s;
}

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

/* Link transitions */
a {
  transition: color 0.2s ease, background-color 0.2s ease;
}

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

/* Form validation states */
input.error,
textarea.error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.15);
}

input.success,
textarea.success {
  border-color: #16a34a !important;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}

/* Mobile menu animation */
#mobile-menu {
  transition: opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

#mobile-menu.active {
  opacity: 1;
  pointer-events: auto;
}

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

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

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

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

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

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

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

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

/* FAQ accordion styles */
.faq-item {
  transition: background-color 0.2s ease;
}

.faq-item:hover {
  background-color: rgba(13, 148, 136, 0.03);
}

.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-icon {
  transition: transform 0.3s ease;
}

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

/* Button active/pressed state */
button:active:not(:disabled) {
  transform: scale(0.98);
}

/* Gradient text utility */
.gradient-text {
  background: linear-gradient(135deg, #0f766e, #0d9488, #14b8a6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hero section pattern overlay */
.hero-pattern {
  background-image: radial-gradient(circle at 25% 50%, rgba(255,255,255,0.05) 0%, transparent 50%),
                    radial-gradient(circle at 75% 30%, rgba(255,255,255,0.03) 0%, transparent 50%);
}

/* Image placeholder styling */
img[src=""] {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 50%, #e2e8f0 100%);
  min-height: 200px;
  display: block;
}

/* Selection color */
::selection {
  background-color: rgba(13, 148, 136, 0.2);
  color: #0f4f4a;
}

/* Scrollbar styling for webkit */
::-webkit-scrollbar {
  width: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: #78716c;
}

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

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
  }
}

/* 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;
  }

  .section-animate {
    opacity: 1;
    transform: none;
  }
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
  .border-stone-200 {
    border-color: #78716c;
  }

  .text-stone-300 {
    color: #d6d3d1;
  }
}
