/**
 * 나도 먹고 있어, 정신과약 - Responsive Layout & Component Structure
 * Aligned with Design.md (3-Column Desktop Grid & Mobile Bottom-Nav SPA)
 */

/* -------------------------------------------------------------
 * 1. Global App Container & Grid Layout
 * ----------------------------------------------------------- */
.app-container {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-base);
}

.app-wrapper {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  gap: var(--space-xl);
  width: 100%;
  max-width: 1200px;
  padding: var(--space-xl) var(--space-lg);
  margin: 0 auto;
}

/* -------------------------------------------------------------
 * 2. Desktop Left Sidebar Navigation
 * ----------------------------------------------------------- */
.desktop-sidebar {
  position: sticky;
  top: var(--space-xl);
  height: calc(100vh - (var(--space-xl) * 2));
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  overflow-y: auto;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  object-fit: contain;
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.25);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--color-mint);
  font-weight: 500;
}

/* Sidebar User Status Card (Desktop Sidebar) */
.sidebar-user-card {
  background: linear-gradient(145deg, rgba(38, 36, 60, 0.9) 0%, rgba(28, 26, 45, 0.95) 100%);
  border: 1px solid rgba(126, 207, 200, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.sidebar-user-card:hover {
  border-color: rgba(126, 207, 200, 0.45);
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.2);
}

.user-status-row,
.sidebar-user-header {
  display: flex;
  align-items: center;
  width: 100%;
}

.user-name-text {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  width: 100%;
  max-width: 100%;
}

.sidebar-user-level-row {
  display: flex;
  align-items: center;
}

.user-level-desc {
  font-size: 0.75rem;
  color: #A7A6BA;
  line-height: 1.4;
  word-break: keep-all;
  margin: 0;
}

.user-streak-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.user-streak-highlight {
  color: var(--color-green);
  font-weight: 600;
}

/* Nav Menu List */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
}

.nav-item-btn {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  transition: all var(--transition-fast);
}

.nav-item-btn:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.nav-item-btn.active {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 700;
  border-left: 3px solid var(--color-primary);
}

.nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-subtle);
}

.sidebar-login-btn {
  width: 100%;
}

/* -------------------------------------------------------------
 * 3. Central Main Stage
 * ----------------------------------------------------------- */
.main-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: var(--space-lg);
}

/* View Sections Switcher */
.view-section {
  display: none;
  flex-direction: column;
  gap: var(--space-lg);
  animation: fadeIn var(--transition-normal) ease-out;
}

.view-section.active {
  display: flex;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-xs);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Mobile Top Header (Hidden on Desktop) */
.mobile-top-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background-color: rgba(18, 17, 31, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-subtle);
}

/* -------------------------------------------------------------
 * 4. Desktop Right Sidebar (Widgets & Ads)
 * ----------------------------------------------------------- */
.desktop-right-panel {
  position: sticky;
  top: var(--space-xl);
  height: calc(100vh - (var(--space-xl) * 2));
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  overflow-y: auto;
}

.widget-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.widget-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.widget-garden-preview {
  height: 180px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at center, #25233D 0%, #151424 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
}

.garden-preview-canvas {
  width: 100%;
  height: 100%;
}

/* Sponsored Ad Widget Slot */
.ad-slot-card {
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  position: relative;
  text-align: center;
}

.ad-label {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.625rem;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

/* -------------------------------------------------------------
 * 5. Mobile Bottom Navigation Bar (< 768px)
 * ----------------------------------------------------------- */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background-color: rgba(29, 27, 46, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-subtle);
  z-index: 900;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  height: 100%;
  color: var(--text-secondary);
  font-size: 0.625rem;
  font-weight: 500;
  gap: 2px;
  padding: 4px 1px;
  transition: color var(--transition-fast);
}

.mobile-nav-btn span:last-child {
  white-space: nowrap;
  letter-spacing: -0.6px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.mobile-nav-btn.active {
  color: var(--color-primary);
  font-weight: 700;
}

.mobile-nav-btn.active .mobile-nav-icon {
  transform: translateY(-2px);
  color: var(--color-primary);
}

.mobile-nav-icon {
  font-size: 1.3rem;
  line-height: 1;
  transition: transform var(--transition-fast);
}

/* -------------------------------------------------------------
 * 6. View Components (Diary, Feed, Report, Profile)
 * ----------------------------------------------------------- */

/* [View: Diary] */
.slots-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.slot-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.slot-card:hover {
  border-color: var(--border-medium);
}

/* Active Slot purple focus border according to Design.md */
.slot-card.active {
  border: 2px solid var(--border-active-slot) !important;
  background-color: var(--bg-surface-active);
  box-shadow: 0 0 16px rgba(124, 77, 255, 0.25);
}

.slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.slot-title-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.slot-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.slot-active-tag {
  display: none;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--border-focus);
  background-color: rgba(124, 77, 255, 0.15);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.slot-card.active .slot-active-tag {
  display: inline-block;
}

.slot-pills-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  min-height: 32px;
  align-items: center;
}

