/* ==========================================================================
   HERCARE 8D PHYSICAL DESK PAGE-FLIP CALENDAR (2026 - 2027)
   Tactile Paper Texture, Twin-Loop Spiral Binder & Wooden Easel Stand
   ========================================================================== */

.calendar-5d-section {
  padding: clamp(80px, 8vw, 120px) 0 clamp(90px, 9vw, 130px);
  position: relative;
  overflow: hidden;
}

.calendar-5d-container {
  max-width: 1160px;
  margin: 0 auto;
}

/* 8D Desk Calendar Stage with Realistic Perspective */
.calendar-stage {
  position: relative;
  perspective: 1600px;
  margin: 50px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 980px;
}

/* Physical Wooden / Obsidian Easel Stand Kickstand Top */
.calendar-easel-stand-top {
  width: 84%;
  height: 24px;
  background: linear-gradient(180deg, #1e1e2d 0%, #12121a 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.15), 0 -8px 25px rgba(0, 0, 0, 0.8);
  margin-bottom: -10px;
  position: relative;
  z-index: 5;
}

/* Heavy Metallic Twin-Loop Wire Spiral Binder Row */
.calendar-spiral-binder-row {
  width: 92%;
  max-width: 860px;
  height: 38px;
  display: flex;
  justify-content: space-evenly;
  align-items: flex-start;
  position: relative;
  z-index: 30;
  margin-bottom: -18px;
  pointer-events: none;
}

.wire-loop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loop-coil {
  width: 12px;
  height: 36px;
  background: linear-gradient(to right, #475569 0%, #94A3B8 25%, #FFFFFF 50%, #CBD5E1 75%, #334155 100%);
  border-radius: 9999px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.9), inset 0 1px 2px rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 2;
}

.punched-hole {
  width: 10px;
  height: 12px;
  background: #030306;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.95);
  margin-top: -6px;
  position: relative;
  z-index: 1;
}

/* Realistic Physical Paper Stack Card */
.physical-calendar-sheet {
  width: 100%;
  background: #0D0D14 radial-gradient(circle at 50% 0%, rgba(244, 63, 94, 0.08) 0%, rgba(13, 13, 20, 0.98) 75%);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 28px 28px 24px 24px;
  padding: clamp(28px, 4vw, 48px);
  position: relative;
  z-index: 20;
  transform-style: preserve-3d;
  
  /* Authentic Stacked Physical Paper Edge Depth */
  box-shadow: 
    0 1px 0 #222232,
    0 3px 0 #1a1a26,
    0 5px 0 #14141e,
    0 7px 0 #0e0e16,
    0 9px 0 #08080e,
    0 25px 75px rgba(0, 0, 0, 0.95),
    0 0 35px rgba(244, 63, 94, 0.15);
}

/* Paper Perforation Tear Line */
.paper-perforation-line {
  width: 100%;
  height: 1px;
  border-top: 2px dashed rgba(255, 255, 255, 0.12);
  margin: -10px 0 24px;
}

/* Header Controls Bar (Year, Month, Navigation) */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.calendar-year-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 4px;
  gap: 4px;
}

.year-btn {
  padding: 8px 22px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 800;
  color: #94A3B8;
  transition: all 0.25s var(--ease-spring);
  cursor: pointer;
  letter-spacing: 0.04em;
}

.year-btn.active {
  background: linear-gradient(135deg, #FB7185 0%, #F43F5E 100%);
  color: #FFFFFF;
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.5);
}

.calendar-month-display {
  display: flex;
  align-items: center;
  gap: 16px;
}

.month-nav-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.month-nav-btn:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: #F43F5E;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
}

