/* NafElite Chemical Commerce - Design System & Modern Responsive Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  --color-primary: #000615;
  --color-primary-container: #0B1F3A;
  --color-secondary: #0046D2;
  --color-secondary-container: #1C5DFE;
  --color-teal: #00B8A9;
  --color-teal-hover: #009E91;
  --color-surface: #F8F9FF;
  --color-surface-container-low: #EFF4FF;
  --color-surface-container: #E6EEFF;
  --color-surface-container-high: #DEE9FC;
  --color-surface-container-highest: #D9E3F6;
  --color-surface-lowest: #FFFFFF;
  --color-on-surface: #121C2A;
  --color-on-surface-variant: #44474D;
  --color-outline: #75777E;
  --color-outline-variant: #CBD5E1;
  --color-amber: #F59E0B;
  --color-error: #BA1A1A;

  /* Elevation Shadows from DESIGN.md */
  --elevation-0: 1px solid #E2E8F0;
  --elevation-1: 0 1px 3px 0 rgba(11, 31, 58, 0.04), 0 1px 2px -1px rgba(11, 31, 58, 0.04);
  --elevation-2: 0 10px 15px -3px rgba(11, 31, 58, 0.06), 0 4px 6px -4px rgba(11, 31, 58, 0.03);
  --elevation-3: 0 20px 25px -5px rgba(11, 31, 58, 0.1), 0 8px 10px -6px rgba(11, 31, 58, 0.04);
}

html {
  scroll-behavior: smooth;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-surface);
  color: var(--color-on-surface);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Headings Font */
h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* Safe Area Insets for Mobile Devices */
.pb-safe {
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 12px);
}
.pt-safe {
  padding-top: max(env(safe-area-inset-top, 0px), 8px);
}

/* Smooth Horizontal Scroll without ugly scrollbars */
.no-scrollbar::-webkit-scrollbar,
.scrollbar-none::-webkit-scrollbar {
  display: none;
}
.no-scrollbar,
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Material Symbols alignment */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
  display: inline-block;
  user-select: none;
}
.material-symbols-outlined.fill {
  font-variation-settings: 'FILL' 1;
}

/* Chemical Hex Lattice Background */
.bg-hex-lattice {
  background-image: radial-gradient(rgba(0, 184, 169, 0.08) 1px, transparent 1px),
                    radial-gradient(rgba(30, 94, 255, 0.05) 1px, #ffffff 1px);
  background-size: 32px 32px;
  background-position: 0 0, 16px 16px;
}

/* Custom Elevation Utilities */
.shadow-elevation-1 {
  box-shadow: var(--elevation-1);
}
.shadow-elevation-2 {
  box-shadow: var(--elevation-2);
}
.shadow-elevation-3 {
  box-shadow: var(--elevation-3);
}

/* Card Hover Micro-interactions */
.chemical-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}
.chemical-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-2);
  border-color: #CBD5E1;
}

/* Button Pulse & Transitions */
.btn-teal {
  background-color: #00B8A9;
  color: #FFFFFF;
  transition: all 0.2s ease;
}
.btn-teal:hover {
  background-color: #009E91;
  box-shadow: 0 4px 12px rgba(0, 184, 169, 0.3);
}
.btn-teal:active {
  transform: scale(0.98);
}

.btn-secondary-outline {
  border: 1.5px solid #1E5EFF;
  color: #1E5EFF;
  background: #FFFFFF;
  transition: all 0.2s ease;
}
.btn-secondary-outline:hover {
  background: rgba(30, 94, 255, 0.05);
}

/* Drawer & Modal Transitions */
.drawer-backdrop {
  background: rgba(11, 31, 58, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}

.drawer-panel-right {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-panel-bottom {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Active Category Pill Animation */
.cat-pill {
  transition: all 0.2s ease;
}
.cat-pill.active {
  background-color: #0B1F3A !important;
  color: #FFFFFF !important;
}

/* Toast Notification */
#toast-container {
  position: fixed;
  top: 84px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast-item {
  pointer-events: auto;
  animation: slideInToast 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes slideInToast {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Pulse animation for RFQ badge */
@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}
.pulse-badge {
  animation: badgePulse 0.4s ease;
}

/* Mobile Navigation Slide-out Drawer */
#mobileNavDrawer {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
}
#mobileNavDrawer.hidden {
  display: none !important;
}
#mobileNavDrawer #navBackdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(11, 31, 58, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
#mobileNavDrawer.is-active #navBackdrop {
  opacity: 1;
}
#mobileNavDrawer .nav-panel {
  position: relative;
  z-index: 10;
  width: 82%;
  max-width: 320px;
  height: 100%;
  background-color: #FFFFFF;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#mobileNavDrawer.is-active .nav-panel {
  transform: translateX(0) !important;
}


/* Print Styles for SDS */
@media print {
  body * {
    visibility: hidden;
  }
  #sdsModal, #sdsModal * {
    visibility: visible;
  }
  #sdsModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff !important;
  }
  .no-print {
    display: none !important;
  }
}