.slot-empty-hint {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  font-style: normal;
}

/* Quick Drug Chips Picker */
.quick-chips-section {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.quick-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--space-sm);
}

/* Mood & Symptom Tag Selector */
.tags-section-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.tags-group-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tags-chips-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* [View: Feed] */
.feed-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.feed-cards-stream {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.feed-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color var(--transition-fast);
}

.feed-card:hover {
  border-color: var(--border-medium);
}

.feed-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.feed-author-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.feed-author-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.feed-timestamp {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.feed-drugs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-sm);
}

.feed-body-text {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  word-break: break-word;
}

.feed-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-md);
}

.feed-actions-group {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.feed-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.feed-action-btn:hover {
  color: var(--text-primary);
}

.feed-action-btn.liked {
  color: var(--color-coral);
  font-weight: 600;
}

/* In-Feed Native Ad Card */
.feed-native-ad {
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

/* [View: Report & 3D Garden] */
.report-period-toggle-row {
  display: flex;
  width: 100%;
  height: 48px;
  background-color: #211F36;
  border-radius: 14px;
  padding: 4px;
  gap: 6px;
  margin-top: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.report-period-toggle {
  display: inline-flex;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 4px;
}

.period-tab-btn {
  flex: 1;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 16px;
  transition: all 0.2s ease;
}

.period-tab-btn.active {
  background-color: var(--color-primary);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
}

.garden-stage-canvas-container {
  width: 100%;
  height: 340px;
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at 50% 40%, #29244D 0%, #12111F 100%);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.garden-badge-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  background-color: rgba(29, 27, 46, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  color: var(--color-mint);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

/* [View: Profile] */
.profile-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
}

.profile-avatar-icon {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
}

.disclaimer-card {
  background-color: rgba(37, 35, 61, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  line-height: 1.6;
}

/* -------------------------------------------------------------
 * 7. Modals & Bottom Sheets
 * ----------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--transition-smooth);
  overflow: hidden;
  word-break: keep-all;
}

.privacy-pledge-card {
  word-break: keep-all;
  line-height: 1.6;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-xl);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
}

.sheet-drag-handle {
  display: none;
  width: 40px;
  height: 4px;
  background-color: var(--border-medium);
  border-radius: var(--radius-pill);
  margin: 10px auto 4px;
}

/* -------------------------------------------------------------
 * 8. Toast Notification Container
 * ----------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 18px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideDown var(--transition-normal);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.toast-success {
  border-left: 4px solid var(--color-mint);
}
.toast-error {
  border-left: 4px solid var(--color-coral);
}
.toast-info {
  border-left: 4px solid var(--color-primary);
}

/* -------------------------------------------------------------
 * 9. Responsive Breakpoints (< 768px Mobile Adaptation)
 * ----------------------------------------------------------- */
@media (max-width: 768px) {
  .app-wrapper {
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
  }

  .desktop-sidebar,
  .desktop-right-panel {
    display: none !important;
  }

  .mobile-top-bar {
    display: flex;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .main-stage {
    padding: var(--space-md) var(--space-md) calc(80px + env(safe-area-inset-bottom));
  }

  /* Modal becomes mobile bottom-sheet */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    border-bottom: none;
  }

  .sheet-drag-handle {
    display: block;
  }

  .toast-container {
    top: 60px;
  }
}

/* -------------------------------------------------------------
 * 10. Drug Autocomplete & Catalog Styles
 * ----------------------------------------------------------- */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  max-height: 240px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.autocomplete-item {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-fast);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background-color: var(--bg-surface-accent);
}

.autocomplete-brand {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.autocomplete-ingr {
  font-size: 0.75rem;
  color: var(--color-mint);
  margin-left: 6px;
}

.autocomplete-cat {
  font-size: 0.6875rem;
  background-color: rgba(108, 99, 255, 0.2);
  color: var(--color-primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.btn-remove-slot {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.btn-remove-slot:hover {
  color: var(--color-coral);
  background-color: rgba(255, 143, 171, 0.15);
}

/* Catalog Card Styles */
.catalog-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.catalog-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
}

.catalog-card-top {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.catalog-pill-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  flex-shrink: 0;
}

.catalog-pill-thumb-fallback {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.catalog-card-info {
  flex: 1;
  min-width: 0;
}

.catalog-card-title {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 2px;
}

.catalog-card-eng {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-sm);
}

.catalog-card-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-md);
  flex: 1;
}

.catalog-card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}


/* 2-Column Symptom Checkboxes (Android TodayDiaryFragment 1:1 Layout) */
.symptom-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (max-width: 480px) {
  .symptom-grid-2col {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}
.symptom-check-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-surface-elevated, #25233D);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.symptom-check-btn .check-label {
  word-break: keep-all;
  overflow-wrap: break-word;
  line-height: 1.35;
}
.symptom-check-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}
.symptom-check-btn .check-box-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.symptom-check-btn .check-box-icon::after {
  content: '';
  display: none;
  width: 4px;
  height: 8px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
/* Active states */
.symptom-check-btn.active.coral {
  background: rgba(255, 107, 107, 0.18);
  border-color: #FF6B6B;
  color: #FF8FAB;
}
.symptom-check-btn.active.coral .check-box-icon {
  background: #FF6B6B;
  border-color: #FF6B6B;
}
.symptom-check-btn.active.coral .check-box-icon::after {
  display: block;
}

.symptom-check-btn.active.mint {
  background: rgba(126, 207, 200, 0.18);
  border-color: #7ECFC8;
  color: #88D8A3;
}
.symptom-check-btn.active.mint .check-box-icon {
  background: #7ECFC8;
  border-color: #7ECFC8;
}
.symptom-check-btn.active.mint .check-box-icon::after {
  display: block;
  border-color: #1A1927;
}

.symptom-check-btn.active.orange {
  background: rgba(255, 179, 71, 0.18);
  border-color: #FFB347;
  color: #FFB347;
}
.symptom-check-btn.active.orange .check-box-icon {
  background: #FFB347;
  border-color: #FFB347;
}
.symptom-check-btn.active.orange .check-box-icon::after {
  display: block;
  border-color: #1A1927;
}

/* Guest Warning Banner */
.guest-notice-card {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.12), rgba(126, 207, 200, 0.08));
  border: 1px solid rgba(108, 99, 255, 0.35);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.8125rem;
  color: #A7A6BA;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.guest-notice-card strong {
  color: var(--color-mint);
}


/* -------------------------------------------------------------
 * In-Slot Drug Search & 0.5 Dose Stepper Chips (Android 1:1)
 * ----------------------------------------------------------- */
.slot-search-row {
  margin: 10px 0 12px 0;
  position: relative;
}

.slot-drug-search-input {
  width: 100%;
  padding: 9px 14px;
  font-size: 0.8125rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
}

.slot-drug-search-input:focus {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(124, 77, 255, 0.2);
}

.slot-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 120;
  background: #201E35;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.pill-dosage-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 4px 10px 4px 12px;
  margin: 4px 6px 4px 0;
  font-size: 0.8125rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  user-select: none;
}

