@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  /* Colors from church visual assets */
  --bg-blue-top: #0077c8;
  --bg-blue-mid: #005a9c;
  --bg-blue-dark: #003666;
  --bg-blue-accent: #0284c7;

  /* Card and paper colors */
  --paper-white: #ffffff;
  --text-dark: #09090b;
  --text-muted: #64748b;

  /* Sticky Note Palettes */
  --sticky-yellow: #fef08a;
  --sticky-yellow-border: #facc15;
  --sticky-mint: #a7f3d0;
  --sticky-mint-border: #6ee7b7;
  --sticky-peach: #fed7aa;
  --sticky-peach-border: #fdba74;
  --sticky-blue: #bae6fd;
  --sticky-blue-border: #7dd3fc;
  --sticky-lavender: #e9d5ff;
  --sticky-lavender-border: #d8b4fe;

  /* Fonts */
  --font-bold: 'Archivo Black', -apple-system, sans-serif;
  --font-ui: 'Outfit', sans-serif;
  --font-note: 'Plus Jakarta Sans', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  background-color: var(--bg-blue-mid);
  color: var(--text-dark);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Background canvas texture matching reference images */
.board-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 2rem 1.5rem 2rem;
  background: 
    radial-gradient(circle at 50% 10%, rgba(56, 189, 248, 0.25) 0%, transparent 60%),
    radial-gradient(circle at 85% 80%, rgba(2, 132, 199, 0.3) 0%, transparent 50%),
    linear-gradient(175deg, var(--bg-blue-top) 0%, var(--bg-blue-mid) 45%, var(--bg-blue-dark) 100%);
}

/* Halftone print lines overlay */
.board-viewport::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.035) 0px,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* =========================================================
   COMPACT TOP HEADER BANNER (Only ~12% of screen height!)
   ========================================================= */
.top-header-banner {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper-white);
  padding: 0.75rem 1.8rem;
  border-radius: 14px;
  box-shadow: 
    0 0 0 5px rgba(255, 255, 255, 0.9),
    0 12px 30px rgba(0, 16, 40, 0.25);
  transform: rotate(-0.5deg);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  min-width: 0;
}

