/* ====== Condensa Docs — Light EHR Theme (Mobile Optimized) ====== */
* {
  box-sizing: border-box;
  scroll-behavior: smooth;
  font-family: "Inter", "Segoe UI", sans-serif;
}

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
  background-color: #ffffff;
  color: #222;
}

/* ===== Sidebar ===== */
nav {
  width: 260px;
  background: #f8f9fb;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid #e0e0e0;
  box-shadow: 2px 0 5px rgba(0,0,0,0.05);
  z-index: 1000;
}

nav h2 {
  font-size: 1.3em;
  margin-bottom: 20px;
  color: #004aad;
  font-weight: 700;
  letter-spacing: -0.5px;
}

nav a {
  text-decoration: none;
  color: #444;
  padding: 10px 14px;
  border-radius: 8px;
  transition: 0.25s ease;
  font-size: 0.96em;
  margin-bottom: 4px;
}

nav a:hover {
  background: #e9f2ff;
  color: #004aad;
}

nav a.active {
  background: #004aad;
  color: #fff;
  font-weight: 600;
}

/* ===== Main Content ===== */
main {
  margin-left: 280px;
  padding: 48px 40px;
  max-width: 950px;
  line-height: 1.7;
  transition: margin-left 0.3s ease;
}

h1, h2, h3 {
  color: #111;
  font-weight: 700;
  letter-spacing: -0.3px;
}

h1 {
  font-size: 1.9em;
  margin-top: 0;
}

h2 {
  margin-top: 1.8em;
  font-size: 1.4em;
  border-bottom: 2px solid #e3e9f3;
  padding-bottom: 4px;
}

h3 {
  font-size: 1.15em;
  color: #004aad;
}

p, li {
  color: #333;
  font-size: 0.98em;
}

/* ===== Code & Preformatted ===== */
pre, code {
  background: #f4f6f8;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 10px 12px;
  color: #1a237e;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9em;
  word-wrap: break-word;
  overflow-x: auto;
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  overflow: hidden;
}

th {
  background: #f2f5fa;
  color: #004aad;
  font-weight: 600;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #e9ecef;
}

ul, ol {
  margin: 0 0 1em 1.2em;
}

footer {
  margin-top: 50px;
  padding-top: 12px;
  border-top: 1px solid #e1e4e8;
  color: #666;
  font-size: 0.9em;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* ===== Responsive (iPhone 12 Pro Max & iPhone 16e) ===== */
@media (max-width: 1024px) {
  main {
    margin-left: 0;
    padding: 40px 24px;
  }
  nav {
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-evenly;
    border-right: none;
    border-bottom: 1px solid #ddd;
    padding: 12px 10px;
    box-shadow: none;
    position: fixed;
    top: 0;
  }
  nav h2 {
    display: none;
  }
  nav a {
    padding: 8px 12px;
    font-size: 0.9em;
    color: #004aad;
    margin: 2px;
    border-radius: 6px;
  }
  main {
    padding-top: 80px;
  }
}

/* ===== Ultra Mobile (iPhone 12 Pro Max / 16e Width < 480px) ===== */
@media (max-width: 480px) {
  body {
    flex-direction: column;
    font-size: 15px;
  }

  nav {
    padding: 10px 6px;
    justify-content: space-between;
    overflow-x: auto;
    scrollbar-width: none;
  }
  nav::-webkit-scrollbar {
    display: none;
  }

  nav a {
    white-space: nowrap;
    font-size: 0.85em;
    padding: 8px 10px;
    margin: 2px 4px;
    flex-shrink: 0;
  }

  main {
    padding: 70px 16px 40px 16px;
    line-height: 1.6;
  }

  h1 {
    font-size: 1.4em;
  }

  h2 {
    font-size: 1.2em;
  }

  code, pre {
    font-size: 0.85em;
    padding: 8px 10px;
  }

  table, th, td {
    font-size: 0.85em;
    padding: 8px;
  }

  footer {
    font-size: 0.8em;
    padding-bottom: 20px;
  }
}

/* ===== Cookie Consent (Centered Bottom) ===== */
#cookie-consent {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 15px);
  width: 420px;
  max-width: 90%;
  background: #ffffff;
  border: 1px solid #e1e4e8;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 20px 24px;
  font-size: 0.95em;
  color: #333;
  z-index: 999999999 !important;
  opacity: 0;
  transition: all 0.4s ease;
}

#cookie-consent.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

#cookie-consent p {
  margin: 0 0 14px 0;
  line-height: 1.5;
}

#cookie-consent a {
  color: #004aad;
  text-decoration: none;
}

#cookie-consent a:hover {
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cookie-buttons button {
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.9em;
  cursor: pointer;
  transition: 0.25s;
  font-weight: 500;
}

#accept-cookies {
  background-color: #004aad;
  color: white;
}

#accept-cookies:hover {
  background-color: #003a88;
}

#decline-cookies {
  background-color: #f1f3f5;
  color: #333;
}

#decline-cookies:hover {
  background-color: #e5e8ea;
}

/* ===== Cookie Icon (Minimized State) ===== */
#cookie-icon {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: #ffffff;
  border: 1px solid #e1e4e8;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6em;
  cursor: pointer;
  z-index: 999999999 !important;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

#cookie-icon.show {
  opacity: 1;
  transform: scale(1);
}

.hidden {
  display: none !important;
}

/* ===== Responsive Cookie Banner ===== */
@media (max-width: 600px) {
  #cookie-consent {
    left: 50%;
    bottom: 16px;
    width: 94%;
    padding: 16px 18px;
    font-size: 0.9em;
  }

  .cookie-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-buttons button {
    width: 100%;
  }
}

