@import url('./tokens/index.css');
@import url('./shell/index.css');
@import url('./components/index.css');
@import url('./pages/index.css');

:root {
  color-scheme: dark;
}

body[data-ux-stage='phase-1'] {
  --ux-shell-rail-width: 18.75rem;
  --ux-shell-mobile-height: 5.5rem;
  background:
    radial-gradient(circle at top left, rgba(82, 126, 121, 0.16), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(187, 52, 69, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(8, 8, 8, 0.98) 0%, rgba(18, 9, 10, 1) 38%, rgba(14, 17, 20, 1) 100%);
  color: var(--ux-color-text);
}

body[data-ux-stage='phase-1']::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(82, 126, 121, 0.05), transparent 45%, rgba(187, 52, 69, 0.08));
  opacity: 0.8;
  z-index: -1;
}

body[data-ux-stage='phase-1'] .nav-container {
  position: sticky;
  top: 0;
  z-index: 3000;
  border-bottom: 1px solid var(--ux-color-border);
  background: rgba(11, 10, 12, 0.9);
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
}

body[data-ux-stage='phase-1'] .nav-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1rem;
}

body[data-ux-stage='phase-1'] .nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--ux-color-text);
}

body[data-ux-stage='phase-1'] .nav-brand-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(160deg, rgba(82, 126, 121, 0.3), rgba(27, 13, 14, 0.95));
  border: 1px solid rgba(82, 126, 121, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 16px 30px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  flex-shrink: 0;
}

body[data-ux-stage='phase-1'] .nav-brand-logo,
body[data-ux-stage='phase-1'] .mobile-menu-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body[data-ux-stage='phase-1'] .nav-brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}

body[data-ux-stage='phase-1'] .nav-brand-eyebrow {
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ux-color-text-muted);
}

body[data-ux-stage='phase-1'] .nav-brand-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: #f7f4f2;
}

body[data-ux-stage='phase-1'] .nav-brand-tagline {
  font-size: 0.78rem;
  color: rgba(239, 232, 228, 0.68);
}

body[data-ux-stage='phase-1'] .nav-tabs {
  display: none;
}

body[data-ux-stage='phase-1'] .nav-tab,
body[data-ux-stage='phase-1'] .mobile-bottom-more,
body[data-ux-stage='phase-1'] .nav-more-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  border-radius: 1rem;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: rgba(242, 238, 234, 0.86);
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

body[data-ux-stage='phase-1'] .nav-tab:hover,
body[data-ux-stage='phase-1'] .mobile-bottom-more:hover,
body[data-ux-stage='phase-1'] .nav-more-trigger:hover {
  transform: translateY(-1px);
  border-color: rgba(82, 126, 121, 0.34);
  background: rgba(82, 126, 121, 0.08);
}

body[data-ux-stage='phase-1'] .nav-tab.active,
body[data-ux-stage='phase-1'] .mobile-bottom-more.is-active,
body[data-ux-stage='phase-1'] .nav-more-trigger.active {
  color: #ffffff;
  border-color: rgba(187, 52, 69, 0.42);
  background: linear-gradient(135deg, rgba(187, 52, 69, 0.2), rgba(82, 126, 121, 0.12));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
}

body[data-ux-stage='phase-1'] .nav-tab-icon {
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

body[data-ux-stage='phase-1'] .nav-tab-label {
  min-width: 0;
}

body[data-ux-stage='phase-1'] .settings-container {
  margin-left: auto;
}

body[data-ux-stage='phase-1'] .settings-btn {
  min-height: 3rem;
  padding: 0.7rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ux-color-text);
}

body[data-ux-stage='phase-1'] .settings-btn:hover,
body[data-ux-stage='phase-1'] .settings-btn:focus-visible {
  border-color: rgba(82, 126, 121, 0.36);
  background: rgba(82, 126, 121, 0.1);
}