.church-badge-small {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.header-text-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.meeting-subtitle-small {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.active-question-compact {
  font-family: var(--font-bold);
  font-size: clamp(1.2rem, 2.2vw, 1.85rem);
  line-height: 1.15;
  color: #09090b;
  letter-spacing: -0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  margin-left: 1.5rem;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ecfdf5;
  color: #047857;
  padding: 0.25rem 0.65rem;
  border-radius: 30px;
  border: 1px solid #a7f3d0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

.notes-counter-pill {
  background: #f1f5f9;
  color: #1e293b;
  padding: 0.25rem 0.75rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* =========================================================
   MAIN STAGE (Bilețelele în Prim-Plan: 85%+ Height)
   ========================================================= */
.main-stage {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 1rem auto 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  min-height: 0;
  overflow: hidden;
}

/* =========================================================
   CAROUSEL MODE (The Default High-Impact Presentation)
   ========================================================= */
.carousel-view {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.carousel-deck {
  position: relative;
  width: 100%;
  height: 74%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}

/* The Active Center Giant Sticky Note */
.carousel-card {
  position: absolute;
  width: 90%;
  max-width: 950px;
  min-height: 380px;
  max-height: 90%;
  border-radius: 12px;
  padding: 3rem 3.5rem 2.5rem 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 
    0 25px 60px -10px rgba(0, 15, 45, 0.45),
    0 10px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  overflow: hidden;
}

/* Tape strip at top */
.carousel-card::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 32px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border-left: 2px dashed rgba(0, 0, 0, 0.12);
  border-right: 2px dashed rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

/* Folded Corner */
.carousel-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 35px 35px;
  border-color: transparent transparent rgba(0, 0, 0, 0.12) transparent;
  pointer-events: none;
}

/* Color Themes */
.carousel-card.color-yellow { background-color: var(--sticky-yellow); }
.carousel-card.color-mint { background-color: var(--sticky-mint); }
.carousel-card.color-peach { background-color: var(--sticky-peach); }
.carousel-card.color-blue { background-color: var(--sticky-blue); }
.carousel-card.color-lavender { background-color: var(--sticky-lavender); }

/* Giant Note Text for Church Projector Visibility */
.carousel-text {
  font-family: var(--font-note);
  font-size: clamp(2rem, 3.8vw, 3.4rem);
  font-weight: 700;
  line-height: 1.35;
  color: #09090b;
  letter-spacing: -0.5px;
  word-break: break-word;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer of the Giant Card */
.carousel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(0, 0, 0, 0.08);
}

.carousel-reaction-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.carousel-reaction-emoji {
  font-size: 3.2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.carousel-new-tag {
  background: #09090b;
  color: #facc15;
  font-family: var(--font-bold);
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
  border-radius: 30px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: pulse 1.5s infinite;
}

.carousel-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.carousel-slide-idx {
  font-family: var(--font-bold);
  font-size: 1.1rem;
  color: rgba(0, 0, 0, 0.65);
}

.carousel-time {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.45);
}

/* Smooth Progress Bar for Auto-play at the bottom of the card */
.carousel-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
}

.carousel-progress-fill {
  height: 100%;
  width: 0%;
  background: #09090b;
  transition: width 0.1s linear;
}

/* Lateral Peek / Ghost Cards */
.carousel-card.is-prev {
  transform: translateX(-88%) scale(0.78) rotate(-4deg);
  opacity: 0.28;
  pointer-events: auto;
  filter: blur(2px);
  z-index: 5;
}

.carousel-card.is-next {
  transform: translateX(88%) scale(0.78) rotate(4deg);
  opacity: 0.28;
  pointer-events: auto;
  filter: blur(2px);
  z-index: 5;
}

.carousel-card.is-active {
  transform: translateX(0) scale(1) rotate(-0.8deg);
  opacity: 1;
  z-index: 20;
  filter: none;
}

/* =========================================================
   TACTILE 3D PAPER ANIMATIONS (Sweep, Throw, and Stamp)
   ========================================================= */

/* Outgoing slide sweeps out to left with natural paper lift and tilt */
.anim-fly-out-left {
  transform: translateX(-125%) rotate(-16deg) scale(0.82) !important;
  opacity: 0 !important;
  filter: blur(4px) !important;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, filter 0.3s ease !important;
}

/* Outgoing slide sweeps out to right */
.anim-fly-out-right {
  transform: translateX(125%) rotate(16deg) scale(0.82) !important;
  opacity: 0 !important;
  filter: blur(4px) !important;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, filter 0.3s ease !important;
}

/* Incoming slide flies in from right with paper flutter and spring bounce */
@keyframes flyInFromRight {
  0% {
    opacity: 0;
    transform: translateX(100%) rotate(12deg) scale(0.82);
  }
  65% {
    opacity: 1;
    transform: translateX(-3%) rotate(-3deg) scale(1.03);
  }
  85% {
    transform: translateX(1%) rotate(-0.5deg) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotate(-0.8deg) scale(1);
  }
}

.anim-fly-in-right {
  animation: flyInFromRight 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

/* Incoming slide flies in from left */
@keyframes flyInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-100%) rotate(-12deg) scale(0.82);
  }
  65% {
    opacity: 1;
    transform: translateX(3%) rotate(3deg) scale(1.03);
  }
  85% {
    transform: translateX(-1%) rotate(-1deg) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotate(-0.8deg) scale(1);
  }
}

.anim-fly-in-left {
  animation: flyInFromLeft 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

/* New note live arrival: Stamp Drop from sky with Golden Aura */
@keyframes stampDropIn {
  0% {
    opacity: 0;
    transform: translateY(-160px) rotate(-10deg) scale(1.28);
  }
  50% {
    opacity: 1;
    transform: translateY(14px) rotate(1.5deg) scale(0.96);
  }
  75% {
    transform: translateY(-6px) rotate(-1.5deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(-0.8deg) scale(1);
    box-shadow: 
      0 0 55px 12px rgba(250, 204, 21, 0.7),
      0 25px 60px -10px rgba(0, 15, 45, 0.45);
  }
}

.anim-stamp-drop {
  animation: stampDropIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

.carousel-card.is-hidden {
  display: none;
}

/* Carousel Navigation Arrows */
.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  cursor: pointer;
  z-index: 40;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.carousel-nav-btn:hover {
  background: rgba(15, 23, 42, 0.9);
  transform: translateY(-50%) scale(1.1);
  border-color: #ffffff;
}

.carousel-nav-btn.prev {
  left: 2rem;
}

.carousel-nav-btn.next {
  right: 2rem;
}

/* Dots Indicator Bar at bottom of Carousel */
.carousel-dots-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1rem;
  z-index: 30;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.25s ease;
}

.carousel-dot.active {
  width: 32px;
  border-radius: 12px;
  background: #facc15;
  border-color: #facc15;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.6);
}

/* =========================================================
   MOSAIC / GRID VIEW (Alternative full-screen mode)
   ========================================================= */
.mosaic-view {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 1rem 1rem 4rem 1rem;
}

.mosaic-view.active {
  display: block;
}

.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 2rem 1.8rem;
  padding-bottom: 3rem;
}

.mosaic-note {
  position: relative;
  border-radius: 8px;
  padding: 1.8rem 1.8rem 1.4rem 1.8rem;
  box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.2s ease;
}

.mosaic-note:hover {
  transform: scale(1.04) rotate(0deg) !important;
  z-index: 50;
}

.mosaic-note::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 24px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-left: 2px dashed rgba(0, 0, 0, 0.1);
  border-right: 2px dashed rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.mosaic-text {
  font-family: var(--font-note);
  font-size: 1.55rem;
  line-height: 1.4;
  font-weight: 700;
  color: #18181b;
  margin-bottom: 1rem;
}

.mosaic-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 0.5rem;
}

/* =========================================================
   PHONE QR STICKER (Fixed in bottom right corner)
   ========================================================= */
.phone-qr-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 2rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.phone-qr-widget:hover {
  transform: scale(1.06) rotate(-1deg);
}

.phone-mockup-wrapper {
  position: relative;
  width: 155px;
  height: 245px;
  border-radius: 34px;
  background: #ffffff;
  padding: 6px;
  box-shadow: 
    0 0 0 5px #ffffff,
    0 15px 30px rgba(0, 16, 40, 0.4);
  transform: rotate(-3deg);
}

.phone-outer-frame {
  width: 100%;
  height: 100%;
  background: #18181b;
  border-radius: 28px;
  padding: 8px 6px 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.phone-notch {
  width: 40px;
  height: 10px;
  background: #000000;
  border-radius: 20px;
  margin-bottom: 6px;
}

.phone-screen {
  flex: 1;
  width: 100%;
  background: #ffffff;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.phone-qr-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.phone-screen-label {
  font-family: var(--font-bold);
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #0f172a;
  margin-top: 3px;
}

.phone-screen-sub {
  font-size: 0.58rem;
  color: #64748b;
  font-weight: 600;
}

.qr-callout-pill {
  position: relative;
  margin-bottom: 8px;
  background: #facc15;
  color: #000000;
  font-family: var(--font-bold);
  font-size: 0.78rem;
  padding: 0.3rem 0.85rem;
  border-radius: 30px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  animation: bouncePill 3s infinite ease-in-out;
  z-index: 10;
}

/* =========================================================
   BOTTOM FLOATING PRESENTER CONTROLS
   ========================================================= */
.presenter-bar {
  position: fixed;
  bottom: 1.5rem;
  left: 2rem;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  padding: 0.45rem 0.8rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  opacity: 0.6;
  transition: opacity 0.25s ease;
}

.presenter-bar:hover {
  opacity: 1;
}

.presenter-btn {
  background: transparent;
  color: #f8fafc;
  border: none;
  padding: 0.4rem 0.75rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.presenter-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.presenter-btn.active {
  background: #38bdf8;
  color: #0f172a;
}

/* =========================================================
   EMPTY STATE
   ========================================================= */
.carousel-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  padding: 3rem;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 600px;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 0.8rem;
  animation: gentleBounce 2.5s infinite;
}

.empty-title {
  font-family: var(--font-bold);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: #0f172a;
}

.empty-subtitle {
  font-size: 1.15rem;
  color: #475569;
  line-height: 1.5;
}

/* Animations */
@keyframes bouncePill {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

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

/* Responsiveness */
@media (max-width: 1024px) {
  .carousel-card {
    min-height: 320px;
    padding: 2.2rem 2.5rem;
  }
  .carousel-text {
    font-size: 2.2rem;
  }
  .phone-qr-widget {
    transform: scale(0.85);
    bottom: 1rem;
    right: 1rem;
  }
}
