/* --- SYNAPSE CHAT WIDGET V5 (Super Dios - Glass Edition) --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-color: #764ba2;
    --text-dark: #1f2937;
    --blur-val: 12px;
}

#synapse-widget-container {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 9999999;
    font-family: 'Outfit', sans-serif;
    pointer-events: none;
    /* Let clicks pass through container area */
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    padding: 20px;
}

#synapse-widget-container * {
    pointer-events: auto;
    /* Re-enable clicks on children */
    box-sizing: border-box;
}

/* --- LAUNCHER (Floating Orb) --- */
#synapse-launcher {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-gradient);
    box-shadow: 0 10px 25px rgba(118, 75, 162, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#synapse-launcher:hover {
    transform: scale(1.1) rotate(10deg);
}

#synapse-launcher svg {
    width: 32px;
    height: 32px;
    stroke: white;
}

/* --- MAIN WINDOW (Glass Panel) --- */
#synapse-widget {
    width: 420px;
    height: 700px;
    max-height: 85vh;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-val));
    -webkit-backdrop-filter: blur(var(--blur-val));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 90px;
    right: 20px;
    opacity: 0;
    transform: translateY(40px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#synapse-widget.open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* HEADER */
.synapse-header {
    background: rgba(255, 255, 255, 0.5);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.synapse-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.synapse-close {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.synapse-close:hover {
    opacity: 1;
}

/* MESSAGES */
.synapse-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
    padding-bottom: 30px;
}

.synapse-msg {
    max-width: 82%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    animation: popIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.synapse-msg.bot {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
    margin-right: auto;
}

.synapse-msg.user {
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: auto;
    font-weight: 500;
    text-align: right;
}

/* --- THE DOCK (Quick Actions) --- */
#synapse-dock {
    padding: 10px 15px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* Hide scrollbar on dock */
#synapse-dock::-webkit-scrollbar {
    display: none;
}

.dock-btn {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-color);
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dock-btn:hover {
    transform: translateY(-2px);
    background: white;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* INPUT AREA */
.synapse-input-area {
    padding: 15px;
    background: rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 10;
}

#synapse-input {
    flex: 1;
    border: none;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 12px 20px;
    font-size: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    outline: none;
}

#synapse-send {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    color: white;
    box-shadow: 0 4px 10px rgba(118, 75, 162, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#synapse-send svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* --- OVERLAYS (Forms/Date) --- */
.synapse-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: none;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    animation: fadeOverlay 0.3s;
}

.synapse-overlay h3 {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-dark);
}

.so-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

/* FORM STYLES inside Overlay */
.so-input-group {
    margin-bottom: 15px;
}

.so-input {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    background: #fdfdfd;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    margin-bottom: 10px;
    outline: none;
}

.so-input:focus {
    border-color: var(--accent-color);
}

.so-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 15px;
    box-shadow: 0 6px 15px rgba(118, 75, 162, 0.3);
    transition: transform 0.2s;
}

.so-btn:hover {
    transform: translateY(-2px);
}

/* Flatpickr Customization for Overlay */
.flatpickr-calendar {
    box-shadow: none !important;
    background: transparent !important;
    margin: 0 auto !important;
}

/* Typing Indicator */
.synapse-typing {
    display: none;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    width: fit-content;
    margin-bottom: 10px;
}

.synapse-dot {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.synapse-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.synapse-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* MSG LINKS (Payment button styled) */
.sc-btn-pay,
.synapse-msg.bot a[href*="pagar"] {
    display: inline-block;
    background: #10b981;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 50px;
    margin-top: 10px;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

/* MOBILE RESPONSIVE */
@media (max-width: 480px) {
    #synapse-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        max-height: 100%;
        border-radius: 0;
    }
}

@keyframes fadeOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}