/* Clean, responsive header + navigation for Chemistry pages */
.chem-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
    color: #e6eef6;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

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

.back-to-main {
    text-decoration: none;
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1);
}

.back-to-main:hover {
    background: rgba(255,255,255,0.1) !important;
}

.site-title {
    font-size: 0.75rem;
    margin: 0;
    font-weight: 600;
    writing-mode: horizontal-tb;
    transform: none;
    text-align: right;
    line-height: 1;
    padding-top: 2px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px rgba(16,185,129,0.4);
}

/* Nav groups: align items in rows and collapse on small screens */
.chem-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex: 1 1 auto;
    justify-content: center;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    color: inherit;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
}

.nav-groups-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease;
    font-weight: 600;
}

.nav-btn .btn-icon {
    font-size: 1.05rem;
    opacity: 0.95;
}

.nav-btn .btn-text {
    display: none; /* hide text by default to save header space */
    font-size: 0.9rem;
}

/* Always show text for dropdown buttons to indicate they are dropdowns */
.nav-btn.dropdown-toggle .btn-text {
    display: inline-block !important;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.03);
    transform: translateY(-1px);
}

/* Right header controls */
.header-right {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

/* Larger screens: show nav text labels */
@media (min-width: 900px) {
    .nav-btn .btn-text { display: inline-block; }
}

/* Small screens: collapse nav to a single overflowable row */
@media (max-width: 640px) {
    .chem-header { padding: 0.5rem; }
    .nav-group { gap: 0.25rem; }
    .nav-btn { padding: 0.4rem; }
    .site-title { font-size: 1rem; }
    .nav-toggle { display: inline-block; }
    .nav-groups-wrapper { display: none; flex-direction: column; position: absolute; top: 56px; left: 8px; right: 8px; background: rgba(15,23,42,0.95); padding: 0.5rem; border-radius: 8px; z-index: 60; }
    .nav-group { flex-wrap: wrap; justify-content: center; }
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background: rgba(15,23,42,0.95);
    min-width: 280px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 5000;
    border-radius: 8px;
    padding: 8px 0;
    border: 1px solid rgba(255,255,255,0.1);
}

.dropdown.show .dropdown-content {
    display: block;
}

.dropdown-content .dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    font-size: 0.9em;
    border: none;
    background: none;
    cursor: pointer;
    color: #e6eef6;
    font-weight: 500;
    transition: background 0.15s ease;
}

.dropdown-content .dropdown-item:hover {
    background-color: rgba(255,255,255,0.1);
}

/* ====================
   CHEMISTRY GUIDANCE BANNER (Persistent, Dismissible)
   ==================== */

.chemistry-guidance-banner {
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
  border-bottom: 2px solid rgba(16, 185, 129, 0.5);
  backdrop-filter: blur(10px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  padding: 0;
  max-height: 0;
  overflow: hidden;
}

.chemistry-guidance-banner.visible {
  opacity: 1;
  pointer-events: auto;
  max-height: 80px;
  padding: 12px 20px;
}

.guidance-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.guidance-banner-steps {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
}

.guidance-step {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.guidance-step strong {
  color: #10b981;
  font-weight: 600;
  font-size: 0.95rem;
}

.guidance-banner-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
}

.guidance-banner-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.05);
}

.guidance-banner-close:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .chemistry-guidance-banner.visible {
    max-height: 120px;
    padding: 10px 16px;
  }

  .guidance-banner-steps {
    gap: 16px;
  }

  .guidance-step {
    font-size: 0.8rem;
  }

  .guidance-banner-content {
    flex-direction: column;
    align-items: flex-start;
  }
}
