/**
 * Loona Design System - Renaissance Edition
 *
 * A digital sanctuary merging Renaissance artistic mastery with modern neuroscience.
 * Celebrating the cyclical beauty of feminine rhythms through sacred design.
 */

/* ===== GOOGLE FONTS - Renaissance Inspired ===== */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Tangerine:wght@400;700&display=swap');

/* ===== COLOR SYSTEM - Celestial Renaissance Palette ===== */
:root {
  /* Primary Colors - Celestial & Sacred */
  --celestial-blue: #2C3E50;      /* Deep celestial night */
  --lunar-silver: #E8EDF2;        /* Soft moonlight */
  --terracotta: #D4906C;          /* Warm earth clay */

  /* Accent Colors - Nature's Wisdom */
  --blush-rose: #E8B4B8;          /* Renaissance rose */
  --sage-green: #9CAF88;          /* Living earth green */
  --golden-ochre: #D4A574;        /* Ancient gold */

  /* Legacy aliases for backwards compatibility */
  --loona-rose: #E8B4B8;
  --loona-lavender: #C5B8D9;
  --loona-peach: #D4A574;

  /* Cycle Phase Colors - Seasonal Mapping */
  --menstrual: #6B8BA6;           /* Winter: gentle blues, rest */
  --follicular: #9CAF88;          /* Spring: blooming greens, growth */
  --ovulation: #D4A574;           /* Summer: golden warmth, peak vitality */
  --luteal: #C5877D;              /* Autumn: harvest richness, introspection */

  /* Functional Colors */
  --insight-positive: #9CAF88;
  --insight-caution: #D4A574;
  --insight-neutral: #C5B8D9;

  /* Text Hierarchy (WCAG AA+ Compliant) */
  --text-primary: #2C3E50;        /* Celestial blue for headers */
  --text-secondary: #5A6C7D;      /* Muted slate for body */
  --text-light: #8B9AA8;          /* Soft grey for hints */
  --text-accent: #D4906C;         /* Terracotta for emphasis */

  /* Backgrounds - Fresco Inspired */
  --bg-primary: #FAF8F5;          /* Soft cream canvas */
  --bg-secondary: #F5F1EC;        /* Ivory gradient */
  --bg-card: #FFFFFF;             /* Pure white for cards */
  --bg-fresco: #F8F5F0;           /* Fresco texture base */

  /* Spacing - Golden Ratio Based (φ ≈ 1.618) */
  --phi: 1.618;
  --spacing-xs: 8px;              /* Base unit */
  --spacing-sm: 13px;             /* 8 × φ ≈ 13 */
  --spacing-md: 21px;             /* 13 × φ ≈ 21 */
  --spacing-lg: 34px;             /* 21 × φ ≈ 34 */
  --spacing-xl: 55px;             /* 34 × φ ≈ 55 */
  --spacing-2xl: 89px;            /* 55 × φ ≈ 89 */

  /* Border Radius - Organic Curves */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 40px;
  --radius-full: 9999px;
  --radius-organic: 50% 50% 48% 52% / 48% 50% 50% 52%;  /* Organic shape */

  /* Shadows - Chiaroscuro (Light to Shadow) */
  --shadow-subtle: 0 2px 8px rgba(44, 62, 80, 0.06);
  --shadow-soft: 0 4px 16px rgba(44, 62, 80, 0.08);
  --shadow-medium: 0 8px 24px rgba(44, 62, 80, 0.12);
  --shadow-dramatic: 0 16px 48px rgba(44, 62, 80, 0.16);
  --shadow-inner: inset 0 2px 4px rgba(44, 62, 80, 0.06);

  /* Vignette Effect */
  --vignette: radial-gradient(ellipse at center, transparent 0%, rgba(44, 62, 80, 0.05) 100%);

  /* Transitions - Organic Motion */
  --transition-fast: 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
  --transition-normal: 500ms cubic-bezier(0.4, 0.0, 0.2, 1);
  --transition-slow: 800ms cubic-bezier(0.4, 0.0, 0.2, 1);
  --transition-organic: 600ms cubic-bezier(0.34, 1.56, 0.64, 1);  /* Elastic */

  /* Typography System - Renaissance Elegance */
  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-display: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-script: 'Tangerine', cursive;

  /* Legacy font aliases */
  --font-primary: 'Cormorant Garamond', Georgia, serif;
  --font-secondary: 'Inter', sans-serif;

  /* Font Sizes - Fluid Typography */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 1.75;

  /* Letter Spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;
}

/* ===== GLOBAL RESETS ===== */
* {
  box-sizing: border-box;
}

/* ===== TYPOGRAPHY - Renaissance Elegance ===== */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  background: var(--bg-primary);
  background-image: var(--vignette);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Fresco Texture Overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" /></filter><rect width="300" height="300" filter="url(%23noise)" opacity="0.03"/></svg>');
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

/* Heading Hierarchy - Renaissance Serif Elegance */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
  word-wrap: break-word;
  letter-spacing: var(--tracking-wide);
  position: relative;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  font-family: var(--font-display);
  color: var(--celestial-blue);
}

