/* Momentli by CentriHQ - Custom Styles */

/* ── Cursive / Script font utility ── */
.invitation-script {
    font-family: 'Dancing Script', cursive;
}

/* ══════════════════════════════════════════
   ENVELOPE ANIMATION
══════════════════════════════════════════ */

.env-scene {
    perspective: 1400px;
}

/* Envelope outer container */
.envelope {
    position: relative;
    width: 100%;
    max-width: 380px;
    /* 3:2 envelope ratio via padding trick */
    padding-bottom: min(62%, 236px);
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
    margin: 0 auto;
}
.envelope:hover { transform: scale(1.015); }
.envelope.is-open { pointer-events: none; }

/* ── Envelope body (the rectangle) ── */
.env-body {
    position: absolute;
    inset: 0;
    background: #fdf3ea;
    border-radius: 4px;
    box-shadow:
        0 8px 32px rgba(140,77,74,0.18),
        0 2px 8px rgba(140,77,74,0.10);
    overflow: hidden;
}

/* Left inner triangle */
.env-inner-left {
    position: absolute;
    inset: 0;
    background: #f2dfd0;
    clip-path: polygon(0 0, 0 100%, 53% 50%);
}
/* Right inner triangle */
.env-inner-right {
    position: absolute;
    inset: 0;
    background: #edd9c8;
    clip-path: polygon(100% 0, 100% 100%, 47% 50%);
}
/* Bottom inner triangle */
.env-inner-bottom {
    position: absolute;
    inset: 0;
    background: #e8d0bc;
    clip-path: polygon(0 100%, 100% 100%, 50% 46%);
    z-index: 2;
}

/* Letter peek (visible before opening) */
.env-letter-peek {
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: 10%;
    top: 30%;
    background: white;
    border-radius: 3px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    transition: transform 0.9s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.4s ease;
    transition-delay: 0.55s;
}
.envelope.is-open .env-letter-peek {
    transform: translateY(-180%);
    opacity: 0.9;
}

/* ── Top flap wrapper — this rotates ── */
.env-flap-wrapper {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 54%;
    transform-origin: top center;
    transform-style: preserve-3d;
    transition: transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}
.envelope.is-open .env-flap-wrapper {
    transform: rotateX(-180deg);
}

