/* ============================================================
   MARACbot Plugin Styles
   - Inline trigger button (not floating)
   - Animated popup overlay with chat interface
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap');

/* ---------- Wrapper ---------- */
.maracbot-wrapper {
    display: inline-block;
    position: relative;
}

/* ---------- Inline Trigger Button ---------- */
.maracbot-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background-color: #00315A;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    transition: background-color 250ms ease, transform 150ms ease, box-shadow 250ms ease;
    outline: none;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.maracbot-trigger:hover,
.maracbot-trigger:focus-visible {
    background-color: rgba(0, 49, 90, 0.87); /* #00315ADE */
    box-shadow: 0 4px 16px rgba(0, 49, 90, 0.35);
    transform: translateY(-1px);
}

.maracbot-trigger:active {
    transform: translateY(0);
    box-shadow: none;
}

.maracbot-trigger__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #ffffff;
}

/* ---------- Overlay ---------- */
.maracbot-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 350ms ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.maracbot-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ---------- Popup ---------- */
.maracbot-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 60vw;
    max-width: calc(100vw - 32px);
    height: 70vh;
    max-height: calc(100vh - 48px);
    z-index: 9999;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* background: #0d1b2e;*/
    background: transparent;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.25);
	
    /* Hidden state — centered but scaled down */
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.92);
    transform-origin: center center;
    transition:
        opacity 380ms cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 380ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.maracbot-popup.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

/* ---------- Close Button ---------- */
.maracbot-popup__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background-color 200ms ease;
    color: #ffffff;
    padding: 0;
}

.maracbot-popup__close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.maracbot-popup__close svg {
    width: 16px;
    height: 16px;
}

/* ---------- Chat Interface (scoped inside popup) ---------- */
.maracbot-popup .co-content__interface {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    /*padding: 16px;*/
	padding: 0;
    box-sizing: border-box;
    /*font-family: "Titillium Web", sans-serif;*/
    font-size: 16px;
	font-weight: 500;
    line-height: 1.5;
    color: #fff;
}

.maracbot-popup .co-content__interface-chat-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 1px solid rgba(198, 198, 198, 0.25);
    background:
        linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.16) 83.59%, rgba(0,0,0,0.20) 100%),
        linear-gradient(157deg, rgba(255,255,255,0.20) 8.92%, rgba(255,255,255,0.15) 34.64%, rgba(255,255,255,0.10) 90.56%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 4px rgba(0,0,0,0.25);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.maracbot-popup .co-content__interface-chat-list::-webkit-scrollbar {
    width: 4px;
}

.maracbot-popup .co-content__interface-chat-list::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.2);
    border-radius: 4px;
}

/* Chat elements */
.maracbot-popup .co-content__interface-chat-list-elem {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.maracbot-popup .co-content__interface-chat-list-elem--zero {
    display: block;
    margin-bottom: 0;
}

.maracbot-popup .co-content__interface-chat-list-elem-inner {
    display: flex;
    align-items: flex-end;
}

.maracbot-popup .co-content__interface-chat-list-elem-inner-image {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding-right: 12px;
}

.maracbot-popup .co-content__interface-chat-list-elem-inner-content {
    display: flex;
    flex-direction: column;
    width: calc(100% - 40px);
}

/* Chat bubbles */
.maracbot-popup .co-content__interface-chat {
    width: auto;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.5;
}

.maracbot-popup .co-content__interface-chat--out {
    padding: 12px 0;
}

.maracbot-popup .co-content__interface-chat--out .co-content__interface-chat-animation {
    background-color: #ffffff;
    color: #0d346d !important;
    margin-right: auto;
    margin-bottom: 0;
    padding: 12px 16px;
    border-radius: 10px;
    border-top-left-radius: 18px;
    border-bottom-left-radius: 0;
}

.maracbot-popup .co-content__interface-chat--user {
    background-color: #00315A;
    color: #ffffff;
    margin-left: auto;
    text-align: left;
    border-top-right-radius: 18px;
    border-bottom-right-radius: 0;
    max-width: 88%;
    margin-top: 8px;
    margin-bottom: 16px;
}

.maracbot-popup .co-content__interface-chat--system {
    background-color: #ffffff;
    color: #0d346d;
    margin-right: auto;
    margin-bottom: 0;
    border-top-left-radius: 18px;
    border-bottom-left-radius: 0;
    max-width: 88%;
}

/* Typing caret animation */
.maracbot-popup .co-content__interface-chat-animation {
    position: relative;
}

.maracbot-popup .co-content__interface-chat-animation-elem span {
    color: #0d346d;
    animation: maracbot-caret 1s steps(1) infinite;
    border-right: 0.08em solid #0d346d;
    padding-right: 1px;
    margin-left: 2px;
}

@keyframes maracbot-caret {
    50% { border-color: transparent; }
}

/* ---------- Input box ---------- */
.maracbot-popup .co-content__interface-input-box {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background:
        linear-gradient(157deg, rgba(255,255,255,0.20) 8.92%, rgba(255,255,255,0.15) 34.64%, rgba(255,255,255,0.10) 90.56%),
        linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.16) 83.59%, rgba(0,0,0,0.20) 100%);
    border-radius: 12px;
    border: 1px solid rgba(198, 198, 198, 0.30);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 4px 8px 4px 16px;
    box-sizing: border-box;
}

.maracbot-popup .co-content__interface-input {
    flex: 1;
    border: none;
    background-color: transparent;
    resize: none;
    color: #ffffff;
    outline: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    min-height: 44px;
    max-height: 120px;
    padding: 10px 0;
    transition: height 0.2s ease-in-out;
}

.maracbot-popup .co-content__interface-input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
    opacity: 1;
}

.maracbot-popup .co-content__interface-input-btn-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    background-color: rgba(255, 255, 255, 0);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 200ms ease;
    flex-shrink: 0;
}

.maracbot-popup .co-content__interface-input-btn-send:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.maracbot-popup .co-content__interface-input-btn-send img {
    width: 20px;
    height: 20px;
}

/* ---------- Mobile adjustments ---------- */
@media (max-width: 480px) {
    .maracbot-popup {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        height: 85vh;
        border-radius: 16px;
        transform: translate(-50%, -50%) scale(0.92);
        transform-origin: center center;
    }

    .maracbot-popup.is-open {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ---------- Visually hidden utility ---------- */
.maracbot-wrapper .visually-hidden {
    display: none;
}