h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--celestial-blue);
}

h3 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  font-family: var(--font-serif);
}

h4 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  font-family: var(--font-serif);
}

h5 {
  font-size: var(--text-lg);
  font-weight: 500;
  font-family: var(--font-serif);
}

h6 {
  font-size: var(--text-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-sans);
  color: var(--text-accent);
}

/* Responsive typography */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  h1 { letter-spacing: var(--tracking-tight); }
  h2 { letter-spacing: var(--tracking-normal); }
}

/* Paragraph Styling */
p {
  margin-top: 0;
  margin-bottom: var(--spacing-sm);
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: var(--leading-relaxed);
  font-weight: 400;
}

p.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  font-weight: 400;
  color: var(--text-secondary);
}

/* Emphasis & Inline Elements */
strong, b {
  font-weight: 600;
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

a {
  color: var(--loona-rose);
  text-decoration: none;
  transition: color var(--transition-fast);
  word-wrap: break-word;
}

a:hover {
  color: var(--ovulation);
  text-decoration: underline;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--spacing-sm);
  }
}

.container-narrow {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .container-narrow {
    padding: 0 var(--spacing-sm);
  }
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-soft);
  transition: all var(--transition-normal);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  word-wrap: break-word;
  position: relative;
  border: 1px solid rgba(232, 237, 242, 0.6);
}

/* Illuminated Manuscript Card Style */
.card-illuminated {
  background: linear-gradient(135deg, #FFFFFF 0%, var(--bg-fresco) 100%);
  border-left: 4px solid var(--golden-ochre);
  box-shadow: var(--shadow-medium);
}

.card-illuminated::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    var(--golden-ochre) 0%,
    var(--terracotta) 50%,
    var(--golden-ochre) 100%);
  opacity: 0.5;
}

.card:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
  border-color: var(--lunar-silver);
}

.card-header {
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--bg-secondary);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  min-height: 48px;
  font-family: var(--font-primary);
  letter-spacing: var(--tracking-wide);
  line-height: var(--leading-normal);
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--golden-ochre) 100%);
  color: white;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-slow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: white;
  text-decoration: none;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-subtle), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 2px solid var(--loona-lavender);
  font-weight: 500;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--loona-lavender);
  color: white;
  border-color: var(--loona-lavender);
  text-decoration: none;
}

.btn-danger {
  background: #EF4444;
  color: white;
  font-weight: 600;
}

.btn-danger:hover:not(:disabled) {
  background: #DC2626;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.btn-success {
  background: #10B981;
  color: white;
  font-weight: 600;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--text-light);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--text-secondary);
  text-decoration: none;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* Button Loading State */
.btn-loading {
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* Mobile Button Optimization */
@media (max-width: 768px) {
  .btn {
    padding: 12px 20px;
    font-size: 15px;
  }

  .btn-block {
    width: 100%;
  }
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: var(--spacing-md);
}

label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
  font-family: var(--font-primary);
  letter-spacing: var(--tracking-normal);
  line-height: var(--leading-snug);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--text-light);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  transition: border-color var(--transition-fast);
  background: var(--bg-card);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--loona-lavender);
  box-shadow: 0 0 0 3px rgba(232, 213, 242, 0.2);
}

.form-error {
  color: #E63946;
  font-size: var(--text-sm);
  margin-top: var(--spacing-xs);
  font-weight: 500;
  line-height: var(--leading-snug);
}

.form-help {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-top: var(--spacing-xs);
  line-height: var(--leading-relaxed);
  font-weight: 400;
}

/* ===== RANGE SLIDERS (Energy/Communication) ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(to right, #A8DADC, #FFD93D);
  outline: none;
  margin: var(--spacing-sm) 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  border: none;
}

/* ===== EMOJI FEEDBACK ===== */
.emoji-feedback {
  text-align: center;
  font-size: 48px;
  margin: var(--spacing-sm) 0;
  transition: transform var(--transition-normal);
  user-select: none;
}

