/* 
   GRACIE BARRA AI ASSISTANT - Version 2.0
   Design adapted from Paula 2.0 with GB Branding.
*/

:root {
    --gb-chat-red: #cc0000;
    --gb-chat-blue: #007bff;
    --gb-chat-white: #ffffff;
    --gb-chat-black: #050505;
    --gb-chat-glass: rgba(10, 10, 10, 0.85);
    --gb-chat-border: rgba(255, 255, 255, 0.1);
    --gb-chat-transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --gb-chat-z: 10000;
}

/* 1. Floating Action Buttons Container */
/* 1a. Primary Trial CTA Button (Prominent) */
.gb-trial-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    height: 50px;
    background: var(--gb-chat-red);
    border: none;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(204, 0, 0, 0.4);
    transition: var(--gb-chat-transition);
    z-index: var(--gb-chat-z);
    gap: 10px;
}

.gb-trial-fab:hover {
    transform: translateY(-4px) scale(1.03);
    background: #b00000;
}

.gb-trial-fab i {
    font-size: 1.1rem;
}

.gb-trial-fab span {
    font-weight: 700;
    font-size: 0.85rem;
    font-family: 'Roboto Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 1b. Secondary Chat Bot Button (Small, Icon-only) */
.gb-chat-fab {
    position: fixed;
    bottom: 30px;
    right: 240px;
    width: 45px;
    height: 45px;
    background: var(--gb-chat-red);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    transition: var(--gb-chat-transition);
    z-index: var(--gb-chat-z);
}

.gb-chat-fab:hover {
    transform: translateY(-3px);
    background: var(--gb-chat-red);
    border-color: var(--gb-chat-red);
}

.gb-chat-fab i {
    font-size: 1.1rem;
}

/* 2. Chat Portal Overlay */
.gb-chat-portal {
    position: fixed;
    inset: 0;
    background: var(--gb-chat-glass);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: calc(var(--gb-chat-z) + 1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.gb-chat-portal.active {
    opacity: 1;
    pointer-events: all;
}

/* 2.1 Chat Layout (Flex) */
.gb-chat-portal-content {
    display: flex;
    width: 100%;
    max-width: 1100px;
    height: 80vh;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 800px;
}

/* 2.2 Sidebar (History) */
.gb-chat-sidebar {
    width: 260px;
    background: #f5f5f5;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 10;
}

.gb-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.gb-new-chat-btn {
    width: 100%;
    padding: 12px;
    background: var(--gb-chat-red);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Titillium Web', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--gb-chat-transition);
}

.gb-new-chat-btn:hover {
    background: #e60000;
}

.gb-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gb-history-item {
    padding: 12px;
    border-radius: 8px;
    color: #555;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--gb-chat-transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.gb-history-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.gb-history-item.active {
    background: rgba(204, 0, 0, 0.1);
    color: var(--gb-chat-red);
    border: 1px solid rgba(204, 0, 0, 0.2);
}

.gb-history-item i {
    font-size: 0.8rem;
    opacity: 0.7;
}

.gb-sidebar-footer {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}

.gb-clear-history-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.gb-clear-history-btn:hover {
    color: #e81123;
}

/* 2.3 Main Chat Area */
.gb-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #ffffff;
    min-width: 0;
    overflow: hidden;
}

.gb-toggle-sidebar {
    display: none;
    /* Mobile only */
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    margin-right: 15px;
}

/* 3. Chat Header */
.gb-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 25px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    background: #ffffff;
}

.gb-chat-identity {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gb-chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gb-chat-red);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Ensure image stays inside circle */
    border: none;
}

.gb-chat-avatar i {
    font-size: 1.2rem;
    color: white;
}

.gb-chat-info-text h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1a1a1a;
    font-family: 'Titillium Web', sans-serif;
}

.gb-chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #888;
}

.gb-chat-status-dot {
    width: 7px;
    height: 7px;
    background: #28c840;
    border-radius: 50%;
}

.gb-chat-close {
    background: transparent;
    border: 1px solid #ddd;
    color: #999;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--gb-chat-transition);
}

.gb-chat-close:hover {
    background: var(--gb-chat-red);
    border-color: var(--gb-chat-red);
    color: white;
}

/* 4. Chat Messages Area */
.gb-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--gb-chat-red) transparent;
}

