/* ==========================================================================
   Inauguration Curtain Stylesheet
   ========================================================================== */

:root {
  --curtain-red-dark: #3a0303;
  --curtain-red-mid: #780e0e;
  --curtain-red-light: #b52222;
  --gold-primary: #d4af37;
  --gold-secondary: #f3e5ab;
  --gold-dark: #aa7c11;
  --gold-highlight: #fff7d6;
}

#inauguration-curtain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  overflow: hidden;
  display: flex;
  background-color: #000;
  transition: opacity 0.5s ease-out 1.8s, visibility 0.5s ease-out 1.8s;
  pointer-events: auto;
  user-select: none;
}

#inauguration-curtain-overlay.curtain-open {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Curtain Panels */
.curtain-panel {
  position: absolute;
  top: 0;
  width: 50.5vw; /* Slight overlap in middle to avoid gaps */
  height: 100vh;
  z-index: 10;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  transform: translateX(0) scaleX(1);
  transition: transform 2s cubic-bezier(0.25, 1, 0.5, 1);
}

.curtain-left {
  left: 0;
  transform-origin: left center;
  /* Beautiful 3D drape fold shadows */
  background: repeating-linear-gradient(
    to right,
    var(--curtain-red-dark),
    var(--curtain-red-dark) 2%,
    var(--curtain-red-mid) 5%,
    var(--curtain-red-light) 9%,
    var(--curtain-red-mid) 13%,
    var(--curtain-red-dark) 15%
  );
  border-right: 4px solid var(--gold-primary);
}

.curtain-right {
  right: 0;
  transform-origin: right center;
  background: repeating-linear-gradient(
    to right,
    var(--curtain-red-dark),
    var(--curtain-red-dark) 2%,
    var(--curtain-red-mid) 5%,
    var(--curtain-red-light) 9%,
    var(--curtain-red-mid) 13%,
    var(--curtain-red-dark) 15%
  );
  border-left: 4px solid var(--gold-primary);
}

/* Bottom Gold Filigree Border */
.curtain-panel::before {
  content: "";
  position: absolute;
  bottom: 45px;
  left: 0;
  width: 100%;
  height: 25px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='25' viewBox='0 0 40 25'%3E%3Cpath d='M0,15 Q10,2 20,15 T40,15 L40,25 L0,25 Z' fill='none' stroke='%23d4af37' stroke-width='2'/%3E%3Ccircle cx='20' cy='15' r='3' fill='%23ffd700'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 40px 25px;
  opacity: 0.9;
  z-index: 11;
}

/* Bottom Ornate Gold Tassel Fringe */
.curtain-panel::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 48px;
  z-index: 12;
  background-image: 
    /* Repeating SVG Hanging Tassels */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='48' viewBox='0 0 30 48'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='0%25'%3E%3Cstop offset='0%25' stop-color='%23aa7c11'/%3E%3Cstop offset='50%25' stop-color='%23ffd700'/%3E%3Cstop offset='100%25' stop-color='%23aa7c11'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M15,0 L15,14 M11,14 L19,14 M9,18 L21,18 C21,30 20,48 15,48 C10,48 9,30 9,18 Z' fill='url(%23g)'/%3E%3Ccircle cx='15' cy='14' r='4' fill='%23fff7d6'/%3E%3Ccircle cx='15' cy='18' r='6' fill='%23d4af37'/%3E%3C/svg%3E"),
    /* Gold horizontal supporting bar */
    linear-gradient(to bottom, var(--gold-highlight), var(--gold-primary), var(--gold-dark));
  background-repeat: repeat-x, no-repeat;
  background-size: 30px 48px, 100% 8px;
  background-position: bottom left, top left;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.6));
}

