/**
 * AuroTrip Secret Gift – Premium 3D animated card
 * Glassmorphism, gold glow, particles, confetti
 */

/* ---------- Backdrop ---------- */
.secret-gift-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 27, 75, 0.94) 50%, rgba(45, 30, 60, 0.92) 100%);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.secret-gift-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.secret-gift-backdrop.is-closing .secret-gift-card-inner {
    transform: scale(0.92);
    opacity: 0;
}

/* ---------- Particle layer (behind card) ---------- */
.secret-gift-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.secret-gift-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.35);
    animation: secretGiftParticleFloat 8s ease-in-out infinite;
}

.secret-gift-particle:nth-child(odd) {
    background: rgba(201, 162, 39, 0.25);
    animation-duration: 10s;
    animation-delay: -2s;
}

.secret-gift-particle:nth-child(3n) {
    background: rgba(255, 255, 255, 0.12);
    animation-duration: 12s;
    animation-delay: -4s;
}

@keyframes secretGiftParticleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.4;
    }
    25% {
        transform: translate(10px, -30px) scale(1.1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-15px, -50px) scale(0.9);
        opacity: 0.5;
    }
    75% {
        transform: translate(20px, -20px) scale(1.05);
        opacity: 0.6;
    }
}

/* ---------- Card wrapper (perspective for 3D) ---------- */
.secret-gift-card-wrapper {
    position: relative;
    perspective: 1200px;
    max-width: 440px;
    width: 100%;
}

/* ---------- Card – glassmorphism + 3D ---------- */
.secret-gift-card {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    will-change: transform;
}

.secret-gift-card-inner {
    position: relative;
    width: 100%;
    padding: 2.25rem 2rem 2.5rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    overflow: hidden;
    transform: scale(0.88);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.secret-gift-backdrop.is-open .secret-gift-card-inner {
    transform: scale(1);
    opacity: 1;
    animation: secretGiftCardAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: transform 0.15s ease-out, opacity 0.4s ease;
}

@keyframes secretGiftCardAppear {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Gold animated border glow */
.secret-gift-card-inner::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.6) 0%, rgba(212, 175, 55, 0.8) 25%, rgba(232, 197, 71, 0.9) 50%, rgba(212, 175, 55, 0.8) 75%, rgba(201, 162, 39, 0.6) 100%);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: secretGiftGoldGlow 3s ease-in-out infinite;
}

@keyframes secretGiftGoldGlow {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 1;
    }
    50% {
        background-position: 100% 50%;
        opacity: 0.85;
    }
}

/* ---------- Close button ---------- */
.secret-gift-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.2s ease;
    z-index: 2;
}

.secret-gift-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.secret-gift-close:active {
    transform: scale(0.98);
}

/* ---------- Content ---------- */
.secret-gift-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.secret-gift-names {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

.secret-gift-discount {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    font-weight: 800;
    text-align: center;
    color: #e8c547;
    text-shadow: 0 0 30px rgba(232, 197, 71, 0.5);
    margin-bottom: 1rem;
    letter-spacing: 0.03em;
}

.secret-gift-code-wrap {
    text-align: center;
    margin-bottom: 1.5rem;
}

.secret-gift-code {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.98);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 10px;
}

.secret-gift-cta {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* ---------- Confetti container ---------- */
.secret-gift-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.secret-gift-confetti span {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: secretGiftConfettiBurst 2s ease-out forwards;
}

@keyframes secretGiftConfettiBurst {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--confetti-dx, 0), var(--confetti-dy, -100px)) scale(0) rotate(720deg);
        opacity: 0;
    }
}

/* ---------- Limit reached modal ---------- */
.secret-gift-limit-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 27, 75, 0.94) 100%);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.secret-gift-limit-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.secret-gift-limit-card {
    max-width: 380px;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    text-align: center;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.secret-gift-limit-backdrop.is-open .secret-gift-limit-card {
    transform: scale(1);
    opacity: 1;
}

.secret-gift-limit-message {
    font-size: 1.15rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
}

.secret-gift-limit-close {
    margin-top: 1.5rem;
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.3);
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.secret-gift-limit-close:hover {
    background: rgba(212, 175, 55, 0.45);
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
    .secret-gift-card-inner {
        padding: 1.75rem 1.25rem 2rem;
    }

    .secret-gift-title {
        font-size: 1.05rem;
    }

    .secret-gift-names {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .secret-gift-discount {
        font-size: 1.5rem;
    }

    .secret-gift-code {
        font-size: 1.1rem;
        letter-spacing: 0.1em;
        padding: 0.5rem 1rem;
    }

    .secret-gift-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
}
