/* ==========================================================================
   S&R CoreSync — AI Concierge floating widget
   ========================================================================== */

.srx-concierge-fab {
    display: none !important;
}

.srx-concierge-fab:hover { transform: translateY(-2px); border-color: #f3dfba; }

.srx-concierge-fab:focus-visible { outline: 2px solid #f3dfba; outline-offset: 3px; }

.srx-concierge-fab__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

.srx-concierge-fab__badge {
    position: absolute;
    top: -5px;
    inset-inline-start: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.64rem;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.srx-concierge-fab[hidden] { display: none; }

/* ---------------- panel ---------------- */
.srx-concierge {
    position: fixed;
    inset-inline-end: 1.1rem;
    bottom: 1.1rem;
    z-index: 99995;
    width: min(380px, calc(100vw - 1.6rem));
    height: min(560px, calc(100vh - 2.2rem));
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    border: 1px solid rgba(var(--sr-gold-rgb, 212, 175, 55), 0.45);
    background: rgba(5, 13, 10, 0.98);
    color: #e6ebe8;
    font-family: "Alexandria", "Tajawal", system-ui, sans-serif;
    box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 1);
    overflow: hidden;
}

.srx-concierge[hidden] { display: none; }

.srx-concierge__head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    background: linear-gradient(135deg, rgba(var(--sr-gold-rgb, 212, 175, 55), 0.2), rgba(16, 185, 129, 0.14));
    border-bottom: 1px solid rgba(var(--sr-gold-rgb, 212, 175, 55), 0.25);
}

.srx-concierge__head strong { font-size: 0.86rem; color: #fff; }
.srx-concierge__head small { display: block; font-size: 0.66rem; color: #9fe6c6; font-weight: 500; }

.srx-concierge__head .srx-spacer { flex: 1; }

.srx-concierge__head button {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(var(--sr-gold-rgb, 212, 175, 55), 0.35);
    background: rgba(255, 255, 255, 0.04);
    color: #e6ebe8;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    display: grid;
    place-items: center;
}

.srx-concierge__head button:hover { border-color: #f3dfba; color: #f3dfba; }
.srx-concierge__head button:focus-visible { outline: 2px solid #f3dfba; outline-offset: 2px; }

.srx-concierge__body {
    flex: 1;
    overflow-y: auto;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    scroll-behavior: smooth;
}

.srx-msg {
    max-width: 90%;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    font-size: 0.82rem;
    line-height: 1.75;
    word-wrap: break-word;
}

.srx-msg--bot {
    align-self: flex-start;
    background: rgba(var(--sr-gold-rgb, 212, 175, 55), 0.12);
    border: 1px solid rgba(var(--sr-gold-rgb, 212, 175, 55), 0.25);
    border-start-start-radius: 4px;
    color: #e6ebe8;
}

.srx-msg--user {
    align-self: flex-end;
    background: linear-gradient(135deg, #d9bd93, #b8975f);
    color: #04100b;
    border-start-end-radius: 4px;
    font-weight: 600;
}

.srx-msg a { color: #9fe6c6; font-weight: 700; }
.srx-msg--user a { color: #04100b; }

.srx-msg__meta { display: block; margin-top: 0.35rem; font-size: 0.64rem; opacity: 0.7; }

.srx-concierge__chips {
    display: flex;
    gap: 0.35rem;
    padding: 0 0.9rem 0.55rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.srx-concierge__chips::-webkit-scrollbar { display: none; }

.srx-chip-btn {
    flex: 0 0 auto;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(var(--sr-gold-rgb, 212, 175, 55), 0.35);
    background: transparent;
    color: #e6ebe8;
    cursor: pointer;
    white-space: nowrap;
}

.srx-chip-btn:hover { border-color: #f3dfba; color: #f3dfba; }
.srx-chip-btn:focus-visible { outline: 2px solid #f3dfba; outline-offset: 2px; }

.srx-concierge__form {
    display: flex;
    gap: 0.4rem;
    padding: 0.6rem;
    border-top: 1px solid rgba(var(--sr-gold-rgb, 212, 175, 55), 0.22);
    background: rgba(4, 10, 8, 0.9);
}

.srx-concierge__form input {
    flex: 1;
    font-family: inherit;
    font-size: 0.82rem;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(var(--sr-gold-rgb, 212, 175, 55), 0.35);
    background: #06120e;
    color: #e6ebe8;
}

.srx-concierge__form input::placeholder { color: #6b7f78; }

.srx-concierge__form button {
    width: 42px;
    border-radius: 10px;
    border: 1px solid rgba(var(--sr-gold-rgb, 212, 175, 55), 0.45);
    background: linear-gradient(135deg, #d9bd93, #b8975f);
    color: #04100b;
    font-size: 1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.srx-concierge__form button:hover { filter: brightness(1.06); }
.srx-concierge__form button:focus-visible { outline: 2px solid #f3dfba; outline-offset: 2px; }
.srx-concierge__form button:disabled { opacity: 0.5; cursor: wait; }

.srx-concierge__foot {
    padding: 0 0.9rem 0.55rem;
    font-size: 0.64rem;
    color: #8ba39a;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.srx-concierge__foot a { color: #f3dfba; }

.srx-typing { display: inline-flex; gap: 3px; align-items: center; }
.srx-typing i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9fe6c6;
    animation: srxBlink 1.1s infinite ease-in-out;
}
.srx-typing i:nth-child(2) { animation-delay: 0.15s; }
.srx-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes srxBlink {
    0%, 100% { opacity: 0.25; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-2px); }
}

@media (max-width: 520px) {
    .srx-concierge {
        inset-inline: 0.6rem;
        bottom: 0.6rem;
        width: auto;
        height: min(78vh, 620px);
    }
    .srx-concierge-fab {
    display: none !important;
}
}

@media (prefers-reduced-motion: reduce) {
    .srx-concierge-fab, .srx-typing i { transition: none; animation: none; }
}
