/* Variables - Premium Dark Ruby Theme */
:root {
  --bg0: #08070A;
  --bg1: #12060B;
  --ruby1: #7A0C1E;
  --ruby2: #B1122E;
  --rose: #E45B7A;

  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-light: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 16px 40px -10px rgba(122, 12, 30, 0.4);
  --glass-blur: blur(24px);

  --text-primary: #F9F4F5;
  --text-secondary: rgba(249, 244, 245, 0.65);
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background: var(--bg0);
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  justify-content: center;
}

/* Typography Headings */
h1,
h2,
h3,
.reminder-text,
.day-label,
.welcome-title,
.app-label,
.nav-title {
  font-family: 'Cormorant Garamond', serif;
}

/* Background & Ambient Animation */
.ambient-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top center, var(--bg1) 0%, var(--bg0) 80%);
  z-index: 0;
  overflow: hidden;
}

.bokeh {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  mix-blend-mode: screen;
  pointer-events: none;
}

.bokeh-1 {
  width: 300px;
  height: 300px;
  background: var(--ruby1);
  top: -100px;
  left: 10%;
  animation: drift 15s infinite alternate ease-in-out;
}

.bokeh-2 {
  width: 400px;
  height: 400px;
  background: var(--ruby2);
  bottom: -200px;
  right: -50px;
  animation: drift 20s infinite alternate-reverse ease-in-out;
  opacity: 0.3;
}

.bokeh-3 {
  width: 200px;
  height: 200px;
  background: var(--rose);
  top: 40%;
  left: 60%;
  animation: drift 12s infinite alternate ease-in-out;
  opacity: 0.2;
}

@keyframes drift {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(-30px, 40px) scale(1.1);
  }
}

/* Noise overlay */
.noise-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.04;
  z-index: 1;
  pointer-events: none;
}

/* Layout */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 500px;
  margin: 0 auto;
  right: 0;
  display: flex;
  flex-direction: column;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.screen.active {
  opacity: 1;
  pointer-events: auto;
}

/* Glassmorphism Classes */
.glass-pill {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-bottom-color: rgba(255, 255, 255, 0.05);
  /* Gradient stroke effect */
  border-radius: 100px;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-light);
  box-shadow: var(--glass-shadow);
  border-radius: 28px;
  position: relative;
  overflow: hidden;
}

/* Utilities */
.btn {
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  outline: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn:active,
.btn-icon:active,
.nav-btn:active {
  transform: scale(0.92);
}

.primary-btn {
  background: var(--text-primary);
  color: var(--bg1);
  border-radius: 100px;
  font-weight: 500;
  padding: 16px 32px;
  font-size: 1.05rem;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.text-btn {
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 16px;
}

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

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}

.btn-icon:active {
  background: var(--glass-bg-hover);
}

.svg-icon {
  width: 24px;
  height: 24px;
}

.small-icon {
  width: 16px;
  height: 16px;
}

/* Welcome Screen */
#screen-welcome {
  justify-content: center;
  align-items: center;
  padding: 24px;
}

.welcome-card {
  width: 100%;
  text-align: center;
  padding: 40px 32px;
}

.welcome-title {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.1;
  color: var(--text-primary);
}

.heart-icon {
  font-style: normal;
}

.welcome-text {
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-weight: 300;
}

.action-row {
  margin-top: 32px;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  margin: 16px 16px 0;
  z-index: 20;
}

.app-label {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.streak-btn {
  font-family: 'Inter', sans-serif;
  color: var(--ruby2);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

/* Day Container */
.day-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  position: relative;
  perspective: 1000px;
  margin-bottom: 80px;
  /* Space for bottom nav */
}

/* Day Picker Button */
.day-label-btn {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  /* padding: 8px 16px; */
  /* border-radius: 100px; */
  transition: color 0.2s, background 0.2s;
}

.day-label-btn:active {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

.day-label {
  font-size: 1.1rem;
  font-style: italic;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Main Card */
.main-card {
  width: 100%;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.5s ease;
}

.card-content {
  padding: 40px 32px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.reminder-text {
  font-size: 2rem;
  line-height: 1.3;
  font-weight: 400;
  color: var(--text-primary);
}

.reminder-subtext {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-top: 24px;
  font-style: italic;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.1);
}

.read-today-btn {
  background: transparent;
  border: 1px solid var(--glass-border-light);
  color: var(--text-primary);
  border-radius: 100px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.read-today-btn.read {
  background: var(--ruby2);
  border-color: var(--ruby2);
  color: #fff;
}

/* Heart Save */
.heart-btn .heart-path {
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 1.5;
  transition: all 0.3s ease;
}

.heart-btn.saved .heart-path {
  fill: var(--text-primary);
}

/* Bottom Nav Container */
.bottom-nav-container {
  position: absolute;
  bottom: 24px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 20px;
}

.bottom-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  width: 100%;
}

.nav-btn {
  padding: 12px;
}

.today-btn {
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.85rem;
}

/* Modal Picker */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 7, 10, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 300px;
  padding: 32px 24px;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-title {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.input-group {
  margin-bottom: 24px;
}

.glass-input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border-light);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  text-align: center;
  padding: 12px;
  width: 100px;
  border-radius: 12px;
  outline: none;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions .btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
}

/* Favorites screen */
#screen-favorites {
  padding: 0 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.favs-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 40px;
}

.fav-card {
  padding: 24px;
  cursor: pointer;
  background: var(--glass-bg);
  /* slightly less transparent wrapper */
  margin-bottom: 8px;
}

.fav-day {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  color: var(--ruby2);
  margin-bottom: 12px;
  font-weight: 600;
}

.fav-text {
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
}

/* Swipe animations */
.swipe-left {
  transform: translateX(-60px) rotateY(-10deg);
  opacity: 0;
}

.swipe-right {
  transform: translateX(60px) rotateY(10deg);
  opacity: 0;
}

.card-enter {
  transform: translateX(0) rotateY(0);
  opacity: 1;
}

/* Interactive Sparkles */
#sparkles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #FFF;
  border-radius: 50%;
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8);
  opacity: 1;
  pointer-events: none;
}