body[data-ux-stage='phase-1'] .settings-dropdown,
body[data-ux-stage='phase-1'] .nav-menu-mobile {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(23, 15, 16, 0.97) 0%, rgba(10, 10, 11, 0.97) 100%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

body[data-ux-stage='phase-1'] .settings-label,
body[data-ux-stage='phase-1'] .settings-user-role,
body[data-ux-stage='phase-1'] .mobile-menu-eyebrow {
  color: var(--ux-color-text-muted);
}

body[data-ux-stage='phase-1'] .settings-divider,
body[data-ux-stage='phase-1'] .mobile-settings-divider {
  background: rgba(255, 255, 255, 0.08);
}

body[data-ux-stage='phase-1'] .nav-more-trigger {
  min-height: 3rem;
  margin-left: 0.25rem;
  padding: 0.7rem 0.9rem;
}

body[data-ux-stage='phase-1'] .nav-more-trigger-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

body[data-ux-stage='phase-1'] .nav-more-trigger-dots span {
  display: block;
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 999px;
  background: currentColor;
}

body[data-ux-stage='phase-1'] .hamburger::before,
body[data-ux-stage='phase-1'] .hamburger::after,
body[data-ux-stage='phase-1'] .hamburger > span:not(.nav-more-trigger-dots) {
  display: none;
}

body[data-ux-stage='phase-1'] .mobile-bottom-nav {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: max(0.8rem, env(safe-area-inset-bottom));
  z-index: 3500;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.35rem;
  background: rgba(10, 10, 11, 0.9);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

body[data-ux-stage='phase-1'] .mobile-bottom-nav .nav-tab,
body[data-ux-stage='phase-1'] .mobile-bottom-more {
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  min-height: 4rem;
  padding: 0.55rem 0.35rem;
  font-size: 0.72rem;
  text-align: center;
}

body[data-ux-stage='phase-1'] .mobile-bottom-nav .nav-tab-label,
body[data-ux-stage='phase-1'] .mobile-bottom-more .nav-tab-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

body[data-ux-stage='phase-1'] .nav-overlay {
  z-index: 3990;
  background: rgba(4, 4, 5, 0.62);
  backdrop-filter: blur(4px);
}

body[data-ux-stage='phase-1'] .nav-menu-mobile {
  left: 0.8rem;
  right: 0.8rem;
  top: auto;
  bottom: calc(var(--ux-shell-mobile-height) + max(1rem, env(safe-area-inset-bottom)));
  width: auto;
  max-height: min(78vh, 44rem);
  border-radius: 1.5rem;
  padding: 1rem;
  transform: translateY(1rem);
  opacity: 0;
  pointer-events: none;
  z-index: 4001;
}

body[data-ux-stage='phase-1'] .nav-menu-mobile.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

body[data-ux-stage='phase-1'] .mobile-menu-header {
  padding: 0 0 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-ux-stage='phase-1'] .mobile-menu-branding {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

body[data-ux-stage='phase-1'] .mobile-menu-logo {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  border: 1px solid rgba(82, 126, 121, 0.32);
  background: rgba(255, 255, 255, 0.03);
}

body[data-ux-stage='phase-1'] .mobile-menu-title {
  color: #f8f4f1;
  font-size: 1.1rem;
  font-weight: 700;
}

body[data-ux-stage='phase-1'] .mobile-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

body[data-ux-stage='phase-1'] .nav-menu-mobile .nav-tab {
  min-height: 3.7rem;
  padding: 0.9rem 1rem;
  font-size: 0.96rem;
}

body[data-ux-stage='phase-1'] .container {
  padding-top: 1.1rem;
  padding-bottom: calc(var(--ux-shell-mobile-height) + 2rem + env(safe-area-inset-bottom));
}

body[data-ux-stage='phase-1'] .dashboard-container,
body[data-ux-stage='phase-1'] .schedule-container,
body[data-ux-stage='phase-1'] .news-container,
body[data-ux-stage='phase-1'] .downloads-container,
body[data-ux-stage='phase-1'] .focus-cockpit,
body[data-ux-stage='phase-1'] .nutrition-container,
body[data-ux-stage='phase-1'] .health-container,
body[data-ux-stage='phase-1'] .cron-container,
body[data-ux-stage='phase-1'] .calisthenics-container {
  position: relative;
}

body[data-ux-stage='phase-1'] .dashboard-header,
body[data-ux-stage='phase-1'] .page-hero {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(24, 16, 18, 0.88), rgba(11, 11, 12, 0.76));
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.25);
}

body[data-ux-stage='phase-1'] .status-card,
body[data-ux-stage='phase-1'] .agent-card-modern,
body[data-ux-stage='phase-1'] .status-section,
body[data-ux-stage='phase-1'] .cron-section,
body[data-ux-stage='phase-1'] .health-section,
body[data-ux-stage='phase-1'] .schedule-card,
body[data-ux-stage='phase-1'] .week-card,
body[data-ux-stage='phase-1'] .life-card,
body[data-ux-stage='phase-1'] .study-subject-card,
body[data-ux-stage='phase-1'] .study-review-week,
body[data-ux-stage='phase-1'] .study-review-block,
body[data-ux-stage='phase-1'] .progressive-section,
body[data-ux-stage='phase-1'] .calendar-card,
body[data-ux-stage='phase-1'] .modal-content {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: linear-gradient(180deg, rgba(19, 13, 15, 0.88) 0%, rgba(11, 11, 12, 0.82) 100%) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

body[data-ux-stage='phase-1'] .live-badge,
body[data-ux-stage='phase-1'] .hero-action-btn,
body[data-ux-stage='phase-1'] .quick-jump-btn,
body[data-ux-stage='phase-1'] .lang-btn,
body[data-ux-stage='phase-1'] .theme-btn,
body[data-ux-stage='phase-1'] .settings-link-btn,
body[data-ux-stage='phase-1'] .logout-btn {
  border-radius: 999px;
}

body[data-ux-stage='phase-1'] .hero-action-btn,
body[data-ux-stage='phase-1'] .quick-jump-btn,
body[data-ux-stage='phase-1'] .lang-btn,
body[data-ux-stage='phase-1'] .theme-btn,
body[data-ux-stage='phase-1'] .settings-link-btn,
body[data-ux-stage='phase-1'] .logout-btn {
  border-color: rgba(82, 126, 121, 0.26);
  background: rgba(82, 126, 121, 0.08);
  color: #eef3f0;
}

body[data-ux-stage='phase-1'] .hero-action-btn:hover,
body[data-ux-stage='phase-1'] .quick-jump-btn:hover,
body[data-ux-stage='phase-1'] .lang-btn:hover,
body[data-ux-stage='phase-1'] .theme-btn:hover,
body[data-ux-stage='phase-1'] .settings-link-btn:hover,
body[data-ux-stage='phase-1'] .logout-btn:hover,
body[data-ux-stage='phase-1'] .lang-btn.active,
body[data-ux-stage='phase-1'] .theme-btn.active {
  border-color: rgba(187, 52, 69, 0.44);
  background: rgba(187, 52, 69, 0.18);
}

body[data-theme='light'][data-ux-stage='phase-1'] {
  color-scheme: light;
  background: linear-gradient(180deg, #f4efeb 0%, #ede7e2 100%);
}

body[data-theme='light'][data-ux-stage='phase-1']::before {
  background: linear-gradient(135deg, rgba(82, 126, 121, 0.08), transparent 48%, rgba(187, 52, 69, 0.08));
}

body[data-theme='light'][data-ux-stage='phase-1'] .nav-container,
body[data-theme='light'][data-ux-stage='phase-1'] .mobile-bottom-nav,
body[data-theme='light'][data-ux-stage='phase-1'] .nav-menu-mobile,
body[data-theme='light'][data-ux-stage='phase-1'] .settings-dropdown,
body[data-theme='light'][data-ux-stage='phase-1'] .dashboard-header,
body[data-theme='light'][data-ux-stage='phase-1'] .page-hero,
body[data-theme='light'][data-ux-stage='phase-1'] .status-card,
body[data-theme='light'][data-ux-stage='phase-1'] .agent-card-modern,
body[data-theme='light'][data-ux-stage='phase-1'] .status-section,
body[data-theme='light'][data-ux-stage='phase-1'] .cron-section,
body[data-theme='light'][data-ux-stage='phase-1'] .health-section,
body[data-theme='light'][data-ux-stage='phase-1'] .schedule-card,
body[data-theme='light'][data-ux-stage='phase-1'] .week-card,
body[data-theme='light'][data-ux-stage='phase-1'] .study-subject-card,
body[data-theme='light'][data-ux-stage='phase-1'] .study-review-week,
body[data-theme='light'][data-ux-stage='phase-1'] .study-review-block,
body[data-theme='light'][data-ux-stage='phase-1'] .progressive-section,
body[data-theme='light'][data-ux-stage='phase-1'] .calendar-card,
body[data-theme='light'][data-ux-stage='phase-1'] .modal-content {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 239, 235, 0.96) 100%) !important;
  border-color: rgba(98, 78, 73, 0.12) !important;
  color: #21191a;
}

body[data-theme='light'][data-ux-stage='phase-1'] .nav-brand-name,
body[data-theme='light'][data-ux-stage='phase-1'] .mobile-menu-title {
  color: #1f1819;
}

body[data-theme='light'][data-ux-stage='phase-1'] .nav-brand-tagline,
body[data-theme='light'][data-ux-stage='phase-1'] .nav-tab,
body[data-theme='light'][data-ux-stage='phase-1'] .mobile-bottom-more,
body[data-theme='light'][data-ux-stage='phase-1'] .nav-more-trigger,
body[data-theme='light'][data-ux-stage='phase-1'] .settings-btn {
  color: #433538;
}

body[data-theme='light'][data-ux-stage='phase-1'] .nav-tab.active,
body[data-theme='light'][data-ux-stage='phase-1'] .mobile-bottom-more.is-active,
body[data-theme='light'][data-ux-stage='phase-1'] .nav-more-trigger.active,
body[data-theme='light'][data-ux-stage='phase-1'] .lang-btn.active,
body[data-theme='light'][data-ux-stage='phase-1'] .theme-btn.active {
  color: #241619;
  background: linear-gradient(135deg, rgba(187, 52, 69, 0.16), rgba(82, 126, 121, 0.12));
}

@media (max-width: 979px) {
  body[data-ux-stage='phase-1'] .settings-container {
    display: none;
  }
}

@media (min-width: 980px) {
  body[data-ux-stage='phase-1'] .nav-container {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--ux-shell-rail-width);
    border-right: 1px solid var(--ux-color-border);
    border-bottom: 0;
    background: linear-gradient(180deg, rgba(12, 12, 13, 0.98) 0%, rgba(18, 9, 10, 0.96) 100%);
  }

  body[data-ux-stage='phase-1'] .nav-content {
    flex-direction: column;
    align-items: stretch;
    gap: 1.15rem;
    height: 100%;
    padding: 1.35rem 1rem 1.2rem;
  }

  body[data-ux-stage='phase-1'] .nav-tabs {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.35rem;
  }

  body[data-ux-stage='phase-1'] .nav-tabs .nav-tab {
    width: 100%;
    min-height: 3.35rem;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }

  body[data-ux-stage='phase-1'] .settings-container {
    display: block;
    margin-left: 0;
    margin-top: auto;
  }

  body[data-ux-stage='phase-1'] .settings-btn,
  body[data-ux-stage='phase-1'] .nav-more-trigger {
    width: 100%;
    justify-content: center;
  }

  body[data-ux-stage='phase-1'] .nav-more-trigger {
    display: none;
  }

  body[data-ux-stage='phase-1'] .mobile-bottom-nav {
    display: none;
  }

  body[data-ux-stage='phase-1'] .container {
    margin-left: calc(var(--ux-shell-rail-width) + 1.25rem);
    padding: 1.5rem 1.75rem 2rem 0.5rem;
  }
}

