/* ====================================
   CHEMISTRY CONTENT STYLES
   Works with existing header/footer/breadcrumbs
   Mobile-first responsive design
   ==================================== */

/* ===== CSS VARIABLES - CHEMISTRY THEME ===== */
:root {
  /* Primary Colors - Using theme variables */
  --chem-primary: var(--math-primary);        /* Deep blue */
  --chem-secondary: var(--math-secondary);    /* Medium blue */
  --chem-accent: var(--math-accent);          /* Amber */
  --chem-light: var(--math-highlight);        /* Light blue background */
  --chem-highlight: var(--math-card-alt);     /* Soft blue highlight */
  --chem-success: var(--math-success);        /* Green */
  --chem-warning: var(--math-warning);        /* Red */
  --chem-text: var(--math-text);              /* Dark blue-black */
  --chem-text-light: var(--math-text-light);  /* Medium blue-gray */
  --chem-border: var(--math-border);          /* Light blue border */
  --chem-card-bg: var(--math-card-bg);        /* White */
  
  /* Gradients */
  --gradient-primary: var(--math-gradient-1);
  --gradient-light: linear-gradient(135deg, var(--math-highlight) 0%, var(--math-card-alt) 100%);
  --gradient-accent: var(--math-gradient-2);
  
  /* Shadows */
  --card-shadow: 0 4px 12px rgba(13, 71, 161, 0.08);
  --hover-shadow: 0 8px 20px rgba(13, 71, 161, 0.15);
  
  /* Spacing - consistent with site */
  --space-xs: 0.25rem;    /* 4px */
  --space-sm: 0.5rem;     /* 8px */
  --space-md: 1rem;       /* 16px */
  --space-lg: 1.5rem;     /* 24px */
  --space-xl: 2rem;       /* 32px */
  --space-xxl: 3rem;      /* 48px */
  
  /* Typography */
  --font-size-xs: 0.75rem;    /* 12px */
  --font-size-sm: 0.875rem;   /* 14px */
  --font-size-md: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;   /* 18px */
  --font-size-xl: 1.25rem;    /* 20px */
  --font-size-xxl: 1.5rem;    /* 24px */
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-xxl: 24px;
  --radius-round: 9999px;
}

/* ===== LUCIDE ICON STYLING ===== */
i[data-lucide] {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  transition: all 0.2s ease;
}

.chem-hero i[data-lucide],
.chem-card-icon i[data-lucide],
.chem-note-icon i[data-lucide],
.chem-fact-icon i[data-lucide] {
  width: 28px;
  height: 28px;
}

.chem-btn i[data-lucide] {
  width: 18px;
  height: 18px;
  margin-right: 6px;
}

/* ===== CHEMISTRY HERO SECTION ===== */
.chem-hero {
  background: var(--gradient-primary);
  color: white;
  padding: var(--space-xl) var(--space-md);
  border-radius: var(--radius-xxl);
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.chem-hero::before {
  content: "⚛️";
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 8rem;
  opacity: 0.1;
  transform: rotate(15deg);
  pointer-events: none;
  line-height: 1;
}

.chem-hero h1 {
  color: white;
  margin-bottom: var(--space-sm);
  position: relative;
  z-index: 1;
}

.chem-hero-subtitle {
  font-size: var(--font-size-lg);
  opacity: 0.9;
  margin-bottom: var(--space-md);
  max-width: 800px;
  position: relative;
  z-index: 1;
}

.chem-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-round);
  font-size: var(--font-size-sm);
  font-weight: 500;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 1;
}

/* ===== NOTE BOXES ===== */
.chem-note-box {
  background: var(--chem-card-alt);
  border-left: 4px solid var(--chem-primary);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  flex-wrap: wrap;
  width: 100%;
  border: 1px solid var(--chem-border);
}

