/* ===================================
   Christmas Present Wrapper
   =================================== */

.present-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    pointer-events: all;
    overflow: hidden;
}

.present-wrapper.hidden {
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.wrapping-paper {
    position: relative;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            45deg,
            #c41e3a 0px,
            #c41e3a 50px,
            #dc143c 50px,
            #dc143c 100px
        );
    background-size: 100px 100px;
    cursor: pointer;
    overflow: hidden;
    pointer-events: auto;
}

/* Ribbon stripes */
.ribbon {
    position: absolute;
    background: linear-gradient(90deg, 
        #1a1a1a 0%, 
        #1a1a1a 45%, 
        #ffd700 45%, 
        #ffd700 55%, 
        #1a1a1a 55%, 
        #1a1a1a 100%);
    z-index: 2;
}

.ribbon-horizontal {
    top: 50%;
    left: 0;
    width: 100%;
    height: 60px;
    transform: translateY(-50%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.ribbon-vertical {
    left: 50%;
    top: 0;
    width: 60px;
    height: 100%;
    transform: translateX(-50%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

/* Bow in center */
.bow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    z-index: 3;
    background: 
        radial-gradient(circle at 30% 30%, #ffd700 0%, #ffed4e 30%, #ffd700 60%, #c9a900 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.5),
        inset -20px -20px 0 rgba(0, 0, 0, 0.2),
        inset 20px 20px 0 rgba(255, 255, 255, 0.3);
    animation: bowPulse 2s ease-in-out infinite;
}

.bow::before,
.bow::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 80px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #c9a900 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.bow::before {
    left: -30px;
    top: 10px;
    transform: rotate(-25deg);
}

.bow::after {
    right: -30px;
    top: 10px;
    transform: rotate(25deg);
}

@keyframes bowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Unwrap hint */
.unwrap-hint {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #ffd700;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.5);
    z-index: 4;
    animation: hintBounce 2s ease-in-out infinite;
}

.unwrap-hint p {
    margin: 0;
}

.tap-icon {
    display: block;
    font-size: 2.5rem;
    margin-top: 10px;
    animation: tapAnimation 1.5s ease-in-out infinite;
}

/* Close button */
.present-close {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: auto !important;
    touch-action: manipulation;
}

.present-close:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
}

.present-close:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 1);
}

@keyframes hintBounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

@keyframes tapAnimation {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Tear effect */
.tear {
    position: absolute;
    width: 200px;
    height: 200px;
    pointer-events: none;
    z-index: 5;
}

.tear-paper {
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            45deg,
            #c41e3a 0px,
            #c41e3a 50px,
            #dc143c 50px,
            #dc143c 100px
        );
    background-size: 100px 100px;
    clip-path: polygon(
        30% 0%, 
        70% 0%, 
        100% 30%, 
        100% 70%, 
        70% 100%, 
        30% 100%, 
        0% 70%, 
        0% 30%
    );
    animation: tearAway 0.8s ease-out forwards;
    transform-origin: center;
}

@keyframes tearAway {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.3) rotate(180deg) translate(100px, -100px);
    }
}

/* Tear mark on paper */
.tear-mark {
    position: absolute;
    width: 100px;
    height: 100px;
    background: rgba(26, 26, 26, 0.3);
    clip-path: polygon(
        40% 20%, 
        60% 20%, 
        80% 40%, 
        80% 60%, 
        60% 80%, 
        40% 80%, 
        20% 60%, 
        20% 40%
    );
    pointer-events: none;
    z-index: 1;
}

/* Reveal animation */
.present-wrapper.revealing .wrapping-paper {
    animation: paperReveal 1s ease-out forwards;
}

@keyframes paperReveal {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.2);
        filter: blur(10px);
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .bow {
        width: 80px;
        height: 80px;
    }
    
    .bow::before,
    .bow::after {
        width: 35px;
        height: 60px;
    }
    
    .bow::before {
        left: -20px;
    }
    
    .bow::after {
        right: -20px;
    }
    
    .unwrap-hint {
        font-size: 1.2rem;
        bottom: 60px;
    }
    
    .tap-icon {
        font-size: 2rem;
    }
    
    .ribbon-horizontal {
        height: 40px;
    }
    
    .ribbon-vertical {
        width: 40px;
    }
    
    .present-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
        bottom: 15px;
        left: 15px;
    }
}

