/* ───────────────────────────────────────────────────────────
   MAYbot Legal Research — Styles
   Aesthetic: deep teal / champagne yellow / legal refined
   Fonts: Cormorant Garamond (display) + DM Sans (body)
─────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    --mb-teal-deep:      #0D3D3A;
    --mb-teal-mid:       #145250;
    --mb-teal-light:     #1E6E69;
    --mb-teal-glow:      #2A8C85;
    --mb-yellow:         #F5E6A3;
    --mb-yellow-bright:  #FFD966;
    --mb-yellow-muted:   #E8D68A;
    --mb-bg:             #0A2E2C;
    --mb-surface:        #112E2B;
    --mb-surface-2:      #163634;
    --mb-border:         rgba(245,230,163,0.15);
    --mb-border-strong:  rgba(245,230,163,0.28);
    --mb-bot-bubble:     #163634;
    --mb-bot-text:       #D4EBE9;
    --mb-user-bubble:    #F5E6A3;
    --mb-user-text:      #0D3D3A;
    --mb-accent:         #F5E6A3;
    --mb-shadow:         0 16px 60px rgba(0,0,0,0.5);
    --mb-radius:         20px;
    --mb-font-body:      'DM Sans', sans-serif;
    --mb-font-display:   'Cormorant Garamond', serif;
}

/* ── Wrapper ── */
.maybot-wrap {
    display: flex;
    flex-direction: column;
    font-family: var(--mb-font-body);
    background: var(--mb-bg);
    border-radius: var(--mb-radius);
    box-shadow: var(--mb-shadow);
    overflow: hidden;
    border: 1px solid var(--mb-border-strong);
    max-width: 760px;
    margin: 0 auto;
    position: relative;
}

/* ── Header ── */
.maybot-header {
    background: linear-gradient(135deg, var(--mb-teal-deep) 0%, var(--mb-teal-mid) 60%, var(--mb-teal-light) 100%);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--mb-border-strong);
    position: relative;
    overflow: hidden;
}

.maybot-header::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,230,163,0.08), transparent 70%);
    pointer-events: none;
}

.maybot-logo {
    width: 46px; height: 46px;
    background: rgba(245,230,163,0.12);
    border: 1.5px solid rgba(245,230,163,0.35);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--mb-yellow);
}

.maybot-logo svg { width: 26px; height: 26px; }

.maybot-header-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.maybot-name {
    font-family: var(--mb-font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--mb-yellow);
    letter-spacing: 0.01em;
    line-height: 1.1;
}

.maybot-name-accent {
    font-weight: 500;
    opacity: 0.85;
    font-size: 18px;
}

.maybot-subtitle {
    font-size: 11.5px;
    color: rgba(245,230,163,0.65);
    font-weight: 300;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.maybot-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #5EDFC9;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(94,223,201,0.25);
    animation: mb-pulse 2.6s ease-in-out infinite;
}

@keyframes mb-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

