/*
 * CalVerve 2027 - Calendar 3D Desk Standee & 13-Leaf Mockup Engine
 * Realistic A5 Dimensions (148 x 210 mm) with Wire-O & Galley Imprint
 */

.calendar-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

/* Desk Standee Wrapper with 3D Perspective */
.calendar-standee-stage {
  perspective: 1400px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 36px 14px 44px;
  background: radial-gradient(circle at 50% 30%, #ffffff 0%, #f0f7ff 60%, #e2e8f0 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03), 0 10px 30px -10px rgba(15, 23, 42, 0.08);
  transition: all 0.3s ease;
}

.calendar-standee-stage::after {
  content: '';
  position: absolute;
  bottom: 14px;
  width: 380px;
  height: 24px;
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.22) 0%, rgba(15, 23, 42, 0) 75%);
  filter: blur(6px);
  z-index: 1;
  transition: width 0.3s ease, opacity 0.3s ease;
}

.calendar-standee-stage:hover::after {
  width: 400px;
  opacity: 0.8;
}

/* A5 Desk Calendar Frame - Optimized 60FPS GPU Acceleration */
.calendar-a5-card {
  width: min(380px, 100%);
  min-height: 520px;
  background: #ffffff;
  border-radius: 8px 8px 14px 14px;
  box-shadow: 0 20px 45px -8px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  will-change: transform, box-shadow;
  transform: translateZ(0);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
  overflow: hidden;
}

.calendar-a5-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 32px 65px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* 3D Leaf Flip Animation */
@keyframes leafFlipDown {
  0% {
    transform: rotateX(-20deg) scale(0.97);
    opacity: 0.5;
    filter: brightness(0.9);
  }
  100% {
    transform: rotateX(0deg) scale(1);
    opacity: 1;
    filter: brightness(1);
  }
}

.calendar-leaf.flip-animation {
  animation: leafFlipDown 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  transform-origin: top center;
}

/* Wire-O Spiral Top Binding */
.wire-o-binding {
  height: 28px;
  background: #e2e8f0;
  border-bottom: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 20px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.wire-loop {
  width: 10px;
  height: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #64748b 100%);
  border-radius: 5px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25), inset 0 1px 1px #ffffff;
  border: 1px solid #94a3b8;
  position: relative;
  top: -4px;
}

.wire-o-binding.gold .wire-loop {
  background: linear-gradient(135deg, #fef08a 0%, #ca8a04 50%, #854d0e 100%);
  border-color: #a16207;
}

.wire-o-binding.white .wire-loop {
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 70%, #cbd5e1 100%);
  border-color: #cbd5e1;
}

/* Leaf Content Area (13 Leaves) */
.calendar-leaf {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  position: relative;
}

/* Themed SVG Background Overlay */
.artwork-bg-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.95;
}

/* Leaf Header Artwork Section */
.leaf-artwork {
  height: 210px;
  padding: 18px 20px;
  color: #ffffff;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-size: cover;
  background-position: center;
  transition: background 0.4s ease;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.leaf-artwork::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.5) 100%);
  z-index: 2;
}

.leaf-artwork > *:not(.artwork-bg-svg) {
  position: relative;
  z-index: 3;
}

.leaf-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.leaf-year-badge {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.leaf-theme-pill {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.leaf-month-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.leaf-quote {
  font-size: 0.72rem;
  opacity: 0.95;
  font-style: italic;
  max-width: 90%;
  line-height: 1.3;
  margin-top: 4px;
}

/* Cover Leaf Specifics */
.cover-leaf-view {
  height: 380px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  align-items: center;
  background-size: cover;
  position: relative;
  color: #ffffff;
}

.cover-leaf-view::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.65) 100%);
  z-index: 1;
}

.cover-leaf-view > * {
  position: relative;
  z-index: 2;
}

.cover-year-hero {
  font-family: var(--font-heading);
  font-size: 3.8rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.cover-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: -0.01em;
}

.cover-tagline {
  font-size: 0.8rem;
  opacity: 0.9;
  max-width: 80%;
  margin: 6px auto 0;
}

/* Month Grid Section */
.leaf-grid-section {
  padding: 14px 18px 10px;
  background: #ffffff;
  flex: 1;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px;
}

.cal-weekdays span.sun {
  color: #dc2626;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  font-size: 0.76rem;
}

.cal-day {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-weight: 500;
  color: var(--text-main);
  transition: var(--transition);
}

.cal-day.empty {
  visibility: hidden;
}

.cal-day.sun {
  color: #dc2626;
  font-weight: 700;
}

.cal-day.holiday {
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
}

.cal-day.medical-event {
  background: var(--primary-subtle);
  color: var(--primary-dark);
  font-weight: 700;
}

/* Galley Imprint (Doctor Personalization Bottom Bar) */
.calendar-galley {
  background: #ffffff;
  border-top: 2px dashed #cbd5e1;
  padding: 10px 14px;
  position: relative;
  min-height: 105px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.galley-tag {
  position: absolute;
  top: -9px;
  right: 12px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.galley-logo-avatar {
  width: 44px;
  height: 44px;
  background: var(--primary-subtle);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  font-size: 20px;
  flex-shrink: 0;
}

.galley-details {
  flex: 1;
  font-size: 0.7rem;
  line-height: 1.25;
}

.galley-doctor-name {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
}

.galley-degrees {
  font-size: 0.68rem;
  color: var(--primary-dark);
  font-weight: 600;
}

.galley-specialty {
  font-size: 0.68rem;
  color: #334155;
  font-weight: 600;
}

.galley-clinic {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.galley-address {
  font-size: 0.64rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.galley-contact {
  font-size: 0.64rem;
  color: #0284c7;
  font-weight: 700;
  margin-top: 2px;
}

/* 13-Leaf Controller & Thumbnails */
.leaf-navigation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
  margin-top: 16px;
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.leaf-indicator {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.leaf-thumbnails-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 4px 6px;
  width: 100%;
  max-width: 780px;
  scrollbar-width: thin;
}

.leaf-thumb-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 54px;
}

.leaf-thumb-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-subtle);
}

.leaf-thumb-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Theme Card in 77-Designs Catalog */
.theme-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}

.theme-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.theme-card.selected {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.2);
}

.theme-card-preview {
  height: 160px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  color: #fff;
  background-size: cover;
  background-position: center;
}

.theme-card-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.6) 100%);
}

.theme-card-preview > * {
  position: relative;
  z-index: 2;
}

.theme-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.theme-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.theme-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Spec Badges Bar */
.spec-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.spec-tag {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg-card-muted);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: #475569;
}

/* ==========================================================================
   Responsive: keep the 3D A5 desk-standee mockup fluid on smaller screens
   ========================================================================== */
@media (max-width: 640px) {
  .calendar-standee-stage {
    padding: 28px 10px 34px;
  }
  .calendar-standee-stage::after {
    width: 80%;
  }
  .leaf-navigation-bar {
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-lg);
  }
  .leaf-indicator {
    font-size: 0.82rem;
  }
}

@media (max-width: 400px) {
  .calendar-standee-stage {
    padding: 20px 6px 26px;
  }
  .cover-leaf-view {
    height: 320px;
    padding: 24px 18px;
  }
  .cover-year-hero {
    font-size: 3rem;
  }
  .leaf-artwork {
    height: 176px;
  }
  .leaf-month-title {
    font-size: 1.55rem;
  }
}