.pill-dosage-chip:hover {
  border-color: rgba(126, 207, 200, 0.5);
  background: rgba(255, 255, 255, 0.11);
}

.pill-dosage-chip .pill-name {
  font-weight: 600;
  color: var(--text-primary);
}

.dosage-stepper {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 1px 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  gap: 2px;
}

.btn-step-minus, .btn-step-plus {
  background: transparent;
  border: none;
  color: var(--color-mint);
  font-size: 0.95rem;
  font-weight: 700;
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s, transform 0.1s;
  padding: 0;
}

.btn-step-minus:hover, .btn-step-plus:hover {
  background: rgba(126, 207, 200, 0.25);
}

.btn-step-minus:active, .btn-step-plus:active {
  transform: scale(0.9);
}

.step-dosage-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: #FFFFFF;
  min-width: 36px;
  text-align: center;
}

.btn-chip-remove {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.btn-chip-remove:hover {
  color: var(--color-coral);
  background: rgba(255, 107, 107, 0.15);
}

/* ============================================================================
 * Android nadomed-v4.0.2 Parity: Report & My History Styles
 * ============================================================================ */
.report-period-date-banner {
  background: #2E2C48;
  color: var(--color-mint);
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 10px;
}

.drug-stat-card {
  background: #211F36;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.drug-stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.drug-stat-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
}

.drug-stat-count {
  background: rgba(108, 99, 255, 0.2);
  color: #9B8FFF;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.drug-symptom-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.drug-symptom-row:last-child {
  margin-bottom: 0;
}

.drug-symptom-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}

.drug-symptom-track {
  height: 5px;
  width: 100%;
  background: #2A2840;
  border-radius: 999px;
  overflow: hidden;
}

.drug-symptom-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.my-history-card {
  background: var(--bg-surface);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.my-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.my-history-date {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-mint);
}

.btn-history-delete {
  background: transparent;
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: var(--color-coral);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.6875rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-history-delete:hover {
  background: rgba(255, 107, 107, 0.15);
}