.maybot-clear-btn {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 1px solid var(--mb-border-strong);
    background: rgba(245,230,163,0.08);
    color: rgba(245,230,163,0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.maybot-clear-btn:hover {
    background: rgba(245,230,163,0.15);
    color: var(--mb-yellow);
}

.maybot-clear-btn svg { width: 17px; height: 17px; }

/* ── Disclaimer ── */
.maybot-disclaimer {
    background: rgba(245,230,163,0.07);
    border-bottom: 1px solid var(--mb-border);
    padding: 8px 20px;
    font-size: 11.5px;
    color: rgba(245,230,163,0.55);
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.maybot-disclaimer svg {
    width: 13px; height: 13px;
    flex-shrink: 0;
    color: var(--mb-yellow-muted);
    opacity: 0.7;
}

/* ── Messages ── */
.maybot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

.maybot-messages::-webkit-scrollbar { width: 4px; }
.maybot-messages::-webkit-scrollbar-track { background: transparent; }
.maybot-messages::-webkit-scrollbar-thumb {
    background: rgba(245,230,163,0.2);
    border-radius: 10px;
}

/* ── Message ── */
.maybot-message {
    display: flex;
    flex-direction: column;
    max-width: 82%;
    animation: mb-msg-in 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mb-msg-in {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.maybot-message--bot  { align-self: flex-start; }
.maybot-message--user { align-self: flex-end; align-items: flex-end; }

.maybot-bubble {
    padding: 13px 17px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.65;
    font-weight: 400;
    word-break: break-word;
    white-space: pre-wrap;
}

.maybot-message--bot .maybot-bubble {
    background: var(--mb-bot-bubble);
    color: var(--mb-bot-text);
    border-bottom-left-radius: 5px;
    border: 1px solid var(--mb-border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.maybot-message--bot .maybot-bubble strong {
    color: var(--mb-yellow);
    font-weight: 600;
}

.maybot-message--user .maybot-bubble {
    background: var(--mb-user-bubble);
    color: var(--mb-user-text);
    border-bottom-right-radius: 5px;
    font-weight: 500;
    box-shadow: 0 2px 14px rgba(245,230,163,0.18);
}

.maybot-time {
    font-size: 10.5px;
    color: rgba(245,230,163,0.3);
    margin-top: 5px;
    padding: 0 4px;
    font-weight: 300;
    letter-spacing: 0.03em;
}

/* ── Typing ── */
.maybot-typing {
    padding: 8px 22px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.maybot-typing-label {
    font-size: 11.5px;
    color: rgba(245,230,163,0.45);
    font-style: italic;
    letter-spacing: 0.02em;
}

.maybot-typing span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--mb-teal-glow);
    animation: mb-bounce 1.3s ease-in-out infinite;
    display: inline-block;
}

.maybot-typing span:nth-child(2) { animation-delay: 0s; }
.maybot-typing span:nth-child(3) { animation-delay: 0.18s; }
.maybot-typing span:nth-child(4) { animation-delay: 0.36s; }

@keyframes mb-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40%            { transform: translateY(-7px); opacity: 1; }
}

/* ── Input ── */
.maybot-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 16px;
    background: var(--mb-surface);
    border-top: 1px solid var(--mb-border);
}

.maybot-input {
    flex: 1;
    background: var(--mb-surface-2);
    border: 1.5px solid var(--mb-border);
    border-radius: 13px;
    padding: 10px 15px;
    font-family: var(--mb-font-body);
    font-size: 14px;
    font-weight: 400;
    color: var(--mb-yellow);
    resize: none;
    line-height: 1.5;
    max-height: 120px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.maybot-input:focus {
    border-color: rgba(245,230,163,0.45);
    box-shadow: 0 0 0 3px rgba(245,230,163,0.07);
}

.maybot-input::placeholder { color: rgba(245,230,163,0.28); }

.maybot-send-btn {
    width: 44px; height: 44px;
    border-radius: 12px;
    border: none;
    background: var(--mb-yellow);
    color: var(--mb-teal-deep);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 3px 14px rgba(245,230,163,0.3);
}

.maybot-send-btn:hover {
    background: var(--mb-yellow-bright);
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(245,230,163,0.4);
}

.maybot-send-btn:active  { transform: scale(0.94); }
.maybot-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.maybot-send-btn svg { width: 17px; height: 17px; }

/* ── Footer ── */
.maybot-footer {
    background: var(--mb-teal-deep);
    border-top: 1px solid var(--mb-border);
    padding: 7px 18px;
    text-align: center;
    font-size: 10.5px;
    color: rgba(245,230,163,0.35);
    letter-spacing: 0.03em;
    font-weight: 300;
}

/* ── Error ── */
.maybot-message--error .maybot-bubble {
    background: rgba(200,60,60,0.12);
    border-color: rgba(200,60,60,0.3);
    color: #F4A0A0;
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .maybot-message { max-width: 92%; }
    .maybot-name { font-size: 16px; }
    .maybot-header { padding: 14px 14px; }
    .maybot-messages { padding: 14px 12px 4px; }
}
