/* ============================================
   TIDAL — Cycle Syncing App
   Ocean-calm design system
   ============================================ */

:root {
  /* Ocean palette */
  --deep:       #0a1628;
  --abyss:      #0f1f3a;
  --current:    #163a5c;
  --tide:       #1e6091;
  --surf:       #3b9ecf;
  --foam:       #8ecae6;
  --pearl:      #d4eaf7;
  --sand:       #f0ece2;
  --shell:      #ffffff;

  /* Phase accent colors */
  --menstrual:  #7b4a6e;
  --follicular: #2e8b6e;
  --ovulatory:  #d4a843;
  --luteal:     #b45a3c;

  /* Moon */
  --moon-glow:  #f5e6c8;

  /* Dosha */
  --vata:       #8da7c4;
  --pitta:      #d4764e;
  --kapha:      #5a9e6f;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Inter', -apple-system, sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 50%;
}

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--pearl);
  background: var(--deep);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---- Ocean Background Canvas ---- */
#ocean-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

p, li, label, span, td {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.95rem;
}

a {
  color: var(--foam);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--surf); }

/* ---- Navigation ---- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  background: rgba(10, 22, 40, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(139, 202, 230, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--foam);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: var(--space-xs);
  list-style: none;
}

.nav-links button {
  background: none;
  border: none;
  color: var(--pearl);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.nav-links button:hover,
.nav-links button.active {
  background: rgba(139, 202, 230, 0.12);
  color: var(--foam);
}

.nav-links button.active {
  background: rgba(139, 202, 230, 0.18);
}

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--pearl);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    padding: var(--space-md);
    border-bottom: 1px solid rgba(139, 202, 230, 0.08);
  }
  .nav-links.open { display: flex; }
}

/* ---- Main Content ---- */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-xl);
}

@media (max-width: 768px) {
  .main-content { padding: var(--space-md); }
}

/* ---- Cards ---- */
.card {
  background: rgba(15, 31, 58, 0.6);
  border: 1px solid rgba(139, 202, 230, 0.1);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  backdrop-filter: blur(10px);
  transition: border-color 0.3s, transform 0.2s;
}

.card:hover {
  border-color: rgba(139, 202, 230, 0.2);
}

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

/* ---- Phase Colors on Cards ---- */
.phase-menstrual { border-left: 3px solid var(--menstrual); }
.phase-follicular { border-left: 3px solid var(--follicular); }
.phase-ovulatory { border-left: 3px solid var(--ovulatory); }
.phase-luteal { border-left: 3px solid var(--luteal); }

/* ---- Dashboard Hero ---- */
.dashboard-hero {
  text-align: center;
  padding: var(--space-2xl) 0 var(--space-xl);
}

.dashboard-hero h1 {
  margin-bottom: var(--space-sm);
}

.dashboard-hero .subtitle {
  color: var(--foam);
  font-size: 1.05rem;
  font-weight: 300;
  opacity: 0.8;
}

/* ---- Cycle Ring ---- */
.cycle-ring-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-xl) 0;
}

.cycle-ring {
  position: relative;
  width: 320px;
  height: 320px;
}

@media (max-width: 480px) {
  .cycle-ring { width: 260px; height: 260px; }
}

.cycle-ring svg {
  width: 100%;
  height: 100%;
}

.cycle-ring-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.cycle-ring-center .day-number {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  color: var(--shell);
  line-height: 1;
}

.cycle-ring-center .phase-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-xs);
}

/* ---- Moon Widget ---- */
.moon-widget {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
}

.moon-visual {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.moon-info h3 {
  color: var(--moon-glow);
  margin-bottom: var(--space-xs);
}

.moon-info p {
  opacity: 0.7;
  font-size: 0.88rem;
}

/* ---- Exercise & Food Section ---- */
.recommendation-section {
  margin-top: var(--space-xl);
}

.recommendation-section h2 {
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.exercise-card {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  background: rgba(139, 202, 230, 0.04);
  margin-bottom: var(--space-sm);
  transition: background 0.2s;
}

.exercise-card:hover {
  background: rgba(139, 202, 230, 0.08);
}

.exercise-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(139, 202, 230, 0.08);
}

.exercise-details h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--shell);
  margin-bottom: 2px;
}

.exercise-details p {
  font-size: 0.85rem;
  opacity: 0.7;
  line-height: 1.5;
}

.intensity-bar {
  display: flex;
  gap: 3px;
  margin-top: var(--space-xs);
}

.intensity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(139, 202, 230, 0.2);
}

.intensity-dot.filled {
  background: var(--foam);
}

/* ---- Food Grid ---- */
.food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-sm);
}

.food-item {
  background: rgba(139, 202, 230, 0.05);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.88rem;
  font-weight: 300;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: background 0.2s;
}

