/* ============================================================
   WOW Effects — xerografiaW2P
   Glassmorphism · Animacje · Hover · Laser · Confetti
   ============================================================ */

/* ----------------------------------------------------------
   Glassmorphism
   ---------------------------------------------------------- */
.glass {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.glass-dark {
    background: rgba(20, 55, 88, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ----------------------------------------------------------
   Głębokie, miękkie cienie (zastępują twarde bordy)
   ---------------------------------------------------------- */
.soft-shadow {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.04);
}

.soft-shadow-lg {
    box-shadow: 0 8px 40px rgba(0, 118, 255, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ----------------------------------------------------------
   Karty produktów — efekt unoszenia na hover
   ---------------------------------------------------------- */
.product-card {
    transition: transform 0.22s cubic-bezier(.34,1.56,.64,1), box-shadow 0.22s ease;
    will-change: transform, box-shadow;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 44px rgba(0, 118, 255, 0.13), 0 4px 12px rgba(0, 0, 0, 0.07);
}

/* ----------------------------------------------------------
   Kafelki parametrów (tiles / tiles_with_image)
   ---------------------------------------------------------- */
.param-tile {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    user-select: none;
}

.param-tile:hover {
    border-color: #0076ff;
    box-shadow: 0 4px 14px rgba(0, 118, 255, 0.14);
    transform: scale(1.03);
}

.param-tile.selected {
    border-color: #0076ff;
    background: #EBF6FD;
    box-shadow: 0 0 0 3px rgba(0, 118, 255, 0.18);
}

/* ----------------------------------------------------------
   Animacja ceny (flip licznika)
   ---------------------------------------------------------- */
@keyframes priceFlip {
    0%   { transform: translateY(0);    opacity: 1; }
    35%  { transform: translateY(-10px); opacity: 0; }
    65%  { transform: translateY(10px);  opacity: 0; }
    100% { transform: translateY(0);    opacity: 1; }
}

.price-flip {
    animation: priceFlip 0.32s cubic-bezier(.4,0,.2,1) both;
    display: inline-block;
}

/* ----------------------------------------------------------
   Sticky sidebar kalkulatora
   ---------------------------------------------------------- */
.calc-sticky-sidebar {
    position: sticky;
    top: 1.5rem;
}

/* ----------------------------------------------------------
   Laser scan — dropzone preflightu
   ---------------------------------------------------------- */
.preflight-dropzone {
    position: relative;
    overflow: hidden;
    border: 2px dashed #0096DB;
    border-radius: 16px;
    transition: border-color 0.2s, background 0.2s;
}

.preflight-dropzone.drag-over {
    border-color: #E7247F;
    background: rgba(231, 36, 127, 0.04);
}

@keyframes laserScan {
    0%   { top: -4px; opacity: 0; }
    5%   { opacity: 1; }
    95%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.laser-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 150, 219, 0.4) 15%,
        #0096DB 45%,
        #E7247F 55%,
        rgba(231, 36, 127, 0.4) 85%,
        transparent 100%
    );
    box-shadow: 0 0 14px 5px rgba(0, 150, 219, 0.55);
    animation: laserScan 1.9s cubic-bezier(.4,0,.6,1) forwards;
    z-index: 20;
    pointer-events: none;
}

/* Linie spadu (rysowane po skanie) */
@keyframes drawBleedLine {
    from { opacity: 0; transform: scaleX(0); }
    to   { opacity: 1; transform: scaleX(1); }
}
@keyframes drawBleedLineV {
    from { opacity: 0; transform: scaleY(0); }
    to   { opacity: 1; transform: scaleY(1); }
}

.bleed-line-h {
    animation: drawBleedLine 0.5s ease forwards;
    transform-origin: left;
}
.bleed-line-v {
    animation: drawBleedLineV 0.5s ease forwards;
    transform-origin: top;
}

/* Przyciemnienie obszaru poza spadem */
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.bleed-overlay {
    animation: fadeInOverlay 0.6s ease forwards;
}

/* ----------------------------------------------------------
   Chat widget — Glassmorphism + Bubbles (iMessage style)
   ---------------------------------------------------------- */
.chat-panel {
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
}

.chat-header-glass {
    background: rgba(20, 55, 88, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.msg-bubble-user {
    border-radius: 18px 18px 4px 18px;
    word-break: break-word;
}

.msg-bubble-bot {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    word-break: break-word;
}

/* Pulsujący glow awatara (loading) */
@keyframes avatarPulse {
    0%, 100% {
        box-shadow: 0 0 0 0   rgba(0, 118, 255, 0.5),
                    0 0 0 0   rgba(0, 118, 255, 0.25);
    }
    50% {
        box-shadow: 0 0 0 6px  rgba(0, 118, 255, 0.2),
                    0 0 0 12px rgba(0, 118, 255, 0);
    }
}

.avatar-thinking {
    animation: avatarPulse 1.4s ease-in-out infinite;
    border-radius: 50%;
}

/* Typing dots */
@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%            { transform: translateY(-4px); opacity: 1; }
}
.typing-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    display: inline-block;
    animation: typingDot 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.30s; }

/* ----------------------------------------------------------
   Animowany checkmark + confetti (preflight zatwierdzone)
   ---------------------------------------------------------- */
@keyframes checkDraw {
    from { stroke-dashoffset: 60; opacity: 0; }
    to   { stroke-dashoffset: 0;  opacity: 1; }
}

.check-svg path {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: checkDraw 0.45s ease forwards 0.1s;
}

@keyframes confettiFall {
    0%   { transform: translateY(-6px) rotate(0deg) scale(1);   opacity: 1; }
    100% { transform: translateY(28px) rotate(720deg) scale(0.5); opacity: 0; }
}

.confetti-piece {
    position: absolute;
    width: 7px; height: 7px;
    border-radius: 2px;
    pointer-events: none;
    animation: confettiFall 0.65s ease-out forwards;
}

/* ----------------------------------------------------------
   Pływający avatar — button (otwieracz chatu)
   ---------------------------------------------------------- */
@keyframes floatPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(0, 118, 255, 0.35); }
    50%       { box-shadow: 0 4px 30px rgba(0, 118, 255, 0.60); }
}

.chat-avatar-btn {
    animation: floatPulse 3s ease-in-out infinite;
    transition: transform 0.2s cubic-bezier(.34,1.56,.64,1);
}

.chat-avatar-btn:hover {
    transform: scale(1.10) !important;
}
