/* Premium Gift Intro Styles - Ultra Modern 3D Design */
.gift-intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(120% 120% at 20% 20%, rgba(255, 126, 179, 0.18), transparent 40%),
        radial-gradient(120% 120% at 80% 30%, rgba(92, 225, 230, 0.14), transparent 45%),
        radial-gradient(ellipse at center, #2a143e 0%, #140824 50%, #0a0416 100%);
    backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s;
    overflow: hidden;
}

/* Animated Background Particles */
.gift-intro-overlay::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 192, 203, 0.4), transparent),
        radial-gradient(2px 2px at 50px 160px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 90px 40px, rgba(255, 192, 203, 0.3), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(3px 3px at 160px 120px, rgba(255, 215, 0, 0.4), transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: sparkle 4s ease-in-out infinite;
    pointer-events: none;
}

.gift-intro-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.06) 0%, transparent 40%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
    mix-blend-mode: screen;
    pointer-events: none;
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 0.5;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

.gift-intro-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.gift-box-container {
    position: relative;
    width: 280px;
    height: 280px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 20px 50px rgba(233, 30, 99, 0.4));
}

.gift-box-container:hover {
    transform: scale(1.08);
}

/* Glow effect behind box */
.gift-box-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(233, 30, 99, 0.5) 0%, rgba(255, 64, 129, 0.2) 40%, transparent 70%);
    animation: glow-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glow-pulse {

    0%,
    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

.gift-box {
    width: 100%;
    height: 100%;
    position: relative;
    animation: box-float 4s ease-in-out infinite;
}

/* Gift box image */
.gift-box-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 5;
}

@keyframes box-float {

    0%,
    100% {
        transform: translateY(0);
    }

    25% {
        transform: translateY(-15px);
    }

    50% {
        transform: translateY(-25px);
    }

    75% {
        transform: translateY(-15px);
    }
}

/* Hide legacy 3D box faces when image is used */
.gift-box:has(.gift-box-image) .face {
    display: none;
}

/* Premium Metallic Ribbon - Hidden when using image */
.gift-box:has(.gift-box-image) .ribbon-v,
.gift-box:has(.gift-box-image) .ribbon-h {
    display: none;
}

/* Show 3D box when no image is present */
.gift-box:not(:has(.gift-box-image)) .face {
    display: block;
    position: absolute;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff9a9e 50%, #ffb4c8 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        inset 0 0 20px rgba(255, 255, 255, 0.1),
        0 0 30px rgba(255, 107, 157, 0.3);
}

.gift-box:not(:has(.gift-box-image)) .face.front {
    width: 200px;
    height: 200px;
    transform: translateZ(100px);
}

.gift-box:not(:has(.gift-box-image)) .face.back {
    width: 200px;
    height: 200px;
    transform: translateZ(-100px) rotateY(180deg);
}

.gift-box:not(:has(.gift-box-image)) .face.right {
    width: 200px;
    height: 200px;
    left: 100px;
    transform: rotateY(90deg) translateZ(100px);
}

.gift-box:not(:has(.gift-box-image)) .face.left {
    width: 200px;
    height: 200px;
    left: -100px;
    transform: rotateY(-90deg) translateZ(100px);
}

.gift-box:not(:has(.gift-box-image)) .face.top {
    width: 200px;
    height: 200px;
    top: -100px;
    transform: rotateX(90deg) translateZ(100px);
}