/* Top Valance (Drapery) */
.curtain-valance {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 140px;
  z-index: 20;
  background: repeating-linear-gradient(
    to right,
    var(--curtain-red-dark),
    var(--curtain-red-dark) 4%,
    var(--curtain-red-mid) 8%,
    var(--curtain-red-light) 12%,
    var(--curtain-red-mid) 16%,
    var(--curtain-red-dark) 20%
  );
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  border-bottom: 6px double var(--gold-primary);
  border-radius: 0 0 15px 15px;
  transform: translateY(0);
  transition: transform 1.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Animated Open States */
#inauguration-curtain-overlay.curtain-open .curtain-left {
  transform: translateX(-100%) scaleX(0.85);
}

#inauguration-curtain-overlay.curtain-open .curtain-right {
  transform: translateX(100%) scaleX(0.85);
}

#inauguration-curtain-overlay.curtain-open .curtain-valance {
  transform: translateY(-100%);
}

/* Ribbon and Bow System */
.ribbon-container {
  position: absolute;
  top: 55%;
  left: 0;
  width: 100%;
  height: 40px;
  z-index: 30;
  display: flex;
  align-items: center;
  pointer-events: none; /* Let clicks pass to overlay or center node */
}

.ribbon-half {
  height: 35px;
  width: 50%;
  background: linear-gradient(
    to bottom,
    var(--gold-dark) 0%,
    var(--gold-primary) 30%,
    var(--gold-highlight) 50%,
    var(--gold-primary) 70%,
    var(--gold-dark) 100%
  );
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  border-top: 1px solid var(--gold-highlight);
  border-bottom: 1px solid var(--gold-dark);
  transition: transform 1.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 1s ease-out;
}

.ribbon-left-half {
  transform-origin: left center;
}

.ribbon-right-half {
  transform-origin: right center;
}

#inauguration-curtain-overlay.curtain-open .ribbon-left-half {
  transform: translateX(-100%) rotate(-10deg);
  opacity: 0;
}

#inauguration-curtain-overlay.curtain-open .ribbon-right-half {
  transform: translateX(100%) rotate(10deg);
  opacity: 0;
}

/* Golden Ribbon Center/Bow */
.ribbon-center-node {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  z-index: 40;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd700 0%, #d4af37 60%, #aa7c11 100%);
  border: 8px double var(--gold-highlight);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease-out;
}

.ribbon-center-node:hover {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 15px 50px rgba(212, 175, 55, 0.4), inset 0 0 30px rgba(255, 255, 255, 0.7);
}

#inauguration-curtain-overlay.curtain-open .ribbon-center-node {
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}

/* Typography on Ribbon Node */
.ribbon-title {
  font-family: 'Sora', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #5a0202;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
  margin-top: 5px;
}

.ribbon-subtitle {
  font-family: 'Teko', sans-serif;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 600;
  color: #3a0303;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 2px 0 5px 0;
}

/* Professional Ribbon Emblem (Fleur-de-lis) */
.ribbon-emblem {
  font-size: 52px;
  color: #fff7d6;
  margin: 5px 0;
  display: inline-block;
  transform-origin: center center;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  animation: emblemPulse 2s infinite ease-in-out;
}

.ribbon-center-node:hover .ribbon-emblem {
  animation: emblemGlow 1.5s infinite alternate;
}

.click-instruction {
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
  background-color: #780e0e;
  padding: 4px 14px;
  border-radius: 20px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  margin-bottom: 5px;
  animation: glowPulse 1.5s infinite alternate;
}

/* Animations */
@keyframes glowPulse {
  0% {
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    background-color: #780e0e;
  }
  100% {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.9);
    background-color: #b52222;
  }
}

@keyframes emblemPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.3)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8)); }
}

@keyframes emblemGlow {
  0% { transform: scale(1.08) rotate(-3deg); }
  100% { transform: scale(1.15) rotate(3deg); }
}

/* Confetti particles */
.confetti-particle {
  position: absolute;
  top: 55%;
  left: 50%;
  width: 10px;
  height: 10px;
  z-index: 50;
  pointer-events: none;
  opacity: 1;
}

@keyframes confettiFall {
  0% {
    transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  80% {
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r)) scale(0.5);
    opacity: 0;
  }
}

/* Helper to stop scrolling behind curtain */
body.curtain-locked {
  overflow: hidden !important;
  height: 100vh !important;
}