/* Front face of flap (triangle pointing DOWN — the "V" shape) */
.env-flap-front {
    position: absolute;
    inset: 0;
    background: #e0c8b5;
    clip-path: polygon(0 0, 100% 0, 50% 92%);
    backface-visibility: hidden;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    /* Subtle gradient for depth */
    background: linear-gradient(160deg, #dfc9b5 0%, #cdb5a0 100%);
}
/* Shadow line at bottom of flap to look folded */
.env-flap-front::after {
    content: '';
    position: absolute;
    bottom: 18%;
    left: 15%;
    right: 15%;
    height: 1px;
    background: rgba(140,77,74,0.08);
}

/* Back face of flap (shown when rotated open) */
.env-flap-back {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, #f5ede6 0%, #ecdfd5 100%);
    clip-path: polygon(0 0, 100% 0, 50% 92%);
    backface-visibility: hidden;
    transform: rotateX(180deg);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

/* ── Wax seal ── */
.env-seal {
    position: absolute;
    /* sits right at the point where the flap meets the body */
    top: 46%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    line-height: 1;
    filter: drop-shadow(0 3px 8px rgba(140,77,74,0.4));
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
    pointer-events: none;
}
.envelope.is-open .env-seal {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
}

/* ── Tap prompt ── */
.env-tap-prompt {
    animation: promptPulse 2.2s ease-in-out infinite;
}
@keyframes promptPulse {
    0%, 100% { opacity: 0.65; }
    50%       { opacity: 1; }
}

/* ── Invitation card reveal ── */
.env-card-reveal {
    animation: cardReveal 0.6s ease forwards;
}
@keyframes cardReveal {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

/* ── Court of Honor tabs ── */
.court-tab {
    background: white;
    border-color: #e5e7eb;
    color: #6b7280;
}
.court-tab:hover {
    border-color: #C98B82;
    color: #8C4D4A;
}
.court-tab.active-tab {
    background: #8C4D4A;
    border-color: #8C4D4A;
    color: white;
    box-shadow: 0 4px 12px rgba(140,77,74,0.25);
}

/* ── Court list item ── */
.court-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #f3e8e8;
    background: #fdf8f7;
    transition: all 0.2s ease;
}
.court-item:hover {
    border-color: #E4A89B;
    background: #fff5f3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(140,77,74,0.08);
}
.court-item .court-num {
    font-family: 'Dancing Script', cursive;
    font-size: 1.4rem;
    color: #C98B82;
    font-weight: 700;
    min-width: 2rem;
    text-align: center;
    line-height: 1;
}
.court-item .court-name {
    font-family: 'Dancing Script', cursive;
    font-size: 1.25rem;
    color: #2d2d2d;
    font-weight: 600;
}
.court-item .court-note {
    font-size: 0.7rem;
    color: #9ca3af;
    font-style: italic;
    margin-top: 1px;
}

/* ── Tab panel fade ── */
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
.tab-fade {
    animation: tabFadeIn 0.3s ease forwards;
}

/* Small CSS overrides for design details */
.time-label { 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
}

.dot-red { background-color: #FF5F57; }
.dot-yellow { background-color: #FFBD2E; }
.dot-green { background-color: #28C840; }

/* Ensure sections have padding to account for fixed header */
section { 
    scroll-margin-top: 2rem; 
} 

@media (min-width: 640px) { 
    section { scroll-margin-top: 4rem; } 
}

/* data-bind targets will be hidden briefly until JS applies the data to prevent layout flash */
[data-bind] { 
    visibility: hidden; 
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
}

[data-bind].data-bound { 
    visibility: visible; 
    opacity: 1;
}

/* Smooth reveal animation for list items */
#eventDetails_eventOrder_list p {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Premium Card Effects */
.profile-frame {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: float 6s ease-in-out infinite;
}

.profile-frame:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 40px 60px -15px rgba(140, 77, 74, 0.15);
}

/* Float animation for the main portrait */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Shimmer effect for sections */
section {
    position: relative;
    overflow: hidden;
}

section::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 45%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.05) 55%,
        transparent 100%
    );
    transform: translateX(-100%) rotate(45deg);
    transition: all 0.6s ease;
    pointer-events: none;
}

section:hover::after {
    transform: translateX(100%) rotate(45deg);
}

/* Countdown Number - Animated Transition */
.countdown-timer span {
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.num-ticking {
    animation: tickUp 0.3s ease-out forwards;
}

@keyframes tickUp {
    0% { opacity: 0.5; transform: translateY(2px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Background Animated Gradient */
.main-content-bg-wrapper {
    background: linear-gradient(-45deg, #F6E8DA, #FEFEFE, #fdf5ec, #F6E8DA);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
/* Button Transformations */
button, .btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

button:hover {
    transform: translateY(-2px) scale(1.05);
    filter: brightness(1.1);
}

button:active {
    transform: translateY(0) scale(0.95);
}

/* Global Smooth Scroll */
html {
    scroll-behavior: smooth;
}
/* ── Enhanced Click / Trail Sparkle Burst ── */
@keyframes sparkle-burst {
    0%   { transform: scale(0) translate(0, 0);                                           opacity: 1; }
    30%  { transform: scale(1.5) translate(calc(var(--dx) * 0.3), calc(var(--dy) * 0.3)); opacity: 1; }
    100% { transform: scale(0.2) translate(var(--dx), var(--dy));                         opacity: 0; }
}

/* ── Continuous Ambient Falling Particles ── */
@keyframes ambient-fall {
    0%   { transform: translate(0, -20px)                                  rotate(0deg);   opacity: 0;    }
    8%   { opacity: 0.55; }
    25%  { transform: translate(calc(var(--drift) * 0.5),  25vh)           rotate(90deg);  }
    50%  { transform: translate(var(--drift),              50vh)            rotate(180deg); }
    75%  { transform: translate(calc(var(--drift) * 0.3),  75vh)           rotate(270deg); }
    88%  { opacity: 0.45; }
    100% { transform: translate(calc(var(--drift) * 0.1),  110vh)          rotate(360deg); opacity: 0; }
}