.gb-chat-msg {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.gb-chat-msg.bot {
    align-self: flex-start;
    background: #f5f5f5;
    color: #333;
    border-bottom-left-radius: 4px;
    border: 1px solid #e0e0e0;
}

.gb-chat-msg.user {
    align-self: flex-end;
    background: var(--gb-chat-red);
    color: white;
    border-bottom-right-radius: 4px;
}

/* 4.1 Buttons inside messages */
.gb-chat-msg-btns {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.gb-chat-msg-btn {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--gb-chat-transition);
    text-decoration: none;
}

.gb-chat-msg-btn.wa {
    background: #25D366;
    color: white;
}

.gb-chat-msg-btn.mail {
    background: var(--gb-chat-blue);
    color: white;
}

.gb-chat-msg-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* 5. Pinned Quick Actions (WhatsApp / Email) */
.gb-chat-actions-bar {
    display: flex;
    gap: 10px;
    padding: 0 20px 15px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

@keyframes gb-bar-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    }
}

.gb-chat-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-family: 'Roboto Condensed', sans-serif;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    transition: var(--gb-chat-transition);
}

.gb-chat-action-btn.whatsapp {
    background: #25D366;
    color: white;
}

.gb-chat-action-btn.email {
    background: var(--gb-chat-blue);
    color: white;
}

.gb-chat-action-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

/* 6. Input Area */
.gb-chat-input-area {
    padding: 20px 30px 40px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
}

.gb-chat-suggestions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
}

.gb-chat-suggestion {
    white-space: nowrap;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #555;
    cursor: pointer;
    transition: var(--gb-chat-transition);
}

.gb-chat-suggestion:hover {
    background: #f5f5f5;
    color: var(--gb-chat-red);
    border-color: var(--gb-chat-red);
}

.gb-chat-input-wrapper {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 5px 10px 5px 20px;
    transition: var(--gb-chat-transition);
}

.gb-chat-input-wrapper:focus-within {
    border-color: var(--gb-chat-red);
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

.gb-chat-input {
    flex: 1;
    background: none;
    border: none;
    color: #333;
    font-size: 1rem;
    padding: 12px 0;
    outline: none;
}

.gb-chat-input::placeholder {
    color: #888;
}

.gb-chat-send {
    background: var(--gb-chat-red);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--gb-chat-transition);
}

.gb-chat-send:disabled {
    opacity: 0.5;
    cursor: default;
}

/* 7. Typing Indicator */
.gb-chat-typing {
    display: flex;
    gap: 4px;
}

.gb-chat-dot {
    width: 6px;
    height: 6px;
    background: #000;
    border-radius: 50%;
    animation: gb-chat-dot 1.4s infinite ease-in-out both;
}

.gb-chat-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.gb-chat-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes gb-chat-dot {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

/* 8. Responsive Adjustment */
@media (max-width: 768px) {
    .gb-chat-portal-content {
        flex-direction: column;
        height: 100%;
        max-height: 100%;
        width: 100%;
        border-radius: 0;
        border: none;
    }

    .gb-chat-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 80%;
        max-width: 300px;
        transform: translateX(-100%);
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.2);
        z-index: 100;
        background: #ffffff;
    }

    .gb-chat-sidebar.active {
        transform: translateX(0);
    }

    /* Overlay when sidebar is open */
    .gb-sidebar-overlay {
        display: none;
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 99;
    }

    .gb-sidebar-overlay.active {
        display: block;
    }

    .gb-toggle-sidebar {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background: #f5f5f5;
        margin-right: 12px;
    }

    .gb-toggle-sidebar i {
        color: #333;
        font-size: 1rem;
    }

    .gb-trial-fab {
        bottom: 20px;
        right: 50%;
        transform: translateX(50%);
    }

    .gb-trial-fab:hover {
        transform: translateX(50%) translateY(-3px);
    }

    .gb-chat-fab {
        bottom: 20px;
        right: 20px;
        width: 42px;
        height: 42px;
    }

    .gb-chat-header {
        padding: 15px;
    }

    .gb-chat-input-area {
        padding: 15px 15px 30px;
    }

    .gb-chat-actions-bar {
        padding: 0 15px 10px;
    }

    .gb-chat-msg {
        max-width: 90%;
    }
}

