/* =================================================================
   JMAC Web - CSS Entry Point
   Loads all modular stylesheets in dependency order.
   Edit individual modules in the css/ directory, not this file.
   ================================================================= */

@import url('css/tokens.css');
@import url('css/base.css');
@import url('css/navbar.css');
@import url('css/layout.css');
@import url('css/account.css');
@import url('css/motion.css');
@import url('css/hero.css');
@import url('css/sections.css');
@import url('css/pricing.css');
@import url('css/ai-news.css');
@import url('css/admin-grids.css');

/* ================================================================
   Business Category autocomplete (RadzenAutoComplete) - dark theme.
   Lives in app.css (fingerprinted) so edge caches can never serve a
   stale version; overrides Radzen material-base which loads earlier.
   ================================================================ */
.jmac-cat-input .rz-inputtext,
input.rz-inputtext.jmac-cat-input,
.jmac-cat-input input {
    background-color: #0e1726 !important;
    color: #e8eef7 !important;
    border: 1px solid rgba(148, 197, 233, 0.25) !important;
    border-radius: 10px !important;
    height: calc(2.4rem + 2px);
    font-size: 0.95rem;
    box-shadow: none !important;
}

.jmac-cat-input input::placeholder {
    color: rgba(148, 163, 184, 0.6) !important;
}

.jmac-cat-input .rz-inputtext:focus,
.jmac-cat-input input:focus {
    border-color: rgba(124, 58, 237, 0.65) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18) !important;
}

.rz-autocomplete-panel {
    background: #0e1726 !important;
    border: 1px solid rgba(148, 197, 233, 0.20) !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55) !important;
    padding: 6px !important;
    margin-top: 6px;
    z-index: 2100 !important;
}

.rz-autocomplete-panel ul,
.rz-autocomplete-panel .rz-autocomplete-items {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

.rz-autocomplete-panel li,
.rz-autocomplete-panel .rz-autocomplete-item {
    background: transparent !important;
    color: #e8eef7 !important;
    border-radius: 10px !important;
    padding: 7px 10px !important;
    margin: 1px 0;
    transition: background 0.12s ease;
}

.rz-autocomplete-panel li:hover,
.rz-autocomplete-panel li.rz-state-highlight,
.rz-autocomplete-panel .rz-autocomplete-item:hover,
.rz-autocomplete-panel .rz-autocomplete-item.rz-state-highlight {
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.28), rgba(20, 201, 166, 0.16)) !important;
    color: #ffffff !important;
}

.rz-autocomplete-panel .jmac-cat-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    min-width: 300px;
}

.rz-autocomplete-panel .jmac-cat-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(20, 201, 166, 0.14);
    color: #14c9a6;
    font-size: 1rem;
    flex-shrink: 0;
}

.rz-autocomplete-panel .jmac-cat-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.rz-autocomplete-panel .jmac-cat-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #e8eef7;
    white-space: nowrap;
}

.rz-autocomplete-panel .jmac-cat-group {
    font-size: 0.7rem;
    color: rgba(148, 163, 184, 0.9);
}

.rz-autocomplete-panel .jmac-cat-pop {
    margin-left: auto;
    font-size: 0.64rem;
    font-weight: 700;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
}

/* ── Modal toast (modal-standards skill) ─────────────────────────
   Always the FIRST element in modal-body: feedback the user sees the
   moment they click, no scrolling. Fades out on its own. */
.modal-toast {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.85rem;
    border-radius: 0.7rem;
    font-size: 0.86rem;
    animation: modal-toast-in 0.22s ease-out;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.modal-toast.is-fading { opacity: 0; transform: translateY(-4px); }

.modal-toast-ok {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #6ee7b7;
}

.modal-toast-err {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(220, 38, 38, 0.08));
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #fca5a5;
}

.modal-toast-text { flex: 1; min-width: 0; }

.modal-toast-close {
    border: 0;
    background: transparent;
    color: inherit;
    opacity: 0.65;
    padding: 0.1rem 0.25rem;
    cursor: pointer;
}

.modal-toast-close:hover { opacity: 1; }

@keyframes modal-toast-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

/* ── Modal footer button standard (piloted on Deploy App Content) ── */
.modal-footer .btn-modal-ghost {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: rgba(203, 213, 225, 0.85);
}

.modal-footer .btn-modal-ghost:hover {
    background: rgba(148, 163, 184, 0.1);
    color: #fff;
}

