/* Custom styles extending Tailwind */

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

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

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

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

input:invalid:not(:placeholder-shown):not(:focus),
textarea:invalid:not(:placeholder-shown):not(:focus) {
  border-color: #ef4444;
}

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

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

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

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

.faq-question {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  color: #1f2937;
  transition: color 0.2s ease;
}

.faq-question:hover {
  color: #0070c9;
}

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

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
}

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

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

/* Mobile menu animation */
#mobile-menu {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

#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: slideInFromBottom 0.5s ease forwards;
}

@keyframes slideInFromBottom {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Custom selection color */
::selection {
  background-color: #b9dffe;
  color: #064b86;
}

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

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

  a {
    text-decoration: underline;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Responsive image fallback styling */
img[src=""] {
  background: linear-gradient(135deg, #e0effe 0%, #e4ebe4 50%, #faebd7 100%);
  min-height: 200px;
  display: block;
}

/* Typography refinements */
.font-serif {
  letter-spacing: -0.01em;
}

p + p {
  margin-top: 0;
}

/* Blockquote / callout styling */
blockquote,
.callout {
  border-left: 4px solid #0070c9;
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: #064b86;
  font-style: italic;
}

/* Table styling for schedule tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background-color: #f0f7ff;
  font-weight: 600;
  color: #0b3f6f;
}

tr:hover {
  background-color: #f9fafb;
}

/* Button disabled state */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Link underline animation */
a.underline-animate {
  position: relative;
  text-decoration: none;
}

a.underline-animate::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #0070c9;
  transition: width 0.3s ease;
}

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