/* 9. Trial Registration Popup Styles (Light Theme - Like Main Site) */
.trial-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: calc(var(--gb-chat-z) + 100);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.trial-popup-overlay.active {
    display: flex;
    opacity: 1;
}

.trial-popup-content {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    padding: 35px 30px;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.trial-popup-overlay.active .trial-popup-content {
    transform: translateY(0);
}

.trial-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #999;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.trial-popup-close:hover {
    color: var(--gb-chat-red);
}

.trial-popup-header {
    text-align: center;
    margin-bottom: 25px;
}

.trial-popup-header h2 {
    font-family: 'Titillium Web', sans-serif;
    color: #1a1a1a;
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 0;
}

.trial-popup-header p {
    display: none;
    /* Hidden in light theme for cleaner look */
}

.trial-popup-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trial-popup-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.trial-popup-group.full {
    grid-column: span 1;
}

.trial-popup-group label {
    display: none;
    /* Labels hidden, using placeholders instead */
}

.trial-popup-group input,
.trial-popup-group select,
.trial-popup-group textarea {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px 16px;
    color: #333;
    font-size: 0.95rem;
    font-family: 'Roboto Condensed', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.trial-popup-group input::placeholder,
.trial-popup-group textarea::placeholder {
    color: #888;
}

.trial-popup-group input:focus,
.trial-popup-group select:focus,
.trial-popup-group textarea:focus {
    outline: none;
    border-color: var(--gb-chat-red);
    box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

.trial-popup-group textarea {
    height: 90px;
    resize: none;
}

.trial-popup-group.medical label {
    display: none;
}

.trial-popup-group.medical textarea {
    border-color: #ddd;
}

.trial-popup-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.trial-popup-checkbox input {
    accent-color: var(--gb-chat-red);
    width: 16px;
    height: 16px;
}

.trial-popup-checkbox label {
    font-size: 0.85rem;
    color: #555;
    display: block !important;
}

.trial-popup-checkbox a {
    color: var(--gb-chat-red);
    text-decoration: underline;
}

.trial-popup-submit {
    background: var(--gb-chat-red);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-family: 'Titillium Web', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.trial-popup-submit:hover {
    background: #b00000;
}

@media (max-width: 600px) {
    .trial-popup-form {
        grid-template-columns: 1fr;
    }

    .trial-popup-group.full {
        grid-column: span 1;
    }

    .trial-popup-checkbox {
        grid-column: span 1;
    }

    .trial-popup-submit {
        grid-column: span 1;
    }

    .trial-popup-content {
        padding: 25px;
    }
}
/* 3. Contact Choice Modal (WhatsApp vs Email) */
.contact-choice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10005; /* Higher than chat */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.contact-choice-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.contact-choice-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

.contact-choice-overlay.active .contact-choice-content {
    transform: translateY(0);
}

.contact-choice-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.contact-choice-close:hover {
    color: #cc0000;
}

.contact-choice-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    font-family: 'Titillium Web', sans-serif;
}

.contact-choice-options {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.contact-choice-card {
    flex: 1;
    border-radius: 12px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border: 2px solid transparent;
}

.contact-choice-card.whatsapp {
    background: #e6ffed; /* Light green */
    color: #128c7e;
    border: 1px solid #dcf8c6;
}

.contact-choice-card.email {
    background: #fdf2f2; /* Light red */
    color: #cc0000;
    border: 1px solid #ffe6e6;
}

.contact-choice-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.contact-choice-card.whatsapp:hover {
    background: #25D366;
    color: white;
    border-color: #25D366;
}

.contact-choice-card.email:hover {
    background: #cc0000;
    color: white;
    border-color: #cc0000;
}

.contact-choice-card i {
    font-size: 2rem;
    margin-bottom: 5px;
}

.contact-choice-card span {
    font-weight: 700;
    font-family: 'Roboto Condensed', sans-serif;
}


/* 10. GB Custom Toast Notification */
.gb-toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #000000;
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Titillium Web', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    border-left: 5px solid #666;
    pointer-events: none;
}

.gb-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.gb-toast.success {
    border-left-color: #28a745;
}

.gb-toast.error {
    border-left-color: var(--gb-chat-red);
}

.gb-toast i {
    font-size: 1.2rem;
}

.gb-toast.success i { color: #28a745; }
.gb-toast.error i { color: var(--gb-chat-red); }

