/* -------------------------------------------------------------
 * STOIC DESIGN SYSTEM - MARCUS AURELIUS MEDITATIONS
 * ------------------------------------------------------------- */

/* Custom Fonts via Google Fonts */
:root {
  /* Fonts */
  --font-serif-header: 'Cinzel', serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif-body: 'Lora', Georgia, serif;

  /* Stoic Light Theme (Classic Marble) Defaults */
  --color-bg: #F8F6F0;           /* Soft Creamy Marble */
  --color-surface: #FFFFFF;      /* Pure White Card */
  --color-surface-variant: #F0EDE4; /* Slightly darker cream */
  --color-primary: #8B7355;      /* Antique Bronze */
  --color-on-primary: #F8F6F0;
  --color-secondary: #A0522D;    /* Sienna / Terracotta */
  --color-on-secondary: #FFFFFF;
  --color-tertiary: #5F9EA0;     /* Cadet Blue / Sage */
  --color-text-primary: #2C2A29; /* Charcoal Text */
  --color-text-secondary: #6C6A65; /* Muted Charcoal Text */
  --color-divider: rgba(139, 115, 85, 0.2);
  --color-outline: rgba(139, 115, 85, 0.3);
  
  --shadow-card: 0 4px 12px rgba(44, 42, 41, 0.08);
  --shadow-modal: 0 12px 36px rgba(44, 42, 41, 0.16);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* Stoic Dark Theme override */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #161618;
    --color-surface: #222225;
    --color-surface-variant: #2A2A2F;
    --color-primary: #D4AF37;      /* Muted Bronze Gold */
    --color-on-primary: #161618;
    --color-secondary: #C05C46;    /* Terracotta Red */
    --color-on-secondary: #F4F0E6;
    --color-tertiary: #8E9B90;     /* Sage Green */
    --color-text-primary: #F4F0E6; /* Ivory Text */
    --color-text-secondary: #A19E95; /* Muted Sand Text */
    --color-divider: rgba(212, 175, 55, 0.15);
    --color-outline: rgba(212, 175, 55, 0.25);
    
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-modal: 0 12px 48px rgba(0, 0, 0, 0.6);
  }
}

/* Force dark or light mode if class is appended to body (for future manual overrides) */
body.dark-theme {
  --color-bg: #161618;
  --color-surface: #222225;
  --color-surface-variant: #2A2A2F;
  --color-primary: #D4AF37;
  --color-on-primary: #161618;
  --color-secondary: #C05C46;
  --color-on-secondary: #F4F0E6;
  --color-tertiary: #8E9B90;
  --color-text-primary: #F4F0E6;
  --color-text-secondary: #A19E95;
  --color-divider: rgba(212, 175, 55, 0.15);
  --color-outline: rgba(212, 175, 55, 0.25);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-modal: 0 12px 48px rgba(0, 0, 0, 0.6);
}

body.light-theme {
  --color-bg: #F8F6F0;
  --color-surface: #FFFFFF;
  --color-surface-variant: #F0EDE4;
  --color-primary: #8B7355;
  --color-on-primary: #F8F6F0;
  --color-secondary: #A0522D;
  --color-on-secondary: #FFFFFF;
  --color-tertiary: #5F9EA0;
  --color-text-primary: #2C2A29;
  --color-text-secondary: #6C6A65;
  --color-divider: rgba(139, 115, 85, 0.2);
  --color-outline: rgba(139, 115, 85, 0.3);
  --shadow-card: 0 4px 12px rgba(44, 42, 41, 0.08);
  --shadow-modal: 0 12px 36px rgba(44, 42, 41, 0.16);
}

/* -------------------------------------------------------------
 * BASE STYLE RULES
 * ------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html {
  background-color: #0b0b0c;
  height: 100%;
  height: -webkit-fill-available;
  height: 100dvh;
}

body {
  font-family: var(--font-sans);
  background-color: #0b0b0c; /* Very dark background to isolate the phone bezel on desktop */
  color: var(--color-text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  height: -webkit-fill-available;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
}


/* -------------------------------------------------------------
 * PHONE WRAPPER & BEZEL (DESKTOP DEVICE WRAPPER)
 * ------------------------------------------------------------- */
/* Simulated Phone Wrapper (Optimized for Mobile, Centered Aspect-Ratio on Laptop/Tablet) */
.phone-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at 50% 30%, #1e1b24 0%, #060507 100%);
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.phone-bezel {
  position: relative;
  /* Lock to phone aspect ratio 9 : 19.5 on desktop, laptops, and tablets */
  height: min(calc(100dvh - 32px), 880px);
  width: calc(min(calc(100dvh - 32px), 880px) * (9 / 19.5));
  max-width: min(430px, calc(100dvw - 32px));
  background-color: #000000;
  border-radius: 48px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(212, 175, 55, 0.25), inset 0 0 0 3px #262428;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--color-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* True Mobile Phone Screen - edge to edge */
@media (max-width: 480px) {
  .phone-wrapper {
    padding: 0;
  }
  .phone-bezel {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }
}

/* -------------------------------------------------------------
 * APP CORE CONTAINER & HEADER
 * ------------------------------------------------------------- */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}

