/* AI Support Chat Styles */
.support-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 2rem;
    height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* ========== COMPACT HEADER — Horizontal row ========== */
.chat-header {
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, var(--sage) 0%, var(--sage-dark) 100%);
    color: white;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.mona-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

/* Avatar with glow ring — oversized, overflows header */
.mona-avatar-ring {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    margin: -0.4rem 0;
}

.mona-avatar-header {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Online status dot */
.mona-status-dot {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 13px;
    height: 13px;
    background: #4ade80;
    border-radius: 50%;
    border: 2.5px solid var(--sage);
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

.mona-header-text {
    flex: 1;
    min-width: 0;
}

.chat-header h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.chat-header p {
    font-size: 0.8rem;
    opacity: 0.8;
    margin: 0;
    font-weight: 400;
    line-height: 1.3;
}

/* ========== MESSAGES ========== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
}

.chat-message {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Message timestamps */
.msg-time {
    display: block;
    font-size: 0.7rem;
    opacity: 0.5;
    margin-top: 0.4rem;
    font-weight: 400;
}

.chat-message.user .msg-time {
    text-align: right;
}

.chat-message.user {
    align-self: flex-end;
    background: var(--terracotta);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant {
    align-self: flex-start;
    background: var(--sand);
    color: var(--warm-brown);
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

/* Larger message avatars */
.mona-avatar-msg {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-message.system {
    align-self: center;
    background: rgba(143, 166, 138, 0.15);
    color: var(--sage-dark);
    font-size: 0.82rem;
    text-align: center;
    max-width: 90%;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    line-height: 1.5;
}

/* ========== INPUT AREA ========== */
.chat-input-area {
    padding: 0.65rem 1.25rem;
    border-top: 1px solid var(--sand);
    display: flex;
    gap: 0.6rem;
    align-items: flex-end;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 0.7rem 1.1rem;
    border: 2px solid var(--sand);
    border-radius: 24px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    resize: none;
    max-height: 120px;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--sage);
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--sage);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: var(--sage-dark);
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    background: var(--sand);
    cursor: not-allowed;
    transform: none;
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
}

/* ========== TYPING INDICATOR with text label ========== */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 0.85rem 1.25rem;
    background: var(--sand);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    align-items: center;
}

.typing-indicator .mona-avatar-msg {
    margin-right: 6px;
}

.typing-label {
    font-size: 0.82rem;
    color: var(--sage-dark);
    font-style: italic;
    margin-right: 4px;
    font-weight: 500;
}

.typing-dots {
    display: flex;
    gap: 3px;
    align-items: center;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sage);
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    50% { transform: translateY(-5px); opacity: 1; }
}

/* ========== MONA RICH MESSAGE FORMATTING ========== */
.mona-msg-content {
    flex: 1;
    min-width: 0;
}

.mona-msg-content strong {
    font-weight: 700;
    color: var(--forest);
}

.mona-msg-content em {
    font-style: italic;
}

.mona-msg-content ul.mona-list {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
    list-style: none;
}

.mona-msg-content ul.mona-list li {
    position: relative;
    padding-left: 0.25rem;
    margin-bottom: 0.35rem;
}

.mona-msg-content ul.mona-list li::before {
    content: '\2022';
    position: absolute;
    left: -1rem;
    color: var(--sage);
    font-weight: 700;
    font-size: 1.1em;
}

.mona-msg-content a.mona-link {
    color: var(--sage);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
    word-break: break-all;
}

.mona-msg-content a.mona-link:hover {
    color: var(--forest);
}

/* ========== TOOLKIT TOGGLE ========== */
.toolkit-bar {
    padding: 0.35rem 1.25rem;
    border-top: 1px solid var(--sand);
    flex-shrink: 0;
}

.toolkit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid var(--sand);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sage-dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.toolkit-toggle:hover {
    background: rgba(45, 90, 61, 0.06);
    border-color: var(--sage);
    color: var(--sage);
}

.toolkit-toggle svg {
    flex-shrink: 0;
}

.toolkit-chevron {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.toolkit-chevron.open {
    transform: rotate(180deg);
}

/* ========== GUIDED EXERCISES (inside toolkit) ========== */
.guided-exercises {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem 0.75rem;
    background: rgba(45, 90, 61, 0.04);
    animation: fadeIn 0.3s ease;
}

.guided-exercises[style*="display: none"] + .quick-prompts {
    border-top: none;
}

.exercise-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--sage) 0%, var(--forest) 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.exercise-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.3);
}

/* ========== QUICK PROMPTS — clean pills, no emojis ========== */
.quick-prompts {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--sand);
    animation: fadeIn 0.4s ease;
}

.quick-prompt-btn {
    padding: 0.45rem 1rem;
    background: transparent;
    border: 1.5px solid var(--sage);
    border-radius: 20px;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--sage-dark);
    cursor: pointer;
    transition: all 0.25s ease;
}

.quick-prompt-btn:hover {
    background: var(--sage);
    color: white;
    border-color: var(--sage);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.2);
}

/* ========== CRISIS BANNER ========== */
.crisis-banner {
    background: linear-gradient(135deg, var(--terracotta) 0%, var(--rust) 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.crisis-banner a {
    color: white;
    font-weight: 600;
}

/* ─── Dark Mode Overrides ──────────────────────────────────── */
body.dark-mode .chat-message.assistant {
    background: #2E261F;
    color: var(--warm-brown);
}

body.dark-mode .typing-indicator {
    background: #2E261F;
}

body.dark-mode .chat-input-area {
    border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .chat-input {
    background: #241E18;
    color: #E8DDD0;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .chat-input:focus {
    border-color: var(--sage);
}

body.dark-mode .quick-prompts {
    border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .toolkit-bar {
    border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .guided-exercises {
    background: rgba(74, 155, 102, 0.06);
}