.gift-box:not(:has(.gift-box-image)) .face.bottom {
    width: 200px;
    height: 200px;
    top: 100px;
    transform: rotateX(-90deg) translateZ(100px);
    background: linear-gradient(135deg, #ff9a9e 0%, #ffb4c8 100%);
}

/* Ribbon styles when no image */
.gift-box:not(:has(.gift-box-image)) .ribbon-v {
    position: absolute;
    width: 40px;
    height: 100%;
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    z-index: 10;
}

.gift-box:not(:has(.gift-box-image)) .ribbon-h {
    position: absolute;
    width: 100%;
    height: 40px;
    background: linear-gradient(180deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    z-index: 10;
}

/* Premium Gift Text */
.gift-text {
    margin-top: 60px;
    color: #fefefe;
    font-family: 'Poppins', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-shadow:
        0 0 20px rgba(233, 30, 99, 0.8),
        0 0 40px rgba(233, 30, 99, 0.4),
        0 4px 10px rgba(0, 0, 0, 0.3);
    animation: text-glow 2s ease-in-out infinite;
    text-align: center;
    padding: 0 20px;
}

@keyframes text-glow {

    0%,
    100% {
        text-shadow:
            0 0 20px rgba(233, 30, 99, 0.8),
            0 0 40px rgba(233, 30, 99, 0.4),
            0 4px 10px rgba(0, 0, 0, 0.3);
    }

    50% {
        text-shadow:
            0 0 30px rgba(255, 64, 129, 1),
            0 0 60px rgba(255, 64, 129, 0.6),
            0 0 80px rgba(255, 64, 129, 0.3),
            0 4px 10px rgba(0, 0, 0, 0.3);
    }
}

/* Premium Open Button */
.open-btn {
    margin-top: 35px;
    padding: 18px 55px;
    background: linear-gradient(120deg, #ffe29f 0%, #ffa99f 50%, #ff719a 100%);
    border: none;
    border-radius: 60px;
    color: #1a0a1e;
    font-weight: 800;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow:
        0 12px 30px rgba(255, 113, 154, 0.35),
        0 6px 20px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
}

.open-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 70%);
    transform: translateX(-100%);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.open-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow:
        0 18px 40px rgba(255, 113, 154, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.open-btn:active {
    transform: translateY(-2px) scale(1.02);
}

/* Opening Animation Classes */
.gift-intro-overlay.opening .gift-box-container {
    animation: box-open 0.8s ease-out forwards;
}

@keyframes box-open {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Confetti burst effect - desktop only */
.gift-intro-overlay.opening::after {
    content: '🎉✨💕🎊💖🌟💝';
    position: absolute;
    font-size: 3rem;
    animation: confetti-burst 0.8s forwards;
    letter-spacing: 20px;
}

@keyframes confetti-burst {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        opacity: 1;
        transform: scale(1.5);
    }

    100% {
        opacity: 0;
        transform: scale(2) translateY(-50px);
    }
}

/* Nazik giriş animasyonu */
.gift-intro-overlay:not(.opening) .gift-box-container,
.gift-intro-overlay:not(.opening) .gift-text,
.gift-intro-overlay:not(.opening) .open-btn {
    animation: fade-slide-up 0.9s ease both;
}

@keyframes fade-slide-up {
    0% {
        opacity: 0;
        transform: translateY(18px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {

    .gift-intro-overlay,
    .gift-intro-overlay * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

.particles-burst {
    position: absolute;
    pointer-events: none;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .gift-intro-overlay {
        backdrop-filter: none;
        background: radial-gradient(100% 100% at 50% 40%, rgba(255, 126, 179, 0.12), transparent 60%),
            #0b0612;
    }

    .gift-intro-overlay::before,
    .gift-intro-overlay::after {
        animation: none;
        opacity: 0.5;
    }

    .gift-box-container {
        width: 170px;
        height: 170px;
        perspective: 800px;
        transform: translateZ(0);
        animation: none;
        filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.35));
    }

    .gift-box {
        animation: none;
    }

    .gift-text {
        font-size: 1.15rem;
        margin-top: 28px;
        letter-spacing: 2px;
    }

    .open-btn {
        padding: 12px 34px;
        font-size: 1rem;
        box-shadow: 0 8px 18px rgba(255, 113, 154, 0.28), 0 4px 12px rgba(0, 0, 0, 0.25);
    }
}

@media (max-width: 768px) {
    .gift-box-container::before {
        display: none;
        /* Disable glow on mobile for performance */
    }

    .gift-intro-overlay:not(.opening) .gift-box-container,
    .gift-intro-overlay:not(.opening) .open-btn {
        animation-duration: 0.4s;
    }

    /* Disable all heavy animations on mobile */
    .gift-box {
        animation: none !important;
    }

    /* Hide emoji confetti on mobile */
    .gift-intro-overlay::before,
    .gift-intro-overlay::after {
        display: none !important;
    }

    /* Simplified mobile opening animation - GPU accelerated */
    .gift-intro-overlay.opening .gift-box-container {
        animation: box-open-mobile 0.4s ease-out forwards;
        will-change: transform, opacity;
    }

    @keyframes box-open-mobile {
        0% {
            transform: scale(1);
            opacity: 1;
        }

        100% {
            transform: scale(0);
            opacity: 0;
        }
    }

    .gift-intro-overlay.opening .gift-text,
    .gift-intro-overlay.opening .open-btn {
        animation: fade-out-mobile 0.25s ease-out forwards;
    }

    @keyframes fade-out-mobile {
        to {
            opacity: 0;
        }
    }
}