.current-month-heading {
  font-family: var(--font-display, 'Junicode', Georgia, serif);
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 800;
  color: #FFFFFF;
  min-width: 240px;
  text-align: center;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* 3D Page Flip Viewport */
.calendar-flip-viewport {
  position: relative;
  min-height: 420px;
  margin-top: 24px;
  transform-style: preserve-3d;
}

/* Calendar Days Grid */
.calendar-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  transform-origin: top center;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

/* Calendar Day Cell (Stamped Physical Card) */
.cal-day-cell {
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
  position: relative;
  user-select: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.cal-day-cell:hover {
  transform: translateY(-4px) scale(1.06);
  border-color: rgba(244, 63, 94, 0.7);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85), 0 0 22px rgba(244, 63, 94, 0.35);
  z-index: 10;
}

.cal-day-cell.empty {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

.cal-day-cell.selected {
  border-color: #FFFFFF !important;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.5), inset 0 0 15px rgba(244, 63, 94, 0.3) !important;
  transform: scale(1.08);
  z-index: 15;
}

/* Phase Indicators on Date Cells */
.cal-day-cell.phase-menstrual {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.4);
}
.cal-day-cell.phase-menstrual .cal-day-num {
  color: #FB7185;
}

.cal-day-cell.phase-follicular {
  background: rgba(56, 189, 248, 0.09);
  border-color: rgba(56, 189, 248, 0.3);
}
.cal-day-cell.phase-follicular .cal-day-num {
  color: #38BDF8;
}

.cal-day-cell.phase-ovulation {
  background: rgba(192, 132, 252, 0.15);
  border-color: rgba(192, 132, 252, 0.5);
  box-shadow: 0 0 14px rgba(192, 132, 252, 0.25);
}
.cal-day-cell.phase-ovulation .cal-day-num {
  color: #E9D5FF;
}

.cal-day-cell.phase-luteal {
  background: #111118;
  border-color: rgba(255, 255, 255, 0.08);
}
.cal-day-cell.phase-luteal .cal-day-num {
  color: #FFFFFF;
  font-weight: 800;
}
.cal-day-cell.phase-luteal .cal-day-pill {
  color: #94A3B8;
  background: #1A1A26;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cal-day-num {
  font-size: clamp(0.875rem, 1.3vw, 1.125rem);
  font-weight: 700;
  color: #FFFFFF;
}

.cal-day-icon {
  font-size: 0.8125rem;
  line-height: 1;
}

.cal-day-pill {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

/* 8D Realistic Top-Hinged 3D Physical Page-Turn Curl Physics */
.page-flip-anim-forward {
  animation: physicalPageCurlForward 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.page-flip-anim-backward {
  animation: physicalPageCurlBackward 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes physicalPageCurlForward {
  0% {
    transform: rotateX(0deg) translateY(0);
    filter: brightness(1);
    opacity: 1;
  }
  45% {
    transform: rotateX(-55deg) translateY(-20px) scale(0.94);
    filter: brightness(0.7) drop-shadow(0 25px 30px rgba(0,0,0,0.9));
    opacity: 0.4;
  }
  100% {
    transform: rotateX(0deg) translateY(0);
    filter: brightness(1);
    opacity: 1;
  }
}

@keyframes physicalPageCurlBackward {
  0% {
    transform: rotateX(0deg) translateY(0);
    filter: brightness(1);
    opacity: 1;
  }
  45% {
    transform: rotateX(55deg) translateY(20px) scale(0.94);
    filter: brightness(0.7) drop-shadow(0 -25px 30px rgba(0,0,0,0.9));
    opacity: 0.4;
  }
  100% {
    transform: rotateX(0deg) translateY(0);
    filter: brightness(1);
    opacity: 1;
  }
}

/* 8D Biological Day Inspector HUD Card */
.calendar-inspector-hud {
  margin-top: 32px;
  background: rgba(8, 8, 12, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: clamp(20px, 3vw, 32px);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.hud-date-title {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  color: #FFFFFF;
  font-weight: 800;
  margin-bottom: 4px;
}

.hud-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.hud-stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px;
}

.hud-stat-label {
  font-size: 0.6875rem;
  color: #94A3B8;
  font-weight: 700;
  text-transform: uppercase;
}

.hud-stat-val {
  font-size: 1rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-top: 2px;
}

/* Phase Legend Row */
.calendar-legend-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: #CBD5E1;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Realistic Triangular Easel Tabletop Base */
.calendar-easel-base {
  width: 96%;
  height: 28px;
  position: relative;
  z-index: 10;
  margin-top: -12px;
}

.easel-wood-edge {
  width: 100%;
  height: 16px;
  background: linear-gradient(180deg, #222232 0%, #14141e 50%, #0a0a10 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0 0 18px 18px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.9), inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.easel-table-shadow {
  width: 105%;
  height: 24px;
  margin-left: -2.5%;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 70%);
  margin-top: -4px;
}

/* Interactive Dog-Ear Corner Drag Handles (Manual Peel & Flip) */
.cal-corner-curl-handle {
  position: absolute;
  bottom: -6px;
  width: 60px;
  height: 60px;
  z-index: 40;
  cursor: grab;
  display: flex;
  align-items: flex-end;
  padding: 6px;
  transition: transform 0.25s var(--ease-spring), opacity 0.2s ease;
  user-select: none;
  touch-action: none;
}

.cal-corner-curl-handle:active {
  cursor: grabbing;
}

.cal-corner-curl-handle.corner-right {
  right: -6px;
  justify-content: flex-end;
}

.cal-corner-curl-handle.corner-left {
  left: -6px;
  justify-content: flex-start;
}

.cal-corner-curl-handle::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  transition: all 0.25s var(--ease-spring);
}

.cal-corner-curl-handle.corner-right::before {
  bottom: 0;
  right: 0;
  border-bottom: 34px solid #1E2232;
  border-left: 34px solid transparent;
  border-radius: 0 0 16px 0;
  filter: drop-shadow(-3px -3px 5px rgba(0,0,0,0.8));
}

.cal-corner-curl-handle.corner-left::before {
  bottom: 0;
  left: 0;
  border-bottom: 34px solid #1E2232;
  border-right: 34px solid transparent;
  border-radius: 0 0 0 16px;
  filter: drop-shadow(3px -3px 5px rgba(0,0,0,0.8));
}

.cal-corner-curl-handle:hover.corner-right::before {
  border-bottom: 48px solid #F43F5E;
  border-left: 48px solid transparent;
  transform: scale(1.1);
  filter: drop-shadow(-5px -5px 12px rgba(244,63,94,0.6));
}

.cal-corner-curl-handle:hover.corner-left::before {
  border-bottom: 48px solid #38BDF8;
  border-right: 48px solid transparent;
  transform: scale(1.1);
  filter: drop-shadow(5px -5px 12px rgba(56,189,248,0.6));
}

.corner-fold-hint {
  font-size: 0.5625rem;
  font-weight: 800;
  color: #FFFFFF;
  position: relative;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

/* Manual Drag Instruction Hint Pill */
.cal-drag-hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94A3B8;
  margin: 14px auto 0;
  transition: all 0.3s ease;
}

.cal-drag-hint-pill:hover {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.4);
  color: #FFFFFF;
}

.drag-pulse-hand {
  animation: handWave 2s infinite ease-in-out;
}

@keyframes handWave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Real-Time Dragging State on Calendar Grid */
.calendar-days-grid.is-dragging {
  transition: none !important;
  cursor: grabbing !important;
}

@media (max-width: 768px) {
  .calendar-inspector-hud {
    grid-template-columns: 1fr;
  }
  .calendar-toolbar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .calendar-month-display {
    justify-content: center;
  }
  .cal-day-cell {
    padding: 4px 2px;
    border-radius: 10px;
  }
  .calendar-spiral-binder-row {
    width: 96%;
  }
  .loop-coil {
    width: 8px;
    height: 28px;
  }
  .punched-hole {
    width: 7px;
    height: 9px;
  }
  .cal-corner-curl-handle {
    width: 45px;
    height: 45px;
  }
}

/* Real-Life Synchronized "Today" Indicator */
.cal-day-cell.is-today {
  border-color: #34D399 !important;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.35);
  position: relative;
}

.cal-day-cell.is-today::before {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 8px #34D399;
  z-index: 2;
}

.cal-day-cell.is-today.selected {
  border-color: #FFFFFF !important;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.6), 0 0 16px rgba(52, 211, 153, 0.5) !important;
}

/* Quick Jump to Today Button in Calendar Toolbar */
.cal-today-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #34D399;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cal-today-btn:hover {
  background: rgba(52, 211, 153, 0.24);
  border-color: #34D399;
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.35);
}
