/* Ensure main content area background extends fully */
#main_content_area {
  min-height: 100% !important;
}

/* Dashboard specific fixes - allow natural page flow */
.drawer {
  min-height: 100vh;
}

/* Allow natural scrolling */
.drawer-content {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.drawer-content > div {
  flex: 1;
}

/* Mobile: allow scrolling */
@media (max-width: 1023px) {
  .drawer-content > div {
    overflow-y: auto;
  }
}

/* Desktop: allow natural scrolling with fixed sidebar */
@media (min-width: 1024px) {
  .drawer {
    min-height: 100vh;
  }
  
  .drawer-content {
    min-height: 100%;
  }
  
  /* Make sidebar fixed position on desktop */
  .drawer-side {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
}

/* Ensure grid items have proper minimum height */
.grid > * {
  min-height: 0;
}

/* Mobile: ensure dashboard cards have proper sizing */
@media (max-width: 1023px) {
  
  /* Ensure dashboard card content areas are properly sized - only target dashboard cards */
  .dashboard-content .card {
    min-height: auto;
    height: auto;
    max-height: none;
  }
  
  .dashboard-content .card-body {
    min-height: auto;
    height: auto;
    max-height: none;
  }
  
  /* Override dashboard grid constraints on mobile */
  .dashboard-grid {
    height: auto;
    max-height: none;
    min-height: auto;
  }
  
  .dashboard-grid > * {
    height: auto;
    max-height: none;
    min-height: auto;
  }
}

/* Medium screens: normal height */
@media (min-width: 768px) and (max-width: 1023px) {
  
  .dashboard-content .card {
    min-height: auto;
    height: auto;
    max-height: none;
  }
  
  .dashboard-content .card-body {
    min-height: auto;
    height: auto;
    max-height: none;
  }
  
  /* Override dashboard grid constraints on medium screens */
  .dashboard-grid {
    height: auto;
    max-height: none;
    min-height: auto;
  }
  
  .dashboard-grid > * {
    height: auto;
    max-height: none;
    min-height: auto;
  }
}

/* Fix the 1020px breakpoint issue - extend mobile rules to cover the gap */
@media (max-width: 1024px) {
  .dashboard-content .card {
    min-height: auto;
    height: auto;
    max-height: none;
  }
  
  .dashboard-content .card-body {
    min-height: auto;
    height: auto;
    max-height: none;
  }
  
  .dashboard-grid {
    height: auto;
    max-height: none;
    min-height: auto;
  }
  
  .dashboard-grid > * {
    height: auto;
    max-height: none;
    min-height: auto;
  }
}

/* Dashboard specific grid fixes for bottom row */
.dashboard-grid {
  display: grid;
  grid-template-rows: 1fr;
  align-items: stretch;
}

.dashboard-grid > * {
  min-height: auto;
}




/* Ensure dashboard cards maintain height after turbo updates */
.dashboard-content .card {
  min-height: auto;
}

.dashboard-content .card-body {
  min-height: auto;
}





/* Chat bubble vertical centering */
.chat-bubble {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 2.5rem;
}

.chat-bubble > div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.5rem;
}

/* Assessment page responsive styles */
@media (max-width: 640px) {
  /* Mobile styles for assessment questions */
  .card[data-controller="assessment"] {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 0.5rem !important; /* rounded-lg */
    padding: 1rem !important;
  }
  
  /* Question text - text-xl on mobile */
  .card[data-controller="assessment"] h2 {
    font-size: 1.25rem !important; /* text-xl */
    line-height: 1.4 !important;
    min-height: auto !important;
  }
  
  /* Answer options - text-md on mobile */
  .card[data-controller="assessment"] .grid button,
  .card[data-controller="assessment"] .grid div {
    font-size: 0.875rem !important; /* text-md */
    line-height: 1.4 !important;
  }
  
  /* Make options stack properly on mobile */
  .card[data-controller="assessment"] .grid {
    gap: 0.75rem !important;
  }
  
  /* Ensure buttons are touch-friendly */
  .card[data-controller="assessment"] button {
    min-height: 44px !important;
    padding: 0.75rem 1rem !important;
  }
}

/* Desktop styles to maintain consistent container size */
@media (min-width: 641px) {
  .card[data-controller="assessment"] {
    width: 40rem !important;
    height: 38rem !important;
    min-height: 38rem !important;
    max-height: 38rem !important;
  }
}

/* Intro page mobile styles */
@media (max-width: 640px) {
  /* Add rounded corners and make full width on mobile for intro page */
  #assessment_frame .card {
    border-radius: 0.5rem !important; /* rounded-lg */
    margin: 0 !important;
    margin-top: 1rem !important;
    border-left: none !important;
    border-right: none !important;
    border-top: 1px solid #d1d5db !important;
    border-bottom: 1px solid #d1d5db !important;
  }
  
  /* Ensure intro page scrolls to top */
  #assessment_frame {
    scroll-margin-top: 0 !important;
  }
  
  /* Force scroll to top for assessment pages */
  body:has(#assessment_frame) {
    scroll-behavior: smooth !important;
  }
}

