/**
 * Gift Box System — Floating Gift Box & Confetti Styles
 * Ultra-premium, gamified, glassmorphism design.
 *
 * @package Gift_Box_System
 */

/* ═══════════════════════════════════════
   FLOATING GIFT WIDGET BUTTON
   ═══════════════════════════════════════ */

.gift-widget {
    position: fixed;
    bottom: 20px;
    z-index: 99995;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    perspective: 1000px;
}

.gift-widget--bottom-left {
    left: 20px;
}

.gift-widget--bottom-right {
    right: 20px;
}

.gift-btn,
.gift-box-btn {
    position: relative;
    width: 58px;
    height: 58px;
    min-width: 58px;
    min-height: 58px;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    background: linear-gradient(135deg, #f59e0b 0%, #eab308 50%, #f97316 100%);
    border: 2px solid rgba(255, 255, 255, 0.7);
    cursor: pointer;
    box-shadow: 
        0 12px 30px rgba(245, 158, 11, 0.55), 
        0 0 24px rgba(234, 179, 8, 0.45),
        inset 0 2px 4px rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
    padding: 0;
    animation: giftFloat3D 3s infinite ease-in-out;
    transform-style: preserve-3d;
    box-sizing: border-box;
    flex-shrink: 0;
}

.gift-btn:hover,
.gift-box-btn:hover {
    transform: translateY(-6px) scale(1.12);
    box-shadow: 
        0 18px 40px rgba(245, 158, 11, 0.7), 
        0 0 32px rgba(255, 215, 0, 0.7),
        inset 0 3px 6px rgba(255, 255, 255, 0.9);
}

/* Tooltip Tag attached to Button — positioned above */
.gift-tooltip-tag {
    position: absolute;
    bottom: 68px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    padding: 7px 14px;
    border-radius: 20px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), 0 0 14px rgba(255, 215, 0, 0.4);
    border: 1.5px solid rgba(255, 215, 0, 0.7);
    white-space: nowrap;
    pointer-events: none;
    animation: giftTooltipFloat 2.5s infinite ease-in-out;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
    letter-spacing: 0.3px;
}

.gift-widget--bottom-left .gift-tooltip-tag {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

.gift-tooltip-icon {
    font-size: 14px;
    animation: giftIconWiggle 1.5s infinite ease-in-out;
}

/* Dual Icon: Main Gift Box + Padlock Badge */
.gift-padlock-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gift-box-main-icon {
    font-size: 32px;
    line-height: 1;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gift-btn:hover .gift-box-main-icon,
.gift-box-btn:hover .gift-box-main-icon {
    transform: scale(1.22) rotate(-8deg);
}

.gift-padlock-badge {
    position: absolute;
    bottom: -2px;
    right: -4px;
    font-size: 13px;
    background: #0f172a;
    color: #ffffff;
    border: 1.5px solid #ffffff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gift-widget.is-unlocked .gift-padlock-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #fde047;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.9);
    animation: giftBadgePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Sparkles around Box */
.gift-sparkle-star {
    position: absolute;
    pointer-events: none;
    font-size: 14px;
    color: #fde047;
    text-shadow: 0 0 6px rgba(253, 224, 71, 0.8);
    animation: giftSparkleFloat 2.4s infinite ease-in-out;
}

.gift-sparkle-star.s1 {
    top: -10px;
    right: -8px;
    animation-delay: 0s;
}

.gift-sparkle-star.s2 {
    bottom: -4px;
    left: -10px;
    font-size: 12px;
    animation-delay: 1.2s;
}

/* Pulse Rings */
.gift-btn__pulse {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 22px;
    border: 2px solid #f59e0b;
    animation: giftPulseRing 2.2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
    pointer-events: none;
}

.gift-btn__pulse--outer {
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border-radius: 26px;
    border-color: rgba(234, 179, 8, 0.55);
    animation-delay: 0.7s;
}

/* Floating Widget Top-Left/Right Close/Disable Button */
.gift-widget-close-btn {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0f172a;
    color: #ffffff;
    border: 2px solid #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    z-index: 20;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
    padding: 0;
}

.gift-widget-close-btn:hover {
    background: #ef4444;
    color: #ffffff;
    transform: scale(1.2) rotate(90deg);
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.5);
}

/* Badge Styling */
.gift-btn__badge {
    position: absolute;
    top: -10px;
    right: -12px;
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #0f172a;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    border: 2px solid #ffffff;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* Unlocked State Styling */
.gift-widget.is-unlocked .gift-btn,
.gift-widget.is-unlocked .gift-box-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    box-shadow: 
        0 18px 45px rgba(245, 158, 11, 0.75), 
        0 0 38px rgba(255, 215, 0, 0.85),
        inset 0 2px 5px rgba(255, 255, 255, 0.8);
    animation: giftUnlockedGlow 1.8s infinite alternate;
}

.gift-widget.is-unlocked .gift-3d-lid {
    transform: translateY(-8px) rotate(-12px);
}

.gift-widget.is-unlocked .gift-btn__badge {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    color: #ffffff;
    border-color: #fde047;
    animation: giftBadgePulse 1s infinite alternate;
}

/* Keyframe Animations */
@keyframes giftFloat3D {
    0%, 82%, 100% { transform: translateY(0) rotate(0deg); }
    85% { transform: translateY(-10px) rotate(-10deg) scale(1.08); }
    88% { transform: translateY(-10px) rotate(10deg) scale(1.08); }
    91% { transform: translateY(-6px) rotate(-6deg) scale(1.04); }
    94% { transform: translateY(-6px) rotate(6deg) scale(1.04); }
    97% { transform: translateY(-2px) rotate(0deg); }
}

@keyframes giftTooltipFloat {
    0%, 100% { transform: translateX(0) scale(1); }
    50% { transform: translateX(-5px) scale(1.05); }
}

@keyframes giftIconWiggle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.25) rotate(-12deg); }
}