.food-item:hover {
  background: rgba(139, 202, 230, 0.1);
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-lg);
  background: rgba(15, 31, 58, 0.5);
  border-radius: var(--radius-sm);
  padding: 3px;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--pearl);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 400;
  padding: var(--space-sm) var(--space-md);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-btn:hover { background: rgba(139, 202, 230, 0.1); }

.tab-btn.active {
  background: rgba(139, 202, 230, 0.15);
  color: var(--foam);
  font-weight: 500;
}

/* ---- Forms / Inputs ---- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--foam);
  margin-bottom: var(--space-xs);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: rgba(15, 31, 58, 0.8);
  border: 1px solid rgba(139, 202, 230, 0.15);
  border-radius: var(--radius-sm);
  color: var(--pearl);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 300;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--surf);
}

.form-group input[type="date"] {
  color-scheme: dark;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--foam);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(139, 202, 230, 0.1);
  color: var(--foam);
  border: 1px solid rgba(139, 202, 230, 0.2);
}

.btn-secondary:hover {
  background: rgba(139, 202, 230, 0.18);
}

/* ---- Profile ---- */
.profile-section {
  max-width: 600px;
}

.dosha-selector {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.dosha-btn {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(139, 202, 230, 0.15);
  background: rgba(15, 31, 58, 0.5);
  color: var(--pearl);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.dosha-btn:hover {
  border-color: rgba(139, 202, 230, 0.3);
}

.dosha-btn.selected-vata {
  border-color: var(--vata);
  background: rgba(141, 167, 196, 0.15);
  color: var(--vata);
}

.dosha-btn.selected-pitta {
  border-color: var(--pitta);
  background: rgba(212, 118, 78, 0.15);
  color: var(--pitta);
}

.dosha-btn.selected-kapha {
  border-color: var(--kapha);
  background: rgba(90, 158, 111, 0.15);
  color: var(--kapha);
}

/* ---- Comorbidity Tags ---- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 12px;
  background: rgba(139, 202, 230, 0.1);
  border-radius: 100px;
  font-size: 0.82rem;
  color: var(--foam);
}

.tag button {
  background: none;
  border: none;
  color: var(--foam);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.6;
  padding: 0;
}

.tag button:hover { opacity: 1; }

/* ---- Cycle Stats ---- */
.stat-row {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
  padding: var(--space-lg) 0;
}

.stat {
  text-align: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--shell);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--foam);
  opacity: 0.7;
  margin-top: 4px;
}

/* ---- Timeline / Phase bar ---- */
.phase-bar {
  display: flex;
  height: 8px;
  border-radius: 100px;
  overflow: hidden;
  margin: var(--space-md) 0;
}

.phase-bar-segment {
  transition: flex 0.3s;
}

/* ---- Disclaimer ---- */
.disclaimer {
  margin-top: var(--space-xl);
  padding: var(--space-md);
  background: rgba(139, 202, 230, 0.04);
  border-radius: var(--radius-sm);
  border-left: 2px solid rgba(139, 202, 230, 0.2);
  font-size: 0.8rem;
  opacity: 0.6;
  line-height: 1.6;
}

/* ---- Setup Screen ---- */
.setup-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: var(--space-xl);
}

.setup-screen h1 {
  margin-bottom: var(--space-sm);
}

.setup-screen .subtitle {
  color: var(--foam);
  opacity: 0.7;
  margin-bottom: var(--space-2xl);
  max-width: 440px;
}

.setup-form {
  width: 100%;
  max-width: 400px;
  text-align: left;
}

/* ---- Scroll Reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s, transform 0.5s;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Ayurveda Section ---- */
.ayurveda-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: var(--space-md);
}

.ayurveda-badge.vata-bg {
  background: rgba(141, 167, 196, 0.15);
  color: var(--vata);
}

.ayurveda-badge.pitta-bg {
  background: rgba(212, 118, 78, 0.15);
  color: var(--pitta);
}

.ayurveda-badge.kapha-bg {
  background: rgba(90, 158, 111, 0.15);
  color: var(--kapha);
}

/* ---- Section dividers ---- */
.section-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139,202,230,0.12), transparent);
  margin: var(--space-xl) 0;
}

/* ---- Tooltip for moon cycle type ---- */
.moon-cycle-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 100px;
  background: rgba(245, 230, 200, 0.08);
  color: var(--moon-glow);
  font-size: 0.82rem;
  font-weight: 400;
  margin-top: var(--space-sm);
}

/* ---- Loading Skeleton ---- */
.skeleton {
  background: linear-gradient(90deg, rgba(139,202,230,0.05) 0%, rgba(139,202,230,0.1) 50%, rgba(139,202,230,0.05) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Print ---- */
@media print {
  #ocean-bg { display: none; }
  .nav { display: none; }
  body { background: white; color: #1a1a1a; }
  .card { border: 1px solid #ddd; background: #fafafa; }
}
