/* Home page styles — no external libraries, small and responsive */

.home-container {
  max-width: 980px;
  margin: 32px auto;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #222;
}

.home-hero {
  text-align: center;
  padding: 28px 12px;
}

.brand {
  font-size: 2.6rem;
  margin: 0;
  letter-spacing: -0.5px;
  color: #0b4a6f;
}

.tagline {
  color: #3b4b5a;
  margin-top: 6px;
  font-size: 1.06rem;
}

.summary {
  background: linear-gradient(180deg, rgba(11,74,111,0.03), rgba(11,74,111,0.02));
  border-radius: 8px;
  padding: 18px 20px;
  margin: 12px 0 20px 0;
}

.summary h2 {
  margin: 0 0 6px 0;
  font-weight: 600;
}

.summary p { margin: 0; color: #2f3e48; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.tool-card {
  background: #fff;
  border: 1px solid rgba(11,74,111,0.06);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(18,28,36,0.03);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.tool-card:hover { transform: translateY(-6px); box-shadow: 0 10px 30px rgba(18,28,36,0.06); }

.tool-card h3 { margin: 0 0 6px 0; color: #0b4a6f; }
.tool-card p { margin: 0 0 12px 0; color: #3b4b5a; font-size: .95rem; }

.button {
  display: inline-block;
  text-decoration: none;
  background: linear-gradient(180deg,#2f8ccf,#0b6db0);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 600;
}
.button:hover { opacity: 0.95; }

.home-footer { margin-top: 22px; text-align: center; }
.muted { color: #6b7883; font-size: .92rem; }

/* Slightly larger section titles on the home page */
.tool-section h2.muted { font-size: 1.12rem; font-weight: 700; margin-bottom: 8px; }

@media (max-width: 520px) {
  .brand { font-size: 2rem; }
  .home-container { padding: 14px; margin: 18px auto; }
  .tool-section h2.muted { font-size: 1.02rem; font-weight: 700; }
}

/* Dark mode — scoped just to the home page container
   Toggle by adding/removing .dark on .home-container */
.home-container.dark {
  background: transparent; /* background handled by full-viewport element & body */
  color: #e6eef6;
  position: relative;
  z-index: 1;
}

.home-container.dark .home-hero { background: transparent; }
.home-container.dark .brand { color: #d9f4ff; }
.home-container.dark .tagline { color: #9fbcd3; }
.home-container.dark .muted { color: #9bb0bf; }

/* Improve section headings contrast in dark mode */
.home-container.dark .tool-section h2.muted {
  /* Use a brighter color for better visibility */
  color: #e8fbff;
  text-shadow: none; /* remove shadow to keep text crisp */
  font-weight: 700;
}

.home-container.dark .summary { background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)); }

.home-container.dark .tool-card {
  /* Slightly lighter than the full viewport background so cards are visible */
  background: #0b2a34;
  border: 1px solid rgba(255,255,255,0.06);
  /* Default to the hovered look so cards are clearly visible in dark mode */
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(4,10,14,0.6);
  transition: transform 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
}
.home-container.dark .tool-card h3 { color: #e8fbff; }
.home-container.dark .tool-card p { color: #bcdde8; }
.home-container.dark .tool-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(4,10,14,0.7); }

.home-container.dark .button { background: linear-gradient(180deg,#2f8ccf,#6ab7ff); color: #fff; }
.home-container.dark .button:hover { opacity: 0.95; }

/* Dark mode specific toggle styles inside the header */
.home-hero { position: relative; }
.home-dark-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-size: 1rem;
}
.home-dark-toggle:hover { opacity: 0.9; }

/* Switch UI */
.home-dark-toggle .switch {
  display: inline-block;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  position: relative;
  background: linear-gradient(180deg, #e9eef4, #d7e6ef);
  border: 1px solid rgba(16,54,80,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  transition: background 220ms ease, border-color 220ms ease;
}
.home-dark-toggle .switch .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 6px 12px rgba(4,10,14,0.12);
  transition: transform 220ms cubic-bezier(.2,.9,.3,1), background 220ms ease;
}
.home-dark-toggle .icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  opacity: 0.9;
}
.home-dark-toggle .icon.sun { left: 6px; }
.home-dark-toggle .icon.moon { right: 6px; }
.home-container.dark .home-dark-toggle { 
  border: 1px solid rgba(255,255,255,0.2);
  color: #e6eef6;
  background: rgba(255,255,255,0.05);
  padding: 4px;
  border-radius: 20px;
}
.home-dark-toggle[aria-pressed="true"] .switch { background: linear-gradient(180deg, #0f3241, #071521); border-color: rgba(255,255,255,0.06); }
.home-dark-toggle[aria-pressed="true"] .switch .knob { transform: translateX(20px); background: #0b2a34; }
.home-dark-toggle[aria-pressed="true"] .icon.sun { opacity: 0; }
.home-dark-toggle[aria-pressed="true"] .icon.moon { opacity: 1; }
.home-dark-toggle .icon.moon { opacity: 0; }
/* Full-viewport dark background when `.home-container.dark` is present
   We use a fixed pseudo-element to expand the background edge-to-edge while keeping
   the content in the centered container. We also set `body.home-dark` so that
   scrollbars and the page chrome are not bright during dark mode. */
body.home-dark { background: #071521; }
.home-container.dark::before {
  content: "";
  position: fixed;
  inset: 0; /* top:0; left:0; right:0; bottom:0 */
  background: #071521;
  z-index: 0; /* behind the home-container's z-index */
  pointer-events: none;
}

@media (max-width: 520px) {
  .home-dark-toggle { top: 6px; right: 8px; padding: 6px 8px; }
}

/* Tool pages shared styles */

.tool-page .form-card { padding: 20px; margin: 0; }
.form-card .tool-input { width: 100%; border-radius: 8px; border: 1px solid rgba(11,74,111,0.12); padding: 10px 12px; font-size: 14px; font-family: inherit; box-sizing: border-box; }
.form-actions { margin-top: 10px; display:flex; gap:8px; align-items:center }
.output-wrap { margin-top: 12px; }
.result { white-space: pre-wrap; background: #f6f8fa; border-radius:6px; padding: 12px; border: 1px solid rgba(11,74,111,0.06); }
.button.small { padding: 6px 10px; font-size: 13px; }
.button.muted, .muted { color: #6b7883; background: transparent; border: none; }
.sr-only { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Blue light test specifics */
.bl-controls { display:flex; gap:12px; align-items:center; margin-bottom:12px }
.bl-panels { display:flex; gap:14px; flex-wrap:wrap; }
.panel { width: 240px; text-align:center; }
.swatch { height: 160px; border-radius:8px; border: 1px solid rgba(11,74,111,0.06); box-shadow: 0 6px 18px rgba(18,28,36,0.03); }
.swatch.original { background: linear-gradient(180deg, #1e90ff, #0b66b0); }
.swatch.filtered { background: linear-gradient(180deg, #1e90ff, #0b66b0); }

/* small helpers */
.small { font-size: 0.9rem; }

@media (max-width: 520px) {
  .panel { width: 100%; }
}

.form-help { background: #f1fbff; border-left: 3px solid #cceefc; padding: 10px 12px; border-radius: 6px; margin-bottom: 8px; color: #1b3b4d; }
.form-help ul { margin: 6px 0 0 18px; }
.form-help li { margin-bottom: 4px; }

/* drinks rows and headers */
.dr-header { display:flex; gap:8px; align-items:center; margin-top:8px; font-weight:600; color:#0b4a6f; padding:8px 4px; border-bottom:1px solid rgba(11,74,111,0.06); }
.dr-header .col { padding: 0 6px; }
.dr-header .type { flex: 1 1 160px; }
 /* removed servings & mg columns — simplified to Type + Hours */
.dr-header .hours { width:110px; }
.dr-header .actions { width:70px; text-align:center; }

.dr-row { display:flex; gap:8px; align-items:center; margin-top:8px; }
.dr-row .col { padding: 0 6px; }
.dr-row .col.type { flex: 1 1 160px; }
 /* removed servings & mg columns */
.dr-row .col.hours { width:110px; }
.dr-row .col.actions { width:70px; text-align:center; }
.dr-row .col select, .dr-row .col input { width:100%; box-sizing:border-box; padding:8px; border-radius:6px; border:1px solid rgba(11,74,111,0.08); }
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* Navbar Styles */
.main-navbar {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
}

.navbar-logo {
  color: #1f2937;
  text-decoration: none;
  transition: color 0.2s;
}

.navbar-logo:hover {
  color: #3b82f6;
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-right: -0.5rem;
}

.navbar-toggle-icon {
  width: 24px;
  height: 2px;
  background: #1f2937;
  transition: all 0.3s;
}

.navbar-menu {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.navbar-dropdown {
  position: relative;
}

.navbar-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-radius: 0.375rem;
  color: #374151;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.navbar-dropdown-toggle:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.dropdown-arrow {
  width: 12px;
  height: 8px;
  transition: transform 0.2s;
}

.navbar-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.navbar-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  min-width: 220px;
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 1001;
}

.navbar-dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.navbar-dropdown-item {
  display: block;
  padding: 0.625rem 1rem;
  color: #374151;
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.navbar-dropdown-item:hover {
  background: #f3f4f6;
  color: #1f2937;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .navbar-toggle {
    display: flex;
  }

  .navbar-menu {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }

  .navbar-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .navbar-dropdown {
    width: 100%;
  }

  .navbar-dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    border-radius: 0;
    padding: 0.75rem 1rem;
  }

  .navbar-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-top: 1px solid #f3f4f6;
    border-radius: 0;
    padding: 0;
    transform: none;
    background: #f9fafb;
  }

  .navbar-dropdown-menu.active {
    transform: none;
  }

  .navbar-dropdown-item {
    padding: 0.625rem 2rem;
    background: #f9fafb;
  }

  .navbar-dropdown-item:hover {
    background: #f3f4f6;
  }
}

/* Dark mode support for homepage */
.home-dark .main-navbar {
  background: #1f2937;
  border-bottom-color: #374151;
}

.home-dark .navbar-logo {
  color: #f9fafb;
}

.home-dark .navbar-logo:hover {
  color: #60a5fa;
}

.home-dark .navbar-toggle-icon {
  background: #f9fafb;
}

.home-dark .navbar-dropdown-toggle {
  color: #e5e7eb;
}

.home-dark .navbar-dropdown-toggle:hover {
  background: #374151;
  color: #f9fafb;
}

.home-dark .navbar-dropdown-menu {
  background: #1f2937;
  border-color: #374151;
}

.home-dark .navbar-dropdown-item {
  color: #e5e7eb;
}

.home-dark .navbar-dropdown-item:hover {
  background: #374151;
  color: #f9fafb;
}

@media (max-width: 768px) {
  .home-dark .navbar-menu {
    background: #1f2937;
    border-top-color: #374151;
  }

  .home-dark .navbar-dropdown-menu {
    background: #111827;
    border-top-color: #374151;
  }

  .home-dark .navbar-dropdown-item {
    background: #111827;
  }

  .home-dark .navbar-dropdown-item:hover {
    background: #374151;
  }
}