@keyframes giftSparkleFloat {
    0%, 100% { opacity: 0.3; transform: scale(0.8) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.3) rotate(45deg); }
}

@keyframes giftPulseRing {
    0% { transform: scale(0.92); opacity: 0.9; }
    100% { transform: scale(1.38); opacity: 0; }
}

@keyframes giftUnlockedGlow {
    0% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.55), 0 0 10px rgba(255, 215, 0, 0.5); }
    100% { box-shadow: 0 0 50px rgba(245, 158, 11, 0.95), 0 0 30px rgba(255, 215, 0, 0.85); }
}

@keyframes giftBadgePulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.12); }
}

@keyframes giftBadgePop {
    0% { transform: scale(0.6); }
    60% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ═══════════════════════════════════════
   GIFT MODAL OVERLAY & DIALOG
   ═══════════════════════════════════════ */

.gift-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    animation: giftFadeIn 0.3s ease-out;
}

.gift-modal-dialog {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.38);
    position: relative;
    overflow: hidden;
    padding: 32px 28px;
    box-sizing: border-box;
    animation: giftZoomIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gift-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: #64748b;
    border: none;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    line-height: 1;
}

.gift-modal-close:hover {
    background: #ef4444;
    color: #ffffff;
    transform: rotate(90deg);
}

/* ═══════════════════════════════════════
   STATE 1: LOCKED PROGRESS CARD
   ═══════════════════════════════════════ */

.gift-modal__header {
    text-align: center;
    margin-bottom: 24px;
}

.gift-badge-pill {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gift-modal__header h2 {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.gift-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Progress Card */
.gift-progress-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 20px;
}

.gift-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.gift-progress-title {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.gift-progress-percent {
    font-size: 15px;
    font-weight: 800;
    color: #6c5ce7;
}

.gift-progress-bar-wrap {
    height: 12px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 12px;
}

.gift-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6c5ce7 0%, #ff4757 100%);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
}

.gift-progress-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.gift-current-text {
    color: #64748b;
    font-weight: 600;
}

.gift-needed-badge {
    background: #fee2e2;
    color: #dc2626;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
}

/* Teaser Card */
.gift-teaser-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.gift-teaser-img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.gift-teaser-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.gift-teaser-info p {
    margin: 0;
    font-size: 12px;
    color: #64748b;
}

/* ═══════════════════════════════════════
   STATE 2: UNLOCKED REWARD CARD
   ═══════════════════════════════════════ */

.gift-unlocked-banner {
    background: linear-gradient(135deg, #009cf9 0%, #0077c5 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 13px;
    text-align: center;
    padding: 9px 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 14px rgba(0, 156, 249, 0.35);
}

.gift-unlocked-card {
    text-align: center;
    margin-bottom: 24px;
}

.gift-unlocked-img-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 16px auto;
}

.gift-unlocked-img {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    border: 3px solid #009cf9;
}

.gift-sparkle {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 28px;
    animation: giftSpinSparkle 3s infinite linear;
}

.gift-unlocked-card h3 {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.gift-unlocked-desc {
    font-size: 13px;
    color: #475569;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.gift-value-badge {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
}

/* WhatsApp Popup Message */
.gift-whatsapp-popup {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1.5px solid #86efac;
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.15);
}

.gift-whatsapp-popup__icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
}

.gift-whatsapp-popup__text {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #166534;
    line-height: 1.55;
}

/* Actions Buttons */
.gift-actions {
    text-align: center;
}

.gift-btn-primary {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #6c5ce7 0%, #5a4bd1 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 15px;
    padding: 14px 20px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(108, 92, 231, 0.35);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.gift-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(108, 92, 231, 0.5);
}

.gift-btn-success {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 800;
    font-size: 15px;
    padding: 15px 20px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.gift-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.65);
}

@keyframes giftFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes giftZoomIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes giftSpinSparkle {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}