.app-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-action-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.header-action-btn:active {
  background-color: var(--color-surface-variant);
}

.book-header-title {
  font-family: var(--font-serif-header);
  font-size: 16px;
  font-weight: 700;
  margin-left: 12px;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.header-spacer {
  width: 40px; /* balances the back button width */
}

/* -------------------------------------------------------------
 * MAIN CONTENT & VIEWS
 * ------------------------------------------------------------- */
.app-main-content {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* View switcher */
.app-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: var(--color-bg);
}

.app-view.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  z-index: 10;
}

.hidden {
  display: none !important;
}

/* Scroll containers for each view */
.dashboard-scrollable,
.browse-scrollable,
.search-scrollable,
.settings-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 80px 16px; /* padding-bottom offsets bottom navigation */
  -webkit-overflow-scrolling: touch;
}

/* Adjust dashboard/browse top padding when detail header is visible */
#book-detail-container {
  padding-top: 72px; /* offsets floating sub-header */
}

/* -------------------------------------------------------------
 * LOADING OVERLAY
 * ------------------------------------------------------------- */
.loading-overlay {
  position: absolute;
  inset: 0;
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 999;
  transition: opacity 0.4s ease;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-divider);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.loading-overlay p {
  font-family: var(--font-serif-header);
  color: var(--color-text-secondary);
  font-size: 14px;
  letter-spacing: 1px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* -------------------------------------------------------------
 * DASHBOARD VIEW SPECIFICS
 * ------------------------------------------------------------- */
.banner-card {
  position: relative;
  width: 100%;
  height: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.banner-card:active {
  transform: scale(0.98);
}

.banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.4));
}

.dashboard-intro {
  text-align: center;
  margin-top: 16px;
  margin-bottom: 24px;
}

.dashboard-intro .subtitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 2.5px;
  margin-bottom: 4px;
}

.dashboard-intro .title {
  font-family: var(--font-serif-header);
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.stoic-divider {
  width: 60px;
  height: 2px;
  background-color: var(--color-primary);
  margin: 12px auto 0 auto;
  opacity: 0.8;
}

/* -------------------------------------------------------------
 * MEDITATION CARD & GENERAL CARDS
 * ------------------------------------------------------------- */
.meditation-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--color-divider);
}

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

.card-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-secondary);
  letter-spacing: 1px;
}

.card-reference {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.card-media {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.passage-quote {
  font-family: var(--font-serif-body);
  font-size: 17px;
  line-height: 1.6;
  font-style: italic;
  color: var(--color-text-primary);
  text-align: center;
  position: relative;
  padding: 0 8px;
}

.card-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.btn-icon {
  margin-right: 6px;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}

.btn-primary:active {
  opacity: 0.9;
  transform: scale(0.97);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--color-outline);
  color: var(--color-primary);
}

.btn-outline:active {
  background-color: var(--color-surface-variant);
  transform: scale(0.97);
}

.btn-secondary {
  background-color: var(--color-surface-variant);
  color: var(--color-text-primary);
}

.btn-secondary:active {
  background-color: var(--color-divider);
  transform: scale(0.97);
}

.btn-flat {
  background-color: transparent;
  color: var(--color-text-secondary);
  font-weight: 700;
  padding: 8px 16px;
}

.btn-flat.primary-text {
  color: var(--color-primary);
}

.btn-flat:active {
  background-color: var(--color-surface-variant);
}

/* -------------------------------------------------------------
 * BROWSE VIEW SPECIFICS
 * ------------------------------------------------------------- */
.view-intro {
  margin-bottom: 16px;
}

.view-title {
  font-family: var(--font-serif-header);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.view-description {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.books-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.book-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
  padding: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease;
}

.book-card:active {
  transform: scale(0.98);
}

.book-card-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.book-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card-info {
  margin-left: 16px;
  flex: 1;
  overflow: hidden;
}

.book-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.book-card-title {
  font-family: var(--font-serif-header);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
}

.book-card-sections {
  font-size: 11px;
  color: var(--color-text-secondary);
  font-weight: 600;
}

.book-card-preview {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Book details cover */
.book-detail-cover {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.detail-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.passages-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.passage-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.passage-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.passage-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-secondary);
}

.passage-share-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s, background-color 0.2s;
}

.passage-share-btn:active {
  background-color: var(--color-surface-variant);
  color: var(--color-primary);
}

.passage-card-text {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-primary);
}

/* -------------------------------------------------------------
 * SEARCH VIEW SPECIFICS
 * ------------------------------------------------------------- */
.search-input-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 12px;
}

.search-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  pointer-events: none;
}

#search-input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 46px;
  border-radius: 24px;
  border: 1px solid var(--color-outline);
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

#search-input:focus {
  border-color: var(--color-primary);
}

.search-clear-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
}

.search-clear-btn:active {
  background-color: var(--color-surface-variant);
}