@media (max-width: 639px) {
  body[data-ux-stage='phase-1'] .nav-content {
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
  }

  body[data-ux-stage='phase-1'] .nav-brand-tagline {
    display: none;
  }

  body[data-ux-stage='phase-1'] .nav-brand-name {
    font-size: 0.95rem;
  }

  body[data-ux-stage='phase-1'] .nav-brand-mark {
    width: 2.7rem;
    height: 2.7rem;
  }

  body[data-ux-stage='phase-1'] .nav-more-trigger-label {
    display: none;
  }

  body[data-ux-stage='phase-1'] .nav-more-trigger {
    min-width: 3rem;
    justify-content: center;
    padding-inline: 0.8rem;
  }

  body[data-ux-stage='phase-1'] .mobile-bottom-nav {
    left: 0.55rem;
    right: 0.55rem;
    bottom: max(0.55rem, env(safe-area-inset-bottom));
    gap: 0.35rem;
    padding: 0.45rem;
  }

  body[data-ux-stage='phase-1'] .mobile-bottom-nav .nav-tab,
  body[data-ux-stage='phase-1'] .mobile-bottom-more {
    min-height: 3.8rem;
    font-size: 0.66rem;
    border-radius: 1rem;
  }

  body[data-ux-stage='phase-1'] .mobile-sheet-grid {
    grid-template-columns: 1fr;
  }

  body[data-ux-stage='phase-1'] .nav-menu-mobile {
    left: 0.55rem;
    right: 0.55rem;
    padding: 0.9rem;
  }
}