.modal-footer .btn-modal-secondary {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.45);
    color: #c7d2fe;
}

.modal-footer .btn-modal-secondary:hover {
    background: rgba(99, 102, 241, 0.22);
    color: #fff;
}

.modal-footer .btn-modal-primary {
    background: linear-gradient(135deg, #7c3aed, #4f46e5 55%, #0ea5e9 130%);
    border: 0;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
}

.modal-footer .btn-modal-primary:hover:not(:disabled) {
    filter: brightness(1.1);
    box-shadow: 0 8px 22px rgba(124, 58, 237, 0.45);
}

.modal-footer .btn-modal-primary:disabled { opacity: 0.6; }

/* ── Drip funnel timeline (/admin/email-marketing) ── */
.mk-funnel-timeline { margin-top: 0.5rem; }

.mk-tl-point {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--c, #7c3aed) 22%, transparent);
    border: 1px solid color-mix(in srgb, var(--c, #7c3aed) 55%, transparent);
    color: var(--c, #7c3aed);
    font-size: 0.85rem;
}

.mk-tl-card { text-align: center; padding: 0 0.4rem; }
.mk-tl-label { font-size: 0.8rem; font-weight: 700; white-space: nowrap; }

.mk-tl-stats {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
    color: rgba(203, 213, 225, 0.85);
    margin-top: 0.15rem;
}

/* ── AI Customer Manager chat (agent-chat) ─────────────────────── */
.agent-chat-launcher {
    width: 2.3rem;
    height: 2.3rem;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(167, 139, 250, 0.45);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(14, 165, 233, 0.2));
    color: #d8ccff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.agent-chat-launcher:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.45);
    color: #fff;
}

.agent-chat-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1540;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(2px);
}

.agent-chat-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1550;
    width: min(460px, 96vw);
    display: flex;
    flex-direction: column;
    background: linear-gradient(170deg, #171331, #0d1424 55%);
    border-left: 1px solid rgba(167, 139, 250, 0.3);
    box-shadow: -18px 0 48px rgba(2, 6, 23, 0.6);
    animation: agent-slide-in 0.22s ease-out both;
}

/* Slide only — never animate opacity here. A re-render can leave the animation
   parked mid-way, and a half-faded panel lets the page bleed through it. */
@keyframes agent-slide-in {
    from { transform: translateX(30px); }
    to { transform: none; }
}

.agent-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.agent-chat-title { display: flex; align-items: center; gap: 0.6rem; color: #fff; }

.agent-chat-orb {
    width: 2.2rem;
    height: 2.2rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #0ea5e9);
    color: #fff;
    box-shadow: 0 0 18px rgba(124, 58, 237, 0.5);
}

.agent-chat-sub { font-size: 0.7rem; color: rgba(203, 213, 225, 0.65); }

.agent-chat-scope { padding: 0.6rem 1rem; border-bottom: 1px solid rgba(148, 163, 184, 0.12); }

.agent-chat-messages {
    flex: 1;
    background: transparent;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.agent-chat-empty {
    margin: auto;
    text-align: center;
    color: rgba(148, 163, 184, 0.75);
    font-size: 0.85rem;
    max-width: 300px;
}

.agent-msg { display: flex; }
.agent-msg-user { justify-content: flex-end; }

.agent-msg-bubble {
    max-width: 85%;
    padding: 0.55rem 0.8rem;
    border-radius: 0.9rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.14);
    overflow-wrap: anywhere;
}

.agent-msg-user .agent-msg-bubble {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(79, 70, 229, 0.3));
    border-color: rgba(167, 139, 250, 0.35);
}

.agent-tools { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.agent-tool-chip {
    font-size: 0.68rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #7dd3fc;
}

.agent-thinking { display: inline-flex; gap: 0.3rem; padding: 0.7rem 0.9rem; }

.agent-thinking span {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #a78bfa;
    animation: agent-bounce 1.2s infinite;
}

.agent-thinking span:nth-child(2) { animation-delay: 0.15s; }
.agent-thinking span:nth-child(3) { animation-delay: 0.3s; }

@keyframes agent-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.agent-chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.agent-chat-input textarea { resize: none; font-size: 0.85rem; }

.agent-send {
    align-self: flex-end;
    width: 2.6rem;
    height: 2.6rem;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
}
