/* public/assets/css/offer-assistant.css */

/* Floating Panda Container */
.panda-assistant-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none; /* Let clicks pass to the active areas */
}

/* Enable pointer events for active components */
.panda-assistant-avatar,
.panda-badge,
.panda-speech-bubble {
    pointer-events: auto;
}

/* Offers Badge */
.panda-badge {
    background: linear-gradient(135deg, #f4d47a 0%, #c5a55a 100%);
    color: #070504;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(197, 165, 90, 0.4);
    margin-bottom: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: badge-glow 2s infinite alternate, badge-bounce 10s infinite;
    transform-origin: bottom center;
}

@keyframes badge-glow {
    0% {
        box-shadow: 0 4px 12px rgba(197, 165, 90, 0.4);
    }
    100% {
        box-shadow: 0 4px 20px rgba(244, 212, 122, 0.8);
    }
}

@keyframes badge-bounce {
    0%, 90%, 100% {
        transform: translateY(0);
    }
    93% {
        transform: translateY(-8px);
    }
    95% {
        transform: translateY(2px);
    }
    97% {
        transform: translateY(-4px);
    }
    99% {
        transform: translateY(0);
    }
}

/* Speech Bubble */
.panda-speech-bubble {
    position: absolute;
    bottom: 120px;
    right: 0;
    background: rgba(23, 17, 13, 0.95);
    border: 1px solid rgba(223, 186, 107, 0.25);
    border-radius: 14px;
    padding: 10px 14px;
    color: #f5f0e9;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10000;
}

.panda-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 36px;
    width: 10px;
    height: 10px;
    background: rgba(23, 17, 13, 0.95);
    border-right: 1px solid rgba(223, 186, 107, 0.25);
    border-bottom: 1px solid rgba(223, 186, 107, 0.25);
    transform: rotate(45deg);
}

.panda-speech-bubble.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Notification Dot */
.panda-notification-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #ff6b57;
    border: 2px solid #0c0806;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 10px rgba(255, 107, 87, 0.8);
    display: none;
}

.panda-notification-dot.active {
    display: block;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 87, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(255, 107, 87, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 87, 0);
    }
}

/* Panda Avatar Wrapper */
.panda-assistant-avatar {
    position: relative;
    cursor: pointer;
    width: 80px;
    height: 80px;
    animation: panda-float 3s ease-in-out infinite;
    transform-origin: center bottom;
    transition: transform 0.2s ease-in-out;
}

.panda-assistant-avatar:hover {
    transform: scale(1.08);
}

/* Mascot Image rendering */
.panda-image-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.panda-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.4));
}

/* Animations */
@keyframes panda-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Blinking & Waving classes applied via JS */
.panda-blink {
    animation: panda-blink-anim 0.2s ease-in-out;
}

@keyframes panda-blink-anim {
    0%, 100% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0.1);
    }
}

.panda-wave {
    animation: panda-wave-anim 1s ease-in-out;
}

@keyframes panda-wave-anim {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(10deg) translateY(-2px);
    }
    50% {
        transform: rotate(-10deg) translateY(-2px);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* Golden Particles Container */
.panda-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.panda-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #dfba6b;
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 6px #f4d47a;
    animation: float-particle 4s infinite linear;
}

@keyframes float-particle {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(1);
        opacity: 0;
    }
}

/* Sparkles animation on panda logo */
.panda-sparkle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #fff 10%, rgba(223, 186, 107, 0.8) 50%, transparent 80%);
    clip-path: polygon(50% 0%, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0% 50%, 35% 35%);
    animation: sparkle-anim 1.5s ease-out forwards;
    pointer-events: none;
}

@keyframes sparkle-anim {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0;
    }
}

/* =========================================================
   Luxury Glassmorphic Offers Popup Modal
   ========================================================= */

