/* Gentech Diagnostics - Custom Styles */
/* Used alongside Tailwind CSS CDN */

/* ===== CSS Variables ===== */
:root {
  --color-primary: #1e3a8a;
  --color-primary-light: #2563eb;
  --color-primary-dark: #172554;
  --color-accent: #8AC642;
  --color-text: #1f2937;
  --color-text-light: #4b5563;
  --color-bg: #ffffff;
  --color-bg-alt: #f9fafb;
  --transition-base: 0.3s ease;
  --radius: 0.5rem;
}

/* ===== Base Styles ===== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  color: var(--color-text);
  line-height: 1.5;
}

/* ===== Skip Link (Accessibility) ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 0.5rem 0.5rem;
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* ===== Focus Styles (Accessibility) ===== */
*:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 2px;
}

/* ===== Header Scroll Effect ===== */
header.scrolled {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

/* ===== Hero Section ===== */
.hero-section {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed; /* Parallax slow scroll effect */
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 51, 102, 0.95) 0%,
    rgba(0, 51, 102, 0.85) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 10;
}

/* ===== Navigation ===== */
.nav-link {
  position: relative;
  padding: 0.5rem 0;
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link:focus::after,
.nav-link[aria-current="page"]::after {
  width: 100%;
}

/* Mobile Navigation */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: var(--color-primary-dark);
  padding: 5rem 2rem 2rem;
  transition: right var(--transition-base);
  z-index: 100;
  overflow-y: auto;
}

.mobile-nav.open {
  right: 0;
}

.mobile-nav-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.5rem;
  transition: transform var(--transition-base);
}

.mobile-nav-close:hover {
  transform: scale(1.1);
}

.mobile-nav-close:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
  z-index: 99;
}

.mobile-nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Hamburger Button */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.hamburger.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ===== Service Cards ===== */
.service-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.service-card img {
  width: 100%;
  height: 192px;
  object-fit: cover;
}

.service-card-content {
  padding: 1.5rem;
}

/* ===== Page Header ===== */
.page-header {
  padding-top: 80px;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: white;
}

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

.faq-button {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1.25rem 3rem 1.25rem 0;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
  transition: color var(--transition-base);
}

.faq-button:hover {
  color: var(--color-primary-light);
}

/* FAQ Icon Animation (matching original) */
.faq-icon,
.faq-shadow {
  display: inline-block;
  position: absolute;
  top: 50%;
  right: 24px;
  margin-top: -10px;
  width: 20px;
  height: 20px;
  transform: scale(1);
  transition: all 0.5s ease;
}

.faq-icon::before,
.faq-shadow::before {
  display: block;
  position: absolute;
  content: "";
  top: 9px;
  left: 0;
  width: 21px;
  height: 3px;
  background: #1e3a8a;
  transform: rotate(0);
  transition: all 0.5s ease;
}

.faq-icon::after,
.faq-shadow::after {
  display: block;
  position: absolute;
  content: "";
  top: 0;
  left: 9px;
  width: 3px;
  height: 21px;
  background: #00249C;
  transform: rotate(0);
  transition: all 0.5s ease;
}

.faq-shadow::before,
.faq-shadow::after {
  background: #000;
}

.faq-button:hover .faq-icon {
  transform: scale(1.5) rotate(180deg);
  margin-top: -16px;
}

.faq-shadow {
  filter: blur(0);
  opacity: 0.15;
}

.faq-button:hover .faq-shadow {
  filter: blur(3px);
  margin-top: 0;
  transform: scale(1.8) rotate(180deg);
}

.faq-button[aria-expanded="true"] .faq-icon {
  transform: scale(1);
}

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

.faq-button:hover .faq-icon::after,
.faq-button:hover .faq-icon::before {
  background: #1e40af;
}

.faq-button[aria-expanded="true"] .faq-icon::after,
.faq-button[aria-expanded="true"] .faq-shadow::after {
  transform: rotate(450deg);
  background: #1e40af;
}

.faq-button[aria-expanded="true"] .faq-icon::before,
.faq-button[aria-expanded="true"] .faq-shadow::before {
  transform: rotate(360deg);
  background: #1e40af;
}

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

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

.faq-content p {
  color: var(--color-text-light);
  line-height: 1.7;
}

/* ===== Certification Badges ===== */
.cert-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: white;
  border-radius: var(--radius);
  transition: transform var(--transition-base);
}

.cert-badge:hover {
  transform: scale(1.05);
}

.cert-badge img {
  max-height: 60px;
  width: auto;
  object-fit: contain;
}

/* ===== Language Switcher (Dark Background) ===== */
.lang-switcher {
  display: flex;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem;
  border-radius: 0.375rem;
}

.lang-btn {
  padding: 0.375rem 0.75rem;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: background var(--transition-base);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lang-btn.active {
  background: white;
  color: var(--color-primary);
}

/* ===== Language Switcher (Light Background) ===== */
.lang-switcher-light {
  display: flex;
  gap: 0.25rem;
  background: #f3f4f6;
  padding: 0.25rem;
  border-radius: 0.375rem;
}

.lang-btn-light {
  padding: 0.375rem 0.75rem;
  border: none;
  background: transparent;
  color: #4b5563;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: all var(--transition-base);
}

.lang-btn-light:hover {
  background: #e5e7eb;
}

.lang-btn-light.active {
  background: var(--color-primary);
  color: white;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: all var(--transition-base);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary-light);
}

.btn-white {
  background: white;
  color: var(--color-primary);
  border-color: white;
}

.btn-white:hover {
  background: #f3f4f6;
  border-color: #f3f4f6;
}

.btn-outline {
  background: transparent;
  color: white;
  border-color: white;
}

.btn-outline:hover {
  background: white;
  color: var(--color-primary);
}

.btn-outline-dark {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline-dark:hover {
  background: var(--color-primary);
  color: white;
}

/* ===== Footer ===== */
.footer {
  background: var(--color-primary-dark);
  color: white;
}

.footer a {
  color: #bfdbfe;
  text-decoration: none;
  transition: color var(--transition-base);
}

.footer a:hover {
  color: white;
}

/* ===== Form Styles ===== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-label.required::after {
  content: ' *';
  color: #dc2626;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-input:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.form-input.error {
  border-color: #dc2626;
}

.form-error {
  margin-top: 0.5rem;
  color: #dc2626;
  font-size: 0.875rem;
}

/* ===== JotForm Embed ===== */
.jotform-embed {
  width: 100%;
  min-height: 600px;
  border: none;
}

/* ===== Utilities ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* ===== Lazy Loading Images ===== */
img[loading="lazy"] {
  opacity: 1;
  transition: opacity 0.3s ease;
}

img.loading {
  opacity: 0;
}

/* ===== Reduced Motion ===== */
@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;
  }
}

/* ===== Print Styles ===== */
@media print {
  .skip-link,
  .mobile-nav,
  .mobile-nav-overlay,
  .hamburger,
  .lang-switcher,
  .lang-switcher-light {
    display: none !important;
  }

  .hero-section {
    min-height: auto;
    background: white;
    color: black;
  }

  .hero-overlay {
    display: none;
  }
}
