/* ============================================
   GlycoLabs Custom Styles - Works with Tailwind CDN
   Version: 3.1
   ============================================ */

/* ============================================
   Font Face Declarations - Local Poppins Fonts
   ============================================ */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src: url('../fonts/poppins-v24-latin-100.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url('../fonts/poppins-v24-latin-200.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/poppins-v24-latin-300.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/poppins-v24-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/poppins-v24-latin-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/poppins-v24-latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/poppins-v24-latin-700.woff2') format('woff2');
}

/* ============================================
   CSS Variables - Design System
   ============================================ */
:root {
  /* Primary Colors */
  --primary: #468eb3;
  --primary-light: #5ba3c9;
  --primary-dark: #2c5f7c;
  --primary-lighter: #e8f3f8;

  /* Semantic Colors */
  --success: #7fb069;
  --success-light: #9bc485;
  --success-lighter: #f0f7ed;

  --error: #d87979;
  --error-light: #e39999;
  --error-lighter: #fbeaea;

  --warning: #f39c12;
  --warning-light: #f5b041;
  --warning-lighter: #fef3e5;

  --info: #468eb3;

  /* Neutral Grays */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Text Colors */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;

  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;

  /* Typography */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;

  /* Font Sizes */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */

  /* Spacing */
  --spacing-xs: 0.25rem;  /* 4px */
  --spacing-sm: 0.5rem;   /* 8px */
  --spacing-md: 1rem;     /* 16px */
  --spacing-lg: 1.5rem;   /* 24px */
  --spacing-xl: 2rem;     /* 32px */
  --spacing-2xl: 3rem;    /* 48px */

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-3xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Legacy support - will be removed in future */
  --color-primary: var(--primary);
  --color-primary-dark: var(--primary-dark);
}

/* ============================================
   Base Styles
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

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

@keyframes rotateArrow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(90deg);
  }
}

/* ============================================
   Header Styles
   ============================================ */
header {
  transition: box-shadow 0.3s ease;
}

header.scrolled {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Navigation link hover effect */
nav a.nav-link {
  position: relative;
  transition: none;
}

nav a.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width 300ms ease;
}

nav a.nav-link:hover::after,
nav a.nav-link.active::after {
  width: 100%;
}

nav a.nav-link:hover {
  color: var(--color-primary);
}

/* ============================================
   Mobile Menu Animation
   ============================================ */
#mobile-menu {
  animation: slideDown 0.3s ease-out;
}

/* ============================================
   Button Loading State
   ============================================ */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================
   Notification Styles
   ============================================ */
.notification {
  position: fixed;
  top: 5rem;
  right: 1rem;
  background: var(--bg-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  animation: slideInRight 0.3s ease-out;
  max-width: 400px;
  border-left: 4px solid var(--primary);
}

.notification.success {
  border-left-color: var(--success);
}

.notification.error {
  border-left-color: var(--error);
}

.notification.warning {
  border-left-color: var(--warning);
}

.notification-exit {
  animation: slideOutRight 0.3s ease-out;
}

/* ============================================
   Back to Top Button
   ============================================ */
#back-to-top {
  transition: all 0.3s ease;
}

#back-to-top.visible {
  opacity: 1 !important;
  visibility: visible !important;
}

#back-to-top:not(.visible) {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* ============================================
   Form Input Error State
   ============================================ */
input.error,
select.error,
textarea.error {
  border-color: var(--error) !important;
}

input.success,
select.success,
textarea.success {
  border-color: var(--success) !important;
}

/* ============================================
   FAQ Accordion Styles (Native <details> element)
   ============================================ */
details {
  transition: all 0.3s ease;
}

details:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

details[open] {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(70, 142, 179, 0.08);
}

/* Style the summary (question) */
details summary {
  list-style: none;
  position: relative;
  cursor: pointer;
  user-select: none;
}

/* Remove default marker */
details summary::-webkit-details-marker {
  display: none;
}

/* Custom arrow indicator */
details summary::after {
  content: '›';
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  font-size: 1.5rem;
  font-weight: var(--font-weight-medium);
  color: var(--primary);
  transition: transform var(--transition-base);
}

/* Rotate arrow when open */
details[open] summary::after {
  transform: translateY(-50%) rotate(90deg);
}

/* Smooth animation for content */
details[open] > div {
  animation: slideDown 0.3s ease-out;
}

/* Alternative: Plus/Minus indicator (uncomment to use instead of arrow)
details summary::after {
  content: '+';
  font-size: 1.5rem;
}

details[open] summary::after {
  content: '−';
}
*/

/* ============================================
   Old FAQ Item Styles (deprecated - kept for backwards compatibility)
   ============================================ */
.faq-item {
  transition: all 0.3s ease;
}

.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.faq-item.active {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(70, 142, 179, 0.08);
}

/* ============================================
   Test Card Hover Effects
   ============================================ */
.test-card {
  transition: all 0.3s ease;
}

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

/* ============================================
   WhatsApp Button Pulse
   ============================================ */
.whatsapp-button {
  animation: pulse 2s infinite;
}

/* ============================================
   Scroll Animation Classes
   ============================================ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.5s ease;
}

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

/* ============================================
   Focus States for Accessibility
   ============================================ */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

details summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-lg);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
  .test-card.popular {
    transform: none;
  }
  
  /* Adjust arrow position on mobile */
  details summary::after {
    right: 1rem;
  }
}

/* ============================================
   Flip Card Styles
   ============================================ */
.flip-card {
  background-color: transparent;
  width: 200px;
  height: 264px;
  perspective: 1000px;
  cursor: pointer;
  margin: 0 auto;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 16px -2px rgba(0, 0, 0, 0.1);
}

.flip-card-front {
  background-color: white;
  color: black;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flip-card-back {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  transform: rotateY(180deg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.flip-card-back p {
  line-height: 1.6;
  padding: 10px;
}

/* Add hover effect */
.flip-card:hover .flip-card-front {
  box-shadow: 0 12px 24px -2px rgba(0, 0, 0, 0.15);
}

.flip-card:hover .flip-card-back {
  box-shadow: 0 12px 24px -2px rgba(0, 0, 0, 0.15);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  header,
  footer,
  .whatsapp-button,
  #back-to-top {
    display: none !important;
  }
}