.chem-note-icon {
  width: 40px;
  height: 40px;
  background: var(--chem-card-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: var(--card-shadow);
  color: var(--chem-primary);
}

.chem-note-content {
  flex: 1;
  min-width: 200px;
}

.chem-note-content p:last-child {
  margin-bottom: 0;
}

/* ===== SECTION STYLES ===== */
.chem-section {
  background: var(--chem-card-bg);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  border: 1px solid var(--chem-border);
  box-shadow: var(--card-shadow);
  width: 100%;
  overflow: hidden;
}

.chem-section h2 {
  color: var(--chem-primary);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--chem-light);
}

.chem-section h3 {
  color: var(--chem-secondary);
  margin-bottom: var(--space-md);
}

/* ===== GRID SYSTEMS - MOBILE FIRST ===== */
.chem-grid-2col,
.chem-grid-3col,
.chem-grid-4col,
.chem-grid-auto {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile */
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  width: 100%;
}

/* Tablet (640px and up) */
@media screen and (min-width: 640px) {
  .chem-grid-2col {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .chem-grid-4col {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .chem-grid-auto {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop (992px and up) */
@media screen and (min-width: 992px) {
  .chem-grid-3col {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .chem-grid-4col {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .chem-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* ===== CARDS ===== */
.chem-card {
  background: var(--chem-card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--chem-border);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.chem-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow);
  border-color: var(--chem-secondary);
}

.chem-card-icon {
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
  flex-shrink: 0;
}

.chem-card-icon i[data-lucide] {
  width: 28px;
  height: 28px;
}

.chem-card-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--chem-primary);
  margin-bottom: var(--space-sm);
}

.chem-card-content {
  flex: 1;
  color: var(--chem-text);
}

.chem-card-footer {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--chem-light);
}

/* ===== CHEMICAL FORMULA STYLES ===== */
.chem-formula {
  font-family: 'Courier New', monospace, 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
  background: var(--chem-light);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  font-size: 0.95em;
  line-height: 1.4;
  color: var(--chem-text);
}

.subscript {
  font-size: 0.75em;
  vertical-align: sub;
  line-height: 0;
  display: inline-block;
}

.superscript {
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
  display: inline-block;
}

.chem-equation {
  background: var(--chem-light);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  text-align: center;
  font-size: var(--font-size-lg);
  margin: var(--space-md) 0;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  font-family: 'Courier New', monospace, 'SF Mono', Monaco, monospace;
  color: var(--chem-text);
  border: 1px solid var(--chem-border);
}

.chem-equation::-webkit-scrollbar {
  height: 4px;
}

.chem-equation::-webkit-scrollbar-thumb {
  background: var(--chem-secondary);
  border-radius: var(--radius-round);
}

/* ===== PERIODIC TABLE STYLES ===== */
.periodic-table {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xs);
  margin: var(--space-lg) 0;
  width: 100%;
}

@media screen and (min-width: 480px) {
  .periodic-table {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media screen and (min-width: 768px) {
  .periodic-table {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media screen and (min-width: 992px) {
  .periodic-table {
    grid-template-columns: repeat(12, 1fr);
  }
}

@media screen and (min-width: 1200px) {
  .periodic-table {
    grid-template-columns: repeat(18, 1fr);
  }
}

.element-card {
  background: var(--chem-card-bg);
  border: 1px solid var(--chem-border);
  border-radius: var(--radius-sm);
  padding: var(--space-xs);
  text-align: center;
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: all 0.2s ease;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--chem-text);
}

.element-card:hover {
  background: var(--chem-light);
  transform: scale(1.05);
  z-index: 10;
  border-color: var(--chem-primary);
}

.element-symbol {
  font-weight: 700;
  font-size: var(--font-size-md);
  line-height: 1.2;
}

.element-number {
  color: var(--chem-text-light);
  font-size: var(--font-size-xs);
  line-height: 1.2;
}

.element-name {
  display: none; /* Hide on mobile */
}

@media screen and (min-width: 768px) {
  .element-name {
    display: block;
    font-size: var(--font-size-xs);
  }
}

/* ===== TABLES ===== */
.chem-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-lg) 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--chem-border);
  background: var(--chem-card-bg);
  width: 100%;
}

.chem-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px; /* Forces scroll on mobile */
  font-size: var(--font-size-sm);
}

.chem-table th {
  background: var(--gradient-primary);
  color: white;
  padding: var(--space-md);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.chem-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--chem-light);
  color: var(--chem-text);
}