/* Logo: moon glow in dark mode (Option 4) — not on homepage (force-light keeps lemonade there) */
html[data-theme="dark"] .navbar-logo {
  color: #fef3c7;
}
html[data-theme="dark"] .navbar-logo__accent {
  color: #94a3b8;
}
html[data-theme="dark"] .navbar-logo__emoji-light {
  display: none !important;
}
html[data-theme="dark"] .navbar-logo__emoji-dark {
  display: inline !important;
}

/* Focus page only: outer card band — uses --band-focus from the palette in shared.css */
.focus-page-card-outer {
  background-color: var(--band-focus, #34d399);
  box-shadow:
    -8px 0 20px -6px rgba(0, 0, 0, 0.08),
    8px 0 20px -6px rgba(0, 0, 0, 0.08),
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 10px 20px -5px rgba(0, 0, 0, 0.08),
    0 20px 40px -10px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}
html[data-theme="dark"] .focus-page-card-outer {
  background-color: oklch(55% 0.04 250);
  box-shadow:
    -8px 0 20px -6px rgba(0, 0, 0, 0.2),
    8px 0 20px -6px rgba(0, 0, 0, 0.2),
    0 4px 6px -1px rgba(0, 0, 0, 0.2),
    0 10px 20px -5px rgba(0, 0, 0, 0.15),
    0 20px 40px -10px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Focus page: Fizzy-style card typography, spacing, inner shadow (all sides) */
.focus-card-inner {
  border-top: 3px solid oklch(var(--p) / 0.35);
  box-shadow:
    -4px 0 12px -2px rgba(0, 0, 0, 0.04),
    4px 0 12px -2px rgba(0, 0, 0, 0.04),
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 6px 12px rgba(0, 0, 0, 0.05);
}
html[data-theme="dark"] .focus-card-inner {
  box-shadow:
    -4px 0 12px -2px rgba(0, 0, 0, 0.2),
    4px 0 12px -2px rgba(0, 0, 0, 0.2),
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 6px 12px rgba(0, 0, 0, 0.15);
}

.focus-card-inner__title {
  font-size: clamp(1.375rem, 5vw, 1.875rem);
  font-weight: 800;
  line-height: 1.25;
  color: oklch(var(--bc));
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.02em;
}

.focus-card-inner__description {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: oklch(var(--bc) / 0.8);
  margin: 0;
}

.focus-card-inner__details-summary {
  font-size: 0.9375rem;
  font-weight: 600;
  color: oklch(var(--bc) / 0.75);
}

.focus-card-inner__details-summary:hover {
  color: oklch(var(--bc));
}

/* Focus page: "To do" pill — contrast on lemonade band */
.focus-card-todo-pill {
  background-color: rgba(255, 255, 255, 0.95);
  color: #047857;
  border: 1.5px solid #059669;
}
html[data-theme="dark"] .focus-card-todo-pill {
  background-color: rgba(255, 255, 255, 0.2);
  color: #6ee7b7;
  border: 1.5px solid #34d399;
}

/* Focus page: Mark Complete button (default) — theme accent */
.focus-complete-btn--state:not(.btn-success) {
  background-color: oklch(var(--a));
  border-color: oklch(var(--a));
  color: oklch(var(--ac));
}
.focus-complete-btn--state:not(.btn-success):hover {
  background-color: color-mix(in oklch, oklch(var(--a)) 90%, black);
  border-color: color-mix(in oklch, oklch(var(--a)) 90%, black);
  color: oklch(var(--ac));
}

/* Focus page: Completed button — light green tint (lemonade) */
.focus-complete-btn.btn-success {
  background-color: #a7f3d0;
  border-color: #6ee7b7;
  color: #065f46;
}
.focus-complete-btn.btn-success:hover {
  background-color: #6ee7b7;
  border-color: #34d399;
  color: #064e3b;
}

/* Focus page: Mark Complete in dark theme — theme accent (same as light) */
html[data-theme="dark"] .focus-complete-btn--state:not(.btn-success) {
  background-color: oklch(var(--a)) !important;
  border-color: oklch(var(--a));
  color: oklch(var(--ac));
}
html[data-theme="dark"] .focus-complete-btn--state:not(.btn-success):hover {
  background-color: color-mix(in oklch, oklch(var(--a)) 85%, white) !important;
  border-color: color-mix(in oklch, oklch(var(--a)) 85%, white);
  color: oklch(var(--ac));
}
html[data-theme="dark"] .focus-complete-btn.btn-success {
  background-color: #064e3b !important;
  border-color: #10b981;
  color: #a7f3d0;
}
html[data-theme="dark"] .focus-complete-btn.btn-success:hover {
  background-color: #065f46 !important;
  color: #d1fae5;
}

html[data-theme="dark"] .focus-card-inner {
  border-top-color: oklch(var(--p) / 0.5);
}

/* Focus page: Today's Progress expandable — hide default summary marker */
.focus-progress-details summary::-webkit-details-marker {
  display: none;
}
.focus-progress-details summary::marker {
  content: none;
}

/* App menu (Fizzy-style): single-button menu with sections */
.app-menu {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.app-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--cream-border, #E8DFC9);
  flex-shrink: 0;
}
.app-menu__header--search {
  gap: 0.5rem;
  border-bottom: none;
}
.app-menu__header--search .app-menu__search {
  padding: 0;
  border-bottom: none;
}
.app-menu__search {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--cream-border, #E8DFC9);
  flex-shrink: 0;
}
.app-menu__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
}
.app-menu__section {
  margin-bottom: 1.25rem;
}
.app-menu__section:first-child {
  margin-top: 0.75rem;
}
.app-menu__section:last-child {
  margin-bottom: 0;
}
.app-menu__section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cream-muted, rgba(42, 36, 25, 0.55));
  margin: 0 0 0.5rem 0;
  padding: 0;
}
.app-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.app-menu__item {
  margin: 0;
}
.app-menu__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 0;
  border-radius: 0.375rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--cream-ink, #2A2419);
  width: 100%;
  text-align: left;
}
.app-menu__link:hover {
  background-color: var(--cream-warm, rgba(232, 223, 201, 0.45));
}
/* Match Account item row height to Navigate so vertical spacing is consistent */
.app-menu__section--account .app-menu__link {
  min-height: 2.5rem;
}
.app-menu__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}
.app-menu__icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  flex-shrink: 0;
  color: var(--cream-muted, rgba(42, 36, 25, 0.75));
}
.app-menu__footer {
  padding: 1rem;
  border-top: 1px solid var(--cream-border, #E8DFC9);
  flex-shrink: 0;
}
.app-menu__user {
  margin: 0 0 0.5rem 0;
}
.app-menu-dialog {
  /* Reset native <dialog> defaults */
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  /* Full-screen overlay container — same approach as DaisyUI .modal */
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.app-menu-dialog[open] {
  display: flex;
}
.app-menu-dialog::backdrop {
  background: oklch(0 0 0 / 0.4);
}
.app-menu-dialog > .app-menu {
  background: var(--cream-soft, #FDFAF3);
  max-width: 28rem;
  width: calc(100% - 2rem);
  max-height: calc(100dvh - 4rem);
  border-radius: 1rem;
  border: 1px solid var(--cream-border, #E8DFC9);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

