/*
Theme Name: Alivio Premium
Theme URI: https://alivio.pl
Description: Luksusowy motyw potomny dla agencji Alivio z kinową paralaksą GSAP.
Author: Piotr Polak
Version: 1.0.0
Template: kadence
*/

/* Tutaj w przyszłości trafią nasze poprawki CSS */

/* Kinowa maska wyłaniania z mroku (Dół ekranu) */
body::after {
    content: '';
    position: fixed;
    /* Przykleja maskę na sztywno do ekranu */
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 25vh;
    /* Maska zajmuje 25% wysokości dolnego ekranu */

    /* Gradient: 0-10% to czysta czerń, potem płynnie przechodzi w przezroczystość */
    background: linear-gradient(to top, #000000 0%, #000000 20%, #000000ed 40%, transparent 100%);

    z-index: 999999;
    /* Wymusza warstwę na samym wierzchu */

    /* PARAMETR KRYTYCZNY */
    pointer-events: none;
}

/*GLASS BELKA MENU */
.site-header-upper-wrap {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* --- SILNIK ANIMACJI ALIVIO (FADE UP) --- */

/* Stan początkowy: ukryte i przesunięte w dół */
.alivio-fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: opacity, transform;
    /* Optymalizacja renderowania GPU */
}

/* Stan końcowy: wybudzenie (dodawane przez nasz skrypt) */
.alivio-fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Klasy pomocnicze do opóźnień (Kaskada) */
.alivio-delay-150 {
    transition-delay: 250ms;
}

.alivio-delay-300 {
    transition-delay: 500ms;
}

/* Scroll Up Button */

#kt-scroll-up-reader.scroll-up-side-right,
#kt-scroll-up.scroll-up-side-right {
    z-index: 99999999;
}

/* ==========================================================================
   ALIVIO: KULKODPORNY SILNIK INTERFEJSU CZATU (YELLOW PREMIUM)
   ========================================================================== */

/* 1. PRZYKLEJENIE OKNA CZATU (Tego brakowało - przywrócenie pozycji fixed) */
html body #dify-chatbot-bubble-window {
    position: fixed !important;
    top: auto !important;
    bottom: 95px !important;
    /* Idealna wysokość nad przyciskiem */
    right: 20px !important;
    width: 24rem !important;
    height: 37rem !important;
    max-height: 80vh !important;
    z-index: 999999999 !important;
    border: 1px solid rgb(229, 255, 0) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7) !important;
}

/* Responsywność okna na mobile */
@media (max-width: 768px) {
    html body #dify-chatbot-bubble-window {
        bottom: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: 80vh !important;
        max-height: 80vh !important;
        border-radius: 0 !important;
    }
}

/* 2. WYGLĄD IKONKI (Wstrzyknięcie żółtej gwiazdy AI i kasowanie pomarańczowego) */
html body #dify-chatbot-bubble-button {
    background-color: #040404 !important;
    border: 1px solid rgb(229, 255, 0) !important;
    transition: transform 0.3s ease, background-image 0.4s ease !important;
    z-index: 2147483647 !important;

    /* Ikona AI w kolorze żółtym (#FFD700) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFD700' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.8 4.2l1.6 4.7a1.5 1.5 0 001.1 1.1l4.7 1.6-4.7 1.6a1.5 1.5 0 00-1.1 1.1l-1.6 4.7-1.6-4.7a1.5 1.5 0 00-1.1-1.1L2.4 11.6l4.7-1.6a1.5 1.5 0 001.1-1.1z'/%3E%3Cpath d='M20.5 3.5l.8 2.2a1 1 0 00.7.7l2.2.8-2.2.8a1 1 0 00-.7.7l-.8 2.2-.8-2.2a1 1 0 00-.7-.7l-2.2-.8 2.2-.8a1 1 0 00.7-.7z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 26px 26px !important;

    animation: alivio-ai-pulse 2s infinite !important;
}

/* Ukrycie oryginalnego białego logo Dify wewnątrz przycisku */
html body #dify-chatbot-bubble-button svg {
    display: none !important;
    opacity: 0 !important;
}

/* Transformacja ikonki w znak X po otwarciu czatu */
html body #dify-chatbot-bubble-button.alivio-chat-open {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFD700' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3C/svg%3E") !important;
    background-size: 22px 22px !important;
    animation: none !important;
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

html body #dify-chatbot-bubble-button:not(.alivio-chat-open):hover {
    transform: scale(1.08) !important;
    box-shadow: 0 0 20px rgb(229, 255, 0) !important;
    animation: none !important;
}

@keyframes alivio-ai-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* 3. NOWY DESIGNERSKI DYMEK ZACHĘTY (Glassmorphism + Yellow) */
.zachęta-czat-ogorek {
    position: fixed;
    bottom: 95px;
    right: 20px;
    background: rgba(10, 10, 10, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff !important;
    border: 1px solid rgb(255, 255, 255) !important;
    padding: 10px 18px;
    border-radius: 6px !important;
    /* Techniczne, eleganckie ścięcie */
    font-family: 'Jost';
    font-size: 13px !important;
    font-weight: 400;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
    z-index: 2147483646 !important;
    cursor: pointer;
    animation: podskakiwanie-premium 3s infinite;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Dzióbek dymka */
.zachęta-czat-ogorek::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.9) transparent transparent transparent;
}

.zachęta-czat-ogorek:hover {
    background: rgba(20, 20, 20, 0.95) !important;
    transform: translateY(-2px);
}

@keyframes podskakiwanie-premium {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-4px);
    }

    60% {
        transform: translateY(-2px);
    }
}

/* 4. PERFEKCYJNIE ZSYNCHRONIZOWANA NAKŁADKA MASKUJĄCA BRANDING */
#alivio-overlay {
    display: none;
    position: fixed;
    bottom: 95px;
    /* Dokładnie zgrane z dolną krawędzią okna czatu */
    right: 20px;
    width: 24rem;
    height: 42px;
    background-color: #040404;
    color: rgb(255, 255, 0, 0.5);
    font-family: 'Jost';
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.5px;
    align-items: center;
    justify-content: center;
    z-index: 999999999999;
    pointer-events: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border: 1px solid #e1ff00;
    border-top: 5px solid #040404;
}

/* Korekta mobilna dla nakładki */
@media (max-width: 768px) {
    #alivio-overlay {
        bottom: 0 !important;
        right: 0 !important;
        width: 92vw !important;
        border-radius: 0 !important;
    }
}