.chem-table tr:last-child td {
  border-bottom: none;
}

.chem-table tr:hover {
  background: var(--chem-light);
}

@media screen and (min-width: 768px) {
  .chem-table {
    min-width: 100%;
    font-size: var(--font-size-md);
  }
}

/* ===== PROCESS STEPS ===== */
.chem-process-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  width: 100%;
}

@media screen and (min-width: 768px) {
  .chem-process-steps {
    flex-direction: row;
  }
}

.chem-step {
  flex: 1;
  background: var(--chem-card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  border: 1px solid var(--chem-border);
  position: relative;
  transition: all 0.3s ease;
}

.chem-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow);
}

.chem-step-number {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto var(--space-md);
  font-size: var(--font-size-lg);
}

/* ===== HIGHLIGHT BOX ===== */
.chem-highlight {
  background: var(--chem-card-alt);
  border-left: 4px solid var(--chem-accent);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
  width: 100%;
  border: 1px solid var(--chem-border);
}

.chem-highlight strong {
  color: var(--chem-accent);
}

/* ===== TERMINOLOGY BOX ===== */
.chem-terminology {
  background: var(--chem-card-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  width: 100%;
  border: 1px solid var(--chem-border);
}

.chem-term-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

@media screen and (min-width: 640px) {
  .chem-term-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.chem-term-item {
  background: var(--chem-card-bg);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--chem-primary);
  font-size: var(--font-size-sm);
  color: var(--chem-text);
}

.chem-term {
  font-weight: 700;
  color: var(--chem-primary);
}

/* ===== KEY TERMS CLOUD ===== */
.chem-terms-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: var(--space-lg) 0;
  width: 100%;
}

.chem-term-tag {
  background: var(--chem-light);
  color: var(--chem-primary);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-round);
  font-size: var(--font-size-sm);
  border: 1px solid var(--chem-border);
  transition: all 0.2s ease;
  cursor: default;
}

.chem-term-tag:hover {
  background: var(--chem-primary);
  color: white;
  transform: translateY(-2px);
}

/* ===== FORMULAE CARDS ===== */
.chem-formulae-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  width: 100%;
}

@media screen and (min-width: 640px) {
  .chem-formulae-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (min-width: 992px) {
  .chem-formulae-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.chem-formula-card {
  background: var(--chem-card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  border: 2px solid var(--chem-border);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chem-formula-card:hover {
  border-color: var(--chem-primary);
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow);
}

.chem-formula-name {
  font-weight: 600;
  color: var(--chem-text);
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-md);
}

.chem-formula-display {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--chem-primary);
  margin: var(--space-sm) 0;
  font-family: 'Courier New', monospace, 'SF Mono', Monaco, monospace;
}

.chem-formula-desc {
  font-size: var(--font-size-sm);
  color: var(--chem-text-light);
}

/* ===== QUIZ STYLES ===== */
.chem-quiz-section {
  background: var(--chem-card-alt);
  border-radius: var(--radius-xxl);
  padding: var(--space-xl);
  margin: var(--space-xxl) 0;
  width: 100%;
  border: 1px solid var(--chem-border);
}

.chem-question-card {
  background: var(--chem-card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--card-shadow);
  border-left: 4px solid var(--chem-primary);
  width: 100%;
  border: 1px solid var(--chem-border);
}

.chem-question-text {
  font-weight: 500;
  margin-bottom: var(--space-md);
  font-size: var(--font-size-md);
  color: var(--chem-text);
}

.chem-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  margin: var(--space-lg) 0;
}

