/* ==========================================================================
   Pura White Dairy - Custom Theme & Stylesheet
   Brand Color: #164F9E | Head Navy: #0D2F57 | Background: #FFFFFF
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --color-primary: #164F9E;
  --color-primary-dark: #0f3d7e;
  --color-primary-light: #E9F1FA;
  --color-navy: #0D2F57;
  --color-gold: #9A6B2F;
  --color-yellow: #F9B912;
  --color-body: #2C3E50;
  --color-muted: #6B7683;
  --color-border: #E6E9ED;
  --color-bg-tint: #F8F9FB;
  --color-wa: #25D366;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
}

/* Base resets & typography */
html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  color: var(--color-body);
}

body {
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-serif {
  font-family: var(--font-serif);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Header & Nav Micro-interactions */
.nav-link {
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
  transition: all 0.25s ease;
  transform: translateX(-50%);
}

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

.nav-link.active {
  color: var(--color-primary);
  font-weight: 600;
}

/* Animated subtle pulse for verified badges */
@keyframes soft-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

.animate-soft-pulse {
  animation: soft-pulse 3s infinite ease-in-out;
}

/* Card hover transitions */
.batch-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.batch-card:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: 0 12px 30px -10px rgba(22, 79, 158, 0.12);
}

/* Table Row Highlights */
.batch-row {
  transition: background-color 0.15s ease;
}

.batch-row:hover {
  background-color: #f8fafc;
}

/* Copy Toast notification */
#toastNotification {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#toastNotification.show {
  opacity: 1;
  transform: translateY(0);
}

/* WhatsApp Floating Button */
.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background-color: var(--color-wa);
  color: #ffffff;
  border-radius: 50px;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
}

.wa-float:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5);
  color: #ffffff;
}

/* Custom modal backdrop animation */
.modal-backdrop {
  backdrop-filter: blur(4px);
  transition: opacity 0.25s ease;
}

/* Print Stylesheet for compliance audits */
@media print {
  header, footer, .wa-float, #searchContainer, .no-print {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .print-only {
    display: block !important;
  }
  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }
  th, td {
    border: 1px solid #333 !important;
    padding: 8px !important;
  }
}

/* ==========================================================================
   Responsive Batch Table & Cards (Single-Code Responsive Architecture)
   - Desktop (>= 768px): Semantic HTML Data Table
   - Mobile (< 768px): Fluid Self-Contained Cards
   ========================================================================== */

/* Desktop Specific Table Formatting (min-width: 768px) */
@media (min-width: 768px) {
  .batch-table-container {
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(22, 79, 158, 0.08), 0 8px 10px -6px rgba(22, 79, 158, 0.04);
    overflow: hidden;
  }

  .responsive-batch-table {
    display: table;
    width: 100%;
    border-collapse: collapse;
  }

  .responsive-batch-table thead {
    display: table-header-group;
  }

  .responsive-batch-table tbody {
    display: table-row-group;
  }

  .responsive-batch-table .batch-row {
    display: table-row;
    transition: background-color 0.15s ease;
  }

  .responsive-batch-table .batch-row:hover {
    background-color: rgba(248, 250, 252, 0.85);
  }

  .responsive-batch-table .batch-row:not(:last-child) {
    border-bottom: 1px solid #F1F5F9;
  }

  .responsive-batch-table .cell-batch {
    display: table-cell;
    width: 9rem;
    padding: 1.25rem 1.5rem;
    vertical-align: top;
  }

  .responsive-batch-table .cell-info {
    display: table-cell;
    padding: 1.25rem 1.5rem;
    vertical-align: top;
  }

  .responsive-batch-table .cell-desc {
    display: table-cell;
    width: 14rem;
    padding: 1.25rem 1.5rem;
    vertical-align: top;
    text-align: center;
  }

  .responsive-batch-table .cell-verify {
    display: table-cell;
    width: 16rem;
    padding: 1.25rem 1.5rem;
    vertical-align: top;
    text-align: center;
  }

  .cell-mobile-label {
    display: none;
  }
}

/* Mobile Card Transformation (max-width: 767px) */
@media (max-width: 767px) {
  .batch-table-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    border-radius: 0 !important;
  }

  .responsive-batch-table {
    display: block !important;
    width: 100% !important;
    border: none !important;
  }

  /* Completely hide table header on mobile */
  .responsive-batch-table thead {
    display: none !important;
  }

  .responsive-batch-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
  }

  /* Each table row becomes an autonomous card */
  .responsive-batch-table .batch-row {
    display: block !important;
    width: 100% !important;
    background: #ffffff !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 1rem !important;
    padding: 1.25rem !important;
    box-shadow: 0 4px 15px -2px rgba(22, 79, 158, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
  }

  .responsive-batch-table .batch-row:hover {
    transform: translateY(-2px);
    border-color: #BFDBFE !important;
    box-shadow: 0 12px 25px -4px rgba(22, 79, 158, 0.12) !important;
  }

  /* All table cells behave as stacked blocks inside the card */
  .responsive-batch-table td {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
  }

  /* Card Header: Batch Number & Status Pill */
  .responsive-batch-table .cell-batch {
    border-bottom: 1px solid #F1F5F9 !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }

  .responsive-batch-table .cell-batch .batch-badge-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  /* Card Body: Manufacturer Name, Address & FSSAI */
  .responsive-batch-table .cell-info {
    margin-bottom: 0.75rem !important;
  }

  /* Card Description / Certification */
  .responsive-batch-table .cell-desc {
    margin-bottom: 0.5rem !important;
    padding-top: 0.5rem !important;
    border-top: 1px dashed #F1F5F9 !important;
  }

  /* Card Footer: Additional Verification Info */
  .responsive-batch-table .cell-verify {
    padding-top: 0.5rem !important;
    border-top: 1px dashed #F1F5F9 !important;
  }

  /* If cell is explicitly empty or has dash, hide on mobile cards cleanly */
  .responsive-batch-table .cell-desc.is-empty,
  .responsive-batch-table .cell-verify.is-empty {
    display: none !important;
  }

  .cell-mobile-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748B;
    margin-right: 0.35rem;
  }
}