.emoji-feedback.pulse {
  animation: pulse 0.3s ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ===== SENSITIVITY BUTTONS ===== */
.sensitivity-options,
.social-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-sm);
  margin: var(--spacing-sm) 0;
}

/* Responsive grid - stack on mobile */
@media (max-width: 640px) {
  .sensitivity-options,
  .social-options {
    grid-template-columns: 1fr;
  }
}

.option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-md);
  border: 2px solid var(--text-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 100px;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.option-btn:hover {
  border-color: var(--loona-lavender);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.option-btn.selected {
  border-color: var(--loona-rose);
  background: linear-gradient(135deg, rgba(245, 197, 212, 0.1), rgba(232, 213, 242, 0.1));
  box-shadow: 0 0 0 3px rgba(245, 197, 212, 0.3);
}

.option-btn .icon {
  font-size: 32px;
  margin-bottom: var(--spacing-xs);
}

.option-btn .label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  word-wrap: break-word;
}

.option-btn .description {
  font-size: 12px;
  color: var(--text-secondary);
  word-wrap: break-word;
}

/* ===== PHASE VISUALIZATION ===== */
.phase-display {
  text-align: center;
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
  transition: background-color var(--transition-slow);
}

.phase-display.menstrual {
  background: linear-gradient(135deg, var(--menstrual), rgba(168, 218, 220, 0.5));
}

.phase-display.follicular {
  background: linear-gradient(135deg, var(--follicular), rgba(255, 217, 61, 0.5));
}

.phase-display.ovulation {
  background: linear-gradient(135deg, var(--ovulation), rgba(255, 158, 205, 0.5));
}

.phase-display.luteal {
  background: linear-gradient(135deg, var(--luteal), rgba(184, 164, 217, 0.5));
}

.phase-display .phase-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.phase-display .phase-day {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-md);
}

.phase-display .phase-description {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== INSIGHT CARDS ===== */
.insight-card {
  padding: var(--spacing-md);
  border-left: 4px solid var(--loona-lavender);
  margin-bottom: var(--spacing-md);
  background: var(--insight-neutral);
  border-radius: var(--radius-md);
}

.insight-card.positive {
  border-left-color: var(--insight-positive);
  background: rgba(184, 230, 184, 0.2);
}

.insight-card.caution {
  border-left-color: var(--insight-caution);
  background: rgba(255, 229, 180, 0.2);
}

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

.insight-type {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.insight-confidence {
  font-size: 12px;
  color: var(--text-light);
}

.insight-content {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: var(--spacing-sm);
}

.insight-research {
  font-size: 14px;
  color: var(--text-secondary);
  padding-top: var(--spacing-sm);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* ===== STREAK BADGE ===== */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--loona-rose), var(--loona-lavender));
  color: white;
  border-radius: var(--radius-full);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.streak-badge .streak-number {
  font-size: 20px;
}

/* ===== ALERTS ===== */
.alert {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

.alert-success {
  background: rgba(184, 230, 184, 0.3);
  border-left: 4px solid var(--insight-positive);
  color: #2D5016;
}

.alert-info {
  background: rgba(224, 231, 255, 0.3);
  border-left: 4px solid var(--loona-lavender);
  color: var(--text-primary);
}

.alert-error {
  background: rgba(230, 57, 70, 0.1);
  border-left: 4px solid #E63946;
  color: #8B0000;
}

/* ===== NAVIGATION ===== */
nav {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-md) 0;
  margin-bottom: var(--spacing-lg);
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--loona-rose);
}

.nav-links {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-primary);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--loona-rose);
  text-decoration: none;
}

/* ===== PRIVACY BADGE ===== */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 6px 12px;
  background: rgba(45, 49, 66, 0.05);
  border-radius: var(--radius-full);
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== ACCESSIBILITY ===== */
:focus-visible {
  outline: 3px solid var(--loona-lavender);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== SCIENCE BULB TOOLTIPS ===== */
.science-bulb {
  display: inline-block;
  cursor: help;
  font-size: 1.2em;
  margin-left: 4px;
  transition: transform var(--transition-fast);
  position: relative;
}

.science-bulb:hover {
  transform: scale(1.2);
  animation: glow 1s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.3) drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
  }
}