@media screen and (min-width: 640px) {
  .chem-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

.chem-option {
  background: var(--chem-light);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border: 2px solid transparent;
  font-size: var(--font-size-sm);
  min-height: 44px; /* Touch target size */
  color: var(--chem-text);
}

.chem-option:hover {
  background: var(--chem-highlight);
  transform: translateX(4px);
}

.chem-option input[type="radio"] {
  accent-color: var(--chem-primary);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
}

.chem-btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-round);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: var(--font-size-md);
  min-height: 44px;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
}

.chem-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--hover-shadow);
}

.chem-btn:active {
  transform: translateY(0);
}

.chem-feedback {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
  display: none;
  font-size: var(--font-size-sm);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chem-feedback.success {
  background: var(--math-success-bg);
  color: var(--chem-success);
  border-left: 4px solid var(--chem-success);
  display: block;
}

.chem-feedback.error {
  background: var(--math-warning-bg);
  color: var(--chem-warning);
  border-left: 4px solid var(--chem-warning);
  display: block;
}

/* ===== FILL IN BLANKS ===== */
.chem-blank-question {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.chem-blank-input {
  padding: var(--space-xs) var(--space-sm);
  border: 2px solid var(--chem-border);
  border-radius: var(--radius-md);
  width: 150px;
  font-size: var(--font-size-md);
  height: 44px;
  background: var(--chem-card-bg);
  color: var(--chem-text);
}

.chem-blank-input:focus {
  outline: none;
  border-color: var(--chem-primary);
  box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
}

@media screen and (max-width: 480px) {
  .chem-blank-question {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .chem-blank-input {
    width: 100%;
    max-width: 250px;
  }
}

/* ===== FLIP CARDS ===== */
.chem-flip-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  width: 100%;
}

@media screen and (min-width: 480px) {
  .chem-flip-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (min-width: 992px) {
  .chem-flip-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.chem-flip-card {
  background: transparent;
  height: 200px;
  perspective: 1000px;
  cursor: pointer;
}

.chem-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.chem-flip-card:hover .chem-flip-inner {
  transform: rotateY(180deg);
}

@media (hover: none) {
  .chem-flip-card:active .chem-flip-inner {
    transform: rotateY(180deg);
  }
}

.chem-flip-front, .chem-flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  box-shadow: var(--card-shadow);
}

.chem-flip-front {
  background: var(--gradient-primary);
  color: white;
}

.chem-flip-front h4 {
  color: white;
  margin: var(--space-sm) 0 0;
  font-size: var(--font-size-lg);
}

.chem-flip-back {
  background: var(--chem-card-bg);
  color: var(--chem-text);
  transform: rotateY(180deg);
  border: 2px solid var(--chem-primary);
  text-align: left;
  align-items: flex-start;
}

.chem-flip-back p {
  margin-bottom: var(--space-xs);
  font-size: var(--font-size-sm);
}

/* ===== PROGRESS TRACKER ===== */
.chem-progress {
  background: var(--chem-card-bg);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin: var(--space-xxl) 0;
  border: 1px solid var(--chem-border);
  width: 100%;
}

.chem-progress-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-md);
}

@media screen and (min-width: 768px) {
  .chem-progress-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.chem-progress-item {
  text-align: center;
}

.chem-progress-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--chem-light);
  margin: 0 auto var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-size-lg);
  border: 3px solid var(--chem-border);
  transition: all 0.3s ease;
  color: var(--chem-text);
}

.chem-progress-circle.completed {
  background: var(--gradient-primary);
  color: white;
  border-color: var(--chem-primary);
}

.chem-progress-label {
  font-size: var(--font-size-sm);
  color: var(--chem-text-light);
}

/* ===== FUN FACT BOX ===== */
.chem-fun-fact {
  background: var(--chem-card-alt);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin: var(--space-xxl) 0;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  width: 100%;
  border: 1px solid var(--chem-border);
}