.offers-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 5, 4, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.offers-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.offers-popup-container {
    width: 420px;
    max-width: 95%;
    background: rgba(15, 15, 15, 0.96);
    border: 1px solid rgba(223, 186, 107, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    display: flex;
    flex-direction: column;
}

.offers-popup-overlay.active .offers-popup-container {
    transform: translateY(0);
    opacity: 1;
}

/* Popup Header */
.offers-popup-header {
    padding: 24px;
    border-bottom: 1px solid rgba(223, 186, 107, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(223, 186, 107, 0.02);
}

.offers-popup-title {
    margin: 0;
}

.offers-popup-title h3 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    color: #f4d47a;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.offers-popup-title p {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    color: #baa98f;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.offers-popup-close-btn {
    background: none;
    border: none;
    color: #baa98f;
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.offers-popup-close-btn:hover {
    color: #f4d47a;
    background: rgba(223, 186, 107, 0.1);
    border-color: rgba(223, 186, 107, 0.2);
    transform: rotate(90deg);
}

/* Popup Content / Offers List */
.offers-popup-body {
    padding: 24px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Custom Scrollbar for offers list */
.offers-popup-body::-webkit-scrollbar {
    width: 6px;
}
.offers-popup-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
.offers-popup-body::-webkit-scrollbar-thumb {
    background: rgba(223, 186, 107, 0.2);
    border-radius: 10px;
}
.offers-popup-body::-webkit-scrollbar-thumb:hover {
    background: rgba(223, 186, 107, 0.4);
}

/* Offer Card Design */
.offer-item-card {
    background: rgba(23, 17, 13, 0.6);
    border: 1px solid rgba(223, 186, 107, 0.15);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.offer-item-card:hover {
    border-color: rgba(223, 186, 107, 0.4);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: rgba(23, 17, 13, 0.8);
}

/* Decorative Gold Sparkle Corner */
.offer-item-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, transparent 50%, rgba(223, 186, 107, 0.15) 50%);
    pointer-events: none;
}

.offer-card-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.offer-card-icon {
    width: 44px;
    height: 44px;
    background: rgba(223, 186, 107, 0.08);
    border: 1px solid rgba(223, 186, 107, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.offer-card-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.offer-card-icon span {
    font-size: 20px;
}

.offer-card-meta {
    flex-grow: 1;
}

.offer-card-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #f5f0e9;
    margin: 0 0 4px 0;
}

.offer-card-desc {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    color: #baa98f;
    margin: 0;
    line-height: 1.5;
}

/* Coupon & Discount Info */
.offer-card-deal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(223, 186, 107, 0.08);
    border-radius: 8px;
    padding: 8px 12px;
}

.offer-discount-badge {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 800;
    color: #f4d47a;
}

.offer-coupon-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    font-weight: 700;
    color: #f5f0e9;
    border: 1px dashed rgba(223, 186, 107, 0.4);
    background: rgba(223, 186, 107, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.offer-coupon-code::after {
    content: 'Click to copy';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 9px;
    padding: 3px 6px;
    border-radius: 3px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.offer-coupon-code:hover::after {
    opacity: 1;
}

.offer-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.offer-expiry {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    color: rgba(186, 169, 143, 0.7);
}

.offer-shop-btn {
    background: linear-gradient(135deg, #dfba6b 0%, #c5a55a 100%);
    color: #070504 !important;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.offer-shop-btn:hover {
    background: linear-gradient(135deg, #f4d47a 0%, #dfba6b 100%);
    box-shadow: 0 4px 12px rgba(197, 165, 90, 0.3);
    transform: translateY(-1px);
}

/* Empty State */
.offers-empty-state {
    text-align: center;
    padding: 40px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.offers-empty-emoji {
    font-size: 40px;
    margin-bottom: 6px;
}

.offers-empty-state h4 {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: #f4d47a;
    margin: 0;
}

.offers-empty-state p {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    color: #baa98f;
    margin: 0;
}

/* Responsive Scaling */
@media (max-width: 768px) {
    .panda-assistant-container {
        bottom: 20px;
        right: 20px;
    }
    .panda-assistant-avatar {
        width: 70px;
        height: 70px;
    }
    .panda-speech-bubble {
        bottom: 105px;
    }
}

@media (max-width: 480px) {
    .panda-assistant-avatar {
        width: 60px;
        height: 60px;
    }
    .panda-speech-bubble {
        bottom: 95px;
        font-size: 11px;
        padding: 8px 12px;
    }
    .offers-popup-container {
        border-radius: 16px;
    }
    .offers-popup-header {
        padding: 16px 20px;
    }
    .offers-popup-body {
        padding: 20px;
    }
}