/* Enhanced tooltip styling for title attribute */
.science-bulb[title]:hover::after {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== DATE PICKER ENHANCEMENTS ===== */
input[type="date"] {
  cursor: pointer;
  position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  font-size: 1.2em;
  filter: opacity(0.7);
  transition: filter var(--transition-fast);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  filter: opacity(1);
}

/* Flatpickr custom styling */
.flatpickr-calendar {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: none;
}

.flatpickr-months .flatpickr-month {
  background: linear-gradient(135deg, var(--loona-rose), var(--loona-lavender));
  color: white;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.flatpickr-current-month {
  color: white;
}

.flatpickr-day.selected {
  background: var(--loona-rose);
  border-color: var(--loona-rose);
  color: white;
}

.flatpickr-day.today {
  border-color: var(--loona-lavender);
  background: rgba(232, 213, 242, 0.2);
}

.flatpickr-day:hover {
  background: rgba(245, 197, 212, 0.2);
  border-color: var(--loona-rose);
}

/* ===== RESPONSIVE ALIGNMENT FIXES ===== */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .container {
    padding: 0 var(--spacing-sm);
  }

  .sensitivity-options,
  .social-options {
    grid-template-columns: 1fr;
  }

  .option-btn {
    flex-direction: row;
    min-height: auto;
    text-align: left;
  }

  .option-btn .icon {
    margin-bottom: 0;
    margin-right: var(--spacing-sm);
  }

  /* Navigation responsive - don't force full width on nav buttons */
  nav .container {
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: flex-start;
  }

  .nav-links {
    flex-wrap: wrap;
    width: 100%;
  }

  .nav-links .btn {
    width: auto;
  }

  /* Form buttons can be full width */
  .form-group .btn,
  form .btn-block {
    width: 100%;
  }
}

/* ===== BUTTON ALIGNMENT FIXES ===== */
.nav-links .btn {
  min-width: auto;
  padding: 10px 20px;
  min-height: 44px;
}

.form-group .btn {
  margin-top: var(--spacing-xs);
}

/* Ensure buttons in grids are properly aligned */
.card .btn {
  margin-top: auto;
}

/* ===== TOGGLE SWITCHES (for granular sharing settings) ===== */
.toggle-group {
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-sm);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.toggle-label {
  flex: 1;
  margin-right: var(--spacing-md);
}

.toggle-label-text {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 15px;
  display: block;
  margin-bottom: 4px;
}

.toggle-label-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Toggle Switch Styling */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--text-light);
  transition: 0.3s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--loona-rose), var(--loona-lavender));
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(245, 197, 212, 0.3);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Disabled state */
.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-item.disabled {
  opacity: 0.6;
}

.toggle-item.disabled .toggle-label-text {
  color: var(--text-secondary);
}

/* ===== SHAREABLE INVITE CARD ===== */
.invite-card {
  position: relative;
  background: linear-gradient(135deg, #FFF5F8, #F5E6FF);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 500px;
  margin: var(--spacing-lg) auto;
  border: 2px solid rgba(245, 197, 212, 0.3);
  overflow: hidden;
}

.invite-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(245, 197, 212, 0.1) 0%, transparent 70%);
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.invite-card-content {
  position: relative;
  z-index: 1;
}

.invite-card-header {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-sm);
  background: linear-gradient(135deg, var(--loona-rose), var(--loona-lavender));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

.invite-card-message {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: var(--spacing-lg);
  font-weight: 400;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.invite-card-code-wrapper {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  box-shadow: var(--shadow-sm);
  border: 2px dashed var(--loona-lavender);
}

.invite-card-code-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
}

.invite-card-code {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--loona-rose);
  letter-spacing: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.invite-card-code:hover {
  transform: scale(1.05);
  color: var(--ovulation);
}

.invite-card-actions {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  margin-top: var(--spacing-lg);
  flex-wrap: wrap;
}

.invite-card-footer {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Copy button with success state */
.btn-copy {
  position: relative;
  transition: all var(--transition-fast);
}

.btn-copy.copied {
  background: var(--insight-positive);
  color: white;
}

.btn-copy.copied::after {
  content: '✓ Copied!';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  white-space: nowrap;
  animation: slideDown 2s ease-in-out;
}

@keyframes slideDown {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  20% { opacity: 1; transform: translate(-50%, 0); }
  80% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 10px); }
}