.chem-fact-icon {
  width: 70px;
  height: 70px;
  background: var(--chem-card-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  box-shadow: var(--card-shadow);
  color: var(--chem-accent);
}

.chem-fact-content {
  flex: 1;
  min-width: 200px;
}

.chem-fact-content h4 {
  color: var(--chem-primary);
  margin-bottom: var(--space-xs);
}

/* ===== EXPERIMENT CARDS ===== */
.chem-experiment-card {
  background: var(--chem-card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 2px solid var(--chem-border);
  margin-bottom: var(--space-md);
  width: 100%;
  transition: all 0.3s ease;
}

.chem-experiment-card:hover {
  border-color: var(--chem-accent);
  box-shadow: var(--hover-shadow);
}

.chem-experiment-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.chem-experiment-badge {
  background: var(--chem-accent);
  color: white;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-round);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ===== SAFETY NOTES ===== */
.chem-safety {
  background: var(--math-warning-bg);
  border-left: 4px solid var(--chem-accent);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  margin: var(--space-lg) 0;
  width: 100%;
  border: 1px solid var(--chem-border);
}

.chem-safety h4 {
  color: var(--chem-accent);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

/* ===== SUMMARY SECTION ===== */
.chem-summary {
  background: var(--chem-card-alt);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin: var(--space-xxl) 0;
  width: 100%;
  border: 1px solid var(--chem-border);
}

.chem-summary-list {
  list-style: none;
  padding: 0;
}

.chem-summary-list li {
  padding: var(--space-sm) 0 var(--space-sm) 2rem;
  position: relative;
  border-bottom: 1px solid var(--chem-border);
  font-size: var(--font-size-md);
  color: var(--chem-text);
}

.chem-summary-list li:last-child {
  border-bottom: none;
}

.chem-summary-list li::before {
  content: "✓";
  color: var(--chem-success);
  font-weight: 700;
  position: absolute;
  left: 0;
  font-size: var(--font-size-lg);
}

/* ===== DOWNLOAD SECTION ===== */
.chem-download-section {
  background: var(--chem-card-alt);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  margin: var(--space-xxl) 0;
  text-align: center;
  width: 100%;
  border: 1px solid var(--chem-border);
}

.chem-download-btn {
  display: inline-block;
  background: var(--gradient-primary);
  color: white;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-round);
  font-weight: 600;
  text-decoration: none;
  margin-top: var(--space-md);
  transition: all 0.3s ease;
  min-width: 200px;
}

.chem-download-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow);
  color: white;
  text-decoration: none;
}

/* ===== TOPIC NAVIGATION ===== */
.topic-nav {
  display: flex;
  justify-content: space-between;
  margin: var(--space-xxl) 0;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--chem-border);
  border-bottom: 1px solid var(--chem-border);
  width: 100%;
}

.topic-nav a {
  color: var(--chem-primary);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.topic-nav a:hover {
  background: var(--chem-light);
  transform: translateY(-2px);
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }
.mt-5 { margin-top: var(--space-xxl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }
.mb-5 { margin-bottom: var(--space-xxl); }

.p-1 { padding: var(--space-sm); }
.p-2 { padding: var(--space-md); }
.p-3 { padding: var(--space-lg); }
.p-4 { padding: var(--space-xl); }

.w-100 { width: 100%; }

/* Hide/show utilities */
.hide-mobile {
  display: none;
}

@media screen and (min-width: 768px) {
  .hide-mobile {
    display: initial;
  }
  
  .show-mobile {
    display: none;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .chem-hero {
    background: white;
    color: black;
    border: 2px solid var(--chem-primary);
  }
  
  .chem-hero h1 {
    color: var(--chem-primary);
  }
  
  .chem-quiz-section,
  .chem-flip-card,
  .chem-btn,
  .topic-nav {
    display: none !important;
  }
  
  .chem-card,
  .chem-section,
  .chem-experiment-card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .chem-table-container {
    overflow: visible;
  }
  
  .chem-table {
    min-width: 100%;
  }
}