.search-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 16px;
  border: 1px solid var(--color-outline);
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip.selected {
  background-color: rgba(212, 175, 55, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

.chip:active {
  transform: scale(0.96);
}

.search-results-container {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.search-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 32px;
}

.placeholder-text {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  text-align: center;
}

.random-card-wrapper {
  width: 100%;
  margin-top: 16px;
  animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.random-meditation-card {
  background-color: rgba(34, 34, 37, 0.5); /* semi-transparent surface */
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--color-divider);
}

/* Highlighted searches styles */
.highlight-direct {
  color: var(--color-primary);
  font-weight: 700;
}

.highlight-related {
  color: var(--color-secondary);
  font-weight: 700;
}

.search-no-results {
  text-align: center;
  padding-top: 48px;
}

.search-no-results p {
  color: var(--color-text-secondary);
  font-size: 14px;
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Animations */
@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Rotation animation helper */
.rotate-360 {
  animation: rotateAction 0.6s linear;
}

@keyframes rotateAction {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* -------------------------------------------------------------
 * SETTINGS VIEW SPECIFICS
 * ------------------------------------------------------------- */
.settings-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
  padding: 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  transition: all 0.3s ease;
}

.settings-row.border-top {
  border-top: 1px solid var(--color-divider);
  margin-top: 12px;
  padding-top: 12px;
}

.settings-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.settings-info p {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.settings-info-vertical h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.settings-info-vertical p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}

/* Switch control */
.switch-control {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--color-surface-variant);
  border: 1.5px solid var(--color-outline);
  border-radius: 24px;
  transition: .3s;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: var(--color-text-secondary);
  border-radius: 50%;
  transition: .3s;
}

.switch-control input:checked + .switch-slider {
  background-color: rgba(212, 175, 55, 0.3);
  border-color: var(--color-primary);
}

.switch-control input:checked + .switch-slider:before {
  transform: translateX(20px);
  background-color: var(--color-primary);
}

/* Time Picker Button Trigger */
.time-picker-trigger {
  background-color: transparent;
  border: none;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 16px;
  transition: background-color 0.2s;
}

.time-picker-trigger:active {
  background-color: var(--color-surface-variant);
}

/* Slide animation for expandable rows */
.hidden-slide {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top-color: transparent !important;
  pointer-events: none;
}

.visible-slide {
  max-height: 100px;
  opacity: 1;
  pointer-events: auto;
}

/* App Icon Selector Card styling */
.app-icon-selector {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.2s ease;
}

.app-icon-selector.active-border {
  border-color: var(--color-primary);
}

.icon-selector-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icon-selector-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
}

.icon-selector-content {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
}

.icon-status-label {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
}

.about-card p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-primary);
  margin-top: 12px;
}

/* -------------------------------------------------------------
 * BOTTOM NAVIGATION BAR
 * ------------------------------------------------------------- */
.app-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom); /* iOS home indicator spacing */
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  cursor: pointer;
  gap: 4px;
  transition: color 0.2s ease;
}

.nav-item svg {
  transition: transform 0.2s ease;
}

.nav-item span {
  font-size: 10px;
  font-weight: 500;
}

.nav-item.active {
  color: var(--color-primary);
}

.nav-item.active svg {
  transform: scale(1.1);
}

.nav-item.active span {
  font-weight: 700;
}

/* -------------------------------------------------------------
 * DIALOG MODALS
 * ------------------------------------------------------------- */
.modal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: 85%;
  max-width: 320px;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-modal);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--color-divider);
}

.modal-overlay:not(.hidden) .modal-dialog {
  transform: scale(1);
}

.modal-title {
  font-family: var(--font-serif-header);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}

.modal-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Time Picker Dialog Custom Layout */
.time-picker-dialog {
  max-width: 320px;
}

.time-inputs-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0 24px 0;
  gap: 12px;
}

.time-picker-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.time-picker-column.colon {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 14px;
}

.time-picker-column label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.time-inputs-container select {
  font-size: 22px;
  font-weight: 700;
  background-color: var(--color-surface-variant);
  color: var(--color-text-primary);
  border: 1px solid var(--color-outline);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  width: 64px;
}

.time-inputs-container select:focus {
  border-color: var(--color-primary);
}

/* -------------------------------------------------------------
 * TOAST ALERTS
 * ------------------------------------------------------------- */
.toast {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #2b2b2b;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast:not(.hidden) {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* Classical Scroll Ecosystem Return Ribbon */
.cs-hub-header-bar {
  background: rgba(10, 10, 14, 0.95);
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.cs-hub-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #D4AF37;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: opacity 0.2s;
}
.cs-hub-back-link:hover {
  opacity: 0.8;
}


.cs-hub-motto {
  font-size: 10px;
  font-style: italic;
  color: rgba(212, 175, 55, 0.7);
  letter-spacing: 0.3px;
  display: none;
}
@media (min-width: 380px) {
  .cs-hub-motto {
    display: inline-block;
  }
}

.cs-manifesto-card {
  background: var(--surface-dark, #18171e) !important;
  border-left: 3px solid var(--gold, #d4af37) !important;
}
.manifesto-tag {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gold, #d4af37);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.cs-manifesto-card h3 {
  font-style: italic;
  font-size: 13px;
  color: #ffffff;
  margin-bottom: 6px;
  line-height: 1.4;
}
.cs-manifesto-card p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary, #b0aab9);
}