/* ===== ENHANCED EMOJI FEEDBACK ===== */
.emoji-feedback {
  font-size: 3.5rem;
  text-align: center;
  margin: var(--spacing-md) 0;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  animation: bounce 0.5s ease-in-out;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.emoji-feedback:hover {
  transform: scale(1.1) rotate(5deg);
}

/* ===== GRADIENT ACCENT CARDS ===== */
.card-accent {
  position: relative;
  overflow: hidden;
}

.card-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--loona-rose), var(--loona-lavender), var(--loona-peach));
  background-size: 200% 100%;
  animation: gradientSlide 3s ease infinite;
}

@keyframes gradientSlide {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 0%; }
  100% { background-position: 0% 0%; }
}

/* ===== ENHANCED FORM INPUTS ===== */
.form-control:focus {
  border-color: var(--loona-lavender);
  box-shadow: 0 0 0 3px rgba(232, 213, 242, 0.2);
  outline: none;
  transform: translateY(-1px);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
  transition: all var(--transition-normal);
}

textarea.form-control:focus {
  min-height: 120px;
}

/* Range slider enhancements */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--loona-rose), var(--loona-lavender));
  outline: none;
  opacity: 0.9;
  transition: opacity var(--transition-fast);
  cursor: pointer;
}

input[type="range"]:hover {
  opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 3px solid var(--loona-lavender);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 3px solid var(--loona-lavender);
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ===== LOVE NOTES & EMPATHY MESSAGES ===== */
.love-note {
  background: linear-gradient(135deg, rgba(255, 245, 248, 0.8), rgba(245, 230, 255, 0.8));
  border-left: 4px solid var(--loona-rose);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
  font-style: italic;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}

.love-note::before {
  content: '💝';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 2rem;
  opacity: 0.2;
}

.love-note p {
  margin: 0;
  line-height: 1.6;
}

/* ===== PARTNER CONNECTION BADGE ===== */
.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(245, 197, 212, 0.2), rgba(232, 213, 242, 0.2));
  border: 2px solid var(--loona-lavender);
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--text-primary);
  animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  10% { transform: scale(1.05); }
  20% { transform: scale(1); }
}

.connection-badge .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--insight-positive);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}


/* ========================================= */
/* RENAISSANCE BIOPHILIC DESIGN ELEMENTS */
/* ========================================= */

/* Botanical Flourish Dividers */
.botanical-divider {
  width: 100%;
  height: 60px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 60"><path d="M0,30 Q150,10 300,30 T600,30 T900,30 T1200,30" stroke="%239CAF88" stroke-width="1.5" fill="none" opacity="0.4"/><circle cx="600" cy="30" r="8" fill="%23D4A574" opacity="0.6"/><path d="M580,30 Q590,20 600,22 Q610,20 620,30" stroke="%239CAF88" stroke-width="1" fill="none"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  margin: var(--spacing-xl) 0;
  opacity: 0.7;
}

/* Organic Water Ripple Effect */
@keyframes waterRipple {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.3;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

.water-ripple {
  position: relative;
}

.water-ripple::before,
.water-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  border: 2px solid var(--sage-green);
  animation: waterRipple 3s ease-out infinite;
}

.water-ripple::after {
  animation-delay: 1.5s;
}

/* Fern Fractal Pattern Background */
.fern-pattern {
  background-image: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 35px,
      rgba(156, 175, 136, 0.03) 35px,
      rgba(156, 175, 136, 0.03) 70px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 35px,
      rgba(156, 175, 136, 0.03) 35px,
      rgba(156, 175, 136, 0.03) 70px
    );
}

