/**
 * KARPSCHEM - Master Production Stylesheet
 * Complete CSS Architecture for Shared Hosting (cPanel / Apache / Nginx / Direct)
 * Colors:
 *   --primary: #2F4EA2
 *   --primary-dark: #1E3A8A
 *   --accent: #6C80C7
 *   --highlight: #12B5A6
 *   --highlight-dark: #0F968A
 *   --dark: #0B1B3A
 *   --darker: #081329
 *   --light: #F5F7FC
 *   --surface: #FFFFFF
 *   --text: #1F2937
 *   --text-muted: #64748B
 *   --border: #E2E8F0
 */

/* ==========================================================================
   1. RESET & BASE TYPOGRAPHY
   ========================================================================== */
:root {
  --primary: #2F4EA2;
  --primary-hover: #233C80;
  --primary-dark: #1E3A8A;
  --primary-light: #EEF2FF;
  --accent: #6C80C7;
  --highlight: #12B5A6;
  --highlight-hover: #0E9084;
  --highlight-light: #F0FDFA;
  --dark: #0B1B3A;
  --darker: #081329;
  --light: #F5F7FC;
  --surface: #FFFFFF;
  --text: #1F2937;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --border-dark: #CBD5E1;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(11, 27, 58, 0.08);
  --shadow-lg: 0 10px 25px -5px rgba(11, 27, 58, 0.12), 0 8px 10px -6px rgba(11, 27, 58, 0.08);
  --shadow-xl: 0 20px 35px -10px rgba(11, 27, 58, 0.2);
  --font-heading: 'Poppins', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--dark);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p {
  margin-bottom: 1rem;
  color: #334155;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

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

img, svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* ==========================================================================
   2. LAYOUT & CONTAINERS
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-sm {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 4rem 0;
}

.section-sm {
  padding: 2.5rem 0;
}

.section-lg {
  padding: 6rem 0;
}

/* Flex & Grid Helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.grid-responsive-lg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

/* ==========================================================================
   3. BUTTONS & UI CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  line-height: 1.25;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.75rem;
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: 0.85rem 1.85rem;
  font-size: 1rem;
  border-radius: var(--radius-xl);
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary) 0%, var(--highlight) 100%);
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(47, 78, 162, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(47, 78, 162, 0.45);
  color: #FFFFFF !important;
}

.btn-secondary {
  background: var(--primary);
  color: #FFFFFF !important;
}

.btn-secondary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  color: #FFFFFF !important;
}

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

.btn-outline:hover {
  background: #FFFFFF;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-white {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF !important;
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  color: #FFFFFF !important;
}

.btn-highlight {
  background: var(--highlight);
  color: #FFFFFF !important;
}

.btn-highlight:hover {
  background: var(--highlight-hover);
  transform: translateY(-2px);
}

/* ==========================================================================
   4. CARDS & SURFACES
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  transition: all 0.25s ease;
  position: relative;
}

.card-hover {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #CBD5E1;
}

.card-glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  color: #FFFFFF;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary { background: #EFF6FF; color: var(--primary); }
.badge-highlight { background: #F0FDFA; color: #0F766E; }
.badge-amber { background: #FEF3C7; color: #92400E; }
.badge-emerald { background: #ECFDF5; color: #065F46; }
.badge-cyan { background: rgba(165, 243, 252, 0.15); color: #A5F3FC; border: 1px solid rgba(165, 243, 252, 0.3); }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
}

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

.breadcrumb-current {
  color: var(--primary);
  font-weight: 600;
}

/* ==========================================================================
   5. TOP BARS & NAVIGATION HEADER
   ========================================================================== */
.announcement-bar {
  background: linear-gradient(90deg, #1B3068 0%, #2F4EA2 50%, #12B5A6 100%);
  color: #FFFFFF;
  padding: 0.45rem 1rem;
  font-size: 0.775rem;
  text-align: center;
  font-weight: 500;
}

.announcement-bar a {
  color: #A5F3FC;
  text-decoration: underline;
  margin-left: 0.5rem;
  font-weight: 700;
}

.info-bar {
  background: var(--dark);
  color: #94A3B8;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  border-bottom: 1px solid #1E293B;
}

.info-bar a {
  color: #CBD5E1;
  font-weight: 600;
}

.info-bar a:hover {
  color: #FFFFFF;
}

.main-header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.5px;
}

.brand-accent {
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  list-style: none;
}

.nav-links a {
  color: #334155;
  padding: 0.35rem 0;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   6. HERO SECTION
   ========================================================================== */
.hero-section {
  background: linear-gradient(135deg, var(--darker) 0%, #0E204A 50%, #1A3A7C 100%);
  color: #FFFFFF;
  padding: 4.5rem 0 5.5rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3.5rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero-title {
  color: #FFFFFF;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 1rem 0 1.25rem;
}

.hero-desc {
  color: #CBD5E1;
  font-size: 1.05rem;
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 650px;
}

.hero-badges {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: #A5F3FC;
  flex-wrap: wrap;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-card {
  background: rgba(255, 255, 255, 0.06);
  padding: 2rem;
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
}

/* ==========================================================================
   7. CHEMICAL STRUCTURE DISPLAY
   ========================================================================== */
.structure-box {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.structure--vector .bond {
  stroke: #1F2937;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s;
}

.structure--vector .atom {
  font-family: var(--font-body);
  font-weight: bold;
  font-size: 14px;
  text-anchor: middle;
  dominant-baseline: central;
}

/* Animated bond draw effect */
.structure--animated .bond {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: drawBond 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.structure--animated .atom {
  opacity: 0;
  animation: fadeAtom 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

@keyframes drawBond {
  to { stroke-dashoffset: 0; }
}

@keyframes fadeAtom {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   8. FORMS & INPUTS
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.775rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-label-dark {
  color: #CBD5E1;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-family: var(--font-body);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: #FFFFFF;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 78, 162, 0.15);
}

.form-control-dark {
  background-color: #0E204A;
  border-color: #334155;
  color: #FFFFFF;
}

.form-control-dark:focus {
  border-color: var(--highlight);
  box-shadow: 0 0 0 3px rgba(18, 181, 166, 0.25);
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* ==========================================================================
   9. TABLES
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  text-align: left;
}

.table th {
  background-color: #F8FAFC;
  color: var(--text);
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border);
}

.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: #334155;
}

.table tr:hover td {
  background-color: #F8FAFC;
}

/* ==========================================================================
   10. FOOTER & FLOATING ACTIONS
   ========================================================================== */
.main-footer {
  background: var(--dark);
  color: #94A3B8;
  padding: 4.5rem 0 2rem;
  font-size: 0.8125rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-title {
  color: #FFFFFF;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-heading);
}

.footer-links {
  list-style: none;
  line-height: 2.2;
}

.footer-links a {
  color: #94A3B8;
}

.footer-links a:hover {
  color: #FFFFFF;
}

.footer-bottom {
  border-top: 1px solid #1E293B;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem;
}

.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #10B981;
  color: #FFFFFF !important;
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  z-index: 99;
  transition: transform 0.2s, box-shadow 0.2s;
}

.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* ==========================================================================
   11. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .hero-title {
    font-size: 2.25rem;
  }
  .nav-links {
    display: none; /* Fallback for simple view */
  }
}

@media (max-width: 768px) {
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.45rem; }
  .section { padding: 2.5rem 0; }
  .grid-responsive {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