/* Petal Opening Animation */
@keyframes petalOpen {
  0% {
    transform: scale(0) rotate(-90deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.1) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.petal-open {
  animation: petalOpen var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Parallax Scrolling Layers */
.parallax-layer {
  transform-style: preserve-3d;
  transition: transform var(--transition-slow);
}

.parallax-layer-1 {
  transform: translateZ(-1px) scale(2);
}

.parallax-layer-2 {
  transform: translateZ(-2px) scale(3);
}

/* Constellation Connection Lines */
.constellation-line {
  stroke: var(--lunar-silver);
  stroke-width: 1;
  stroke-dasharray: 5, 5;
  animation: constellationDraw 2s ease-out forwards;
}

@keyframes constellationDraw {
  from {
    stroke-dashoffset: 100;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* Wisdom Quote Parchment Style */
.wisdom-quote {
  position: relative;
  background: linear-gradient(135deg, #FAF8F5 0%, #F5F1EC 100%);
  border-left: 3px solid var(--golden-ochre);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin: var(--spacing-xl) 0;
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  font-style: italic;
  color: var(--text-primary);
  box-shadow: var(--shadow-medium);
}

.wisdom-quote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 15px;
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--golden-ochre);
  opacity: 0.3;
  line-height: 1;
}

.wisdom-quote-author {
  display: block;
  margin-top: var(--spacing-sm);
  font-family: var(--font-script);
  font-size: var(--text-xl);
  font-style: normal;
  color: var(--terracotta);
  text-align: right;
}

/* Seasonal Phase Card Styles */
.phase-card-winter {
  background: linear-gradient(135deg, #E8EDF2 0%, #FFFFFF 100%);
  border-top: 3px solid #6B8BA6;
}

.phase-card-spring {
  background: linear-gradient(135deg, #F0F5EC 0%, #FFFFFF 100%);
  border-top: 3px solid #9CAF88;
}

.phase-card-summer {
  background: linear-gradient(135deg, #FFF8F0 0%, #FFFFFF 100%);
  border-top: 3px solid #D4A574;
}

.phase-card-autumn {
  background: linear-gradient(135deg, #FCF4F2 0%, #FFFFFF 100%);
  border-top: 3px solid #C5877D;
}

/* Organic Portal Transition Effect */
@keyframes portalOpen {
  0% {
    clip-path: circle(0% at 50% 50%);
    opacity: 0;
  }
  100% {
    clip-path: circle(150% at 50% 50%);
    opacity: 1;
  }
}

.portal-enter {
  animation: portalOpen 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Gentle Breathing Animation (for meditation/rest states) */
@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.breathing-element {
  animation: breathe 4s ease-in-out infinite;
}

/* Nautilus Spiral Path (Golden Ratio) */
.nautilus-spiral {
  fill: none;
  stroke: var(--golden-ochre);
  stroke-width: 2;
  opacity: 0.2;
  animation: spiralGrow 2s ease-out forwards;
}

@keyframes spiralGrow {
  from {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dasharray: 1000;
    stroke-dashoffset: 0;
  }
}

/* Illuminated Initial Capital Letter */
.illuminated-initial {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
  float: left;
  margin: 0 var(--spacing-sm) 0 0;
  color: var(--terracotta);
  text-shadow: 2px 2px 4px rgba(212, 144, 108, 0.3);
}

/* Sacred Geometry Background Pattern */
.sacred-geometry {
  background-image: 
    radial-gradient(circle at 20% 50%, transparent 0%, transparent 20%, rgba(232, 237, 242, 0.1) 20%, rgba(232, 237, 242, 0.1) 21%, transparent 21%),
    radial-gradient(circle at 80% 50%, transparent 0%, transparent 20%, rgba(212, 165, 116, 0.1) 20%, rgba(212, 165, 116, 0.1) 21%, transparent 21%);
  background-size: 100px 100px;
}

/* Moonbeam Light Effect */
@keyframes moonbeam {
  0% {
    opacity: 0.2;
    transform: translateY(-10px);
  }
  50% {
    opacity: 0.6;
    transform: translateY(0px);
  }
  100% {
    opacity: 0.2;
    transform: translateY(10px);
  }
}

.moonbeam {
  position: absolute;
  width: 2px;
  height: 100px;
  background: linear-gradient(to bottom, transparent, var(--lunar-silver), transparent);
  animation: moonbeam 3s ease-in-out infinite;
  opacity: 0.3;
}

/* Gentle Fade In with Organic Timing */
.fade-in-organic {
  opacity: 0;
  animation: fadeInOrganic 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fadeInOrganic {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Stagger animation for multiple elements */
.fade-in-organic:nth-child(1) { animation-delay: 0.1s; }
.fade-in-organic:nth-child(2) { animation-delay: 0.2s; }
.fade-in-organic:nth-child(3) { animation-delay: 0.3s; }
.fade-in-organic:nth-child(4) { animation-delay: 0.4s; }
.fade-in-organic:nth-child(5) { animation-delay: 0.5s; }

/* Responsive adjustments for biophilic elements */
@media (max-width: 768px) {
  .wisdom-quote {
    font-size: var(--text-base);
    padding: var(--spacing-md);
  }

  .illuminated-initial {
    font-size: 3rem;
  }

  .botanical-divider {
    height: 40px;
  }
}

