/* =========================
   DESIGN TOKENS
========================= */

:root {
    --bg: #0b1220;
    --text: #e5e7eb;
    --muted: #9ca3af;

    --surface: #111827;
    --surface-2: #0f172a;

    --border: #1f2937;

    --user-bg: rgba(96, 165, 250, 0.14);
    --bot-bg: rgba(52, 211, 153, 0.10);

    --user-accent: #60a5fa;
    --bot-accent: #34d399;

    --link: #93c5fd;
    --link-hover: #bfdbfe;

    --shadow: rgba(0,0,0,0.25);
}

body.light {
    --bg: #f8fafc;
    --text: #111827;
    --muted: #4b5563;

    --surface: #ffffff;
    --surface-2: #f3f4f6;

    --border: #d1d5db;

    --user-bg: rgba(37, 99, 235, 0.10);
    --bot-bg: rgba(21, 128, 61, 0.08);

    --user-accent: #2563eb;
    --bot-accent: #15803d;

    --link: #2563eb;
    --link-hover: #1d4ed8;

    --shadow: rgba(0,0,0,0.08);
}

/* =========================
   GLOBAL
========================= */

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    transition: background 0.25s ease, color 0.25s ease;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
    width: 240px;
    padding: 18px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar h3 {
    margin: 0 0 16px;
}

.sidebar a,
.sidebar button {
    width: 100%;
    margin: 8px 0;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s ease;
}

.sidebar a:hover,
.sidebar button:hover {
    background: var(--surface-2);
    border-color: var(--link);
    color: var(--link);
    transform: translateY(-1px);
}

/* =========================
   MAIN LAYOUT
========================= */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* =========================
   HEADER
========================= */

.header {
    padding: 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.header h2 {
    margin: 0 0 8px;
}

#welcome {
    color: var(--muted);
}

#disclaimer {
    color: #f87171;
    font-size: 14px;
    margin-top: 8px;
}

/* =========================
   CHAT AREA
========================= */

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: var(--surface-2);
    scroll-behavior: smooth;
}

.chat-container:empty::before {
    content: "Start a conversation...";
    display: block;
    text-align: center;
    color: var(--muted);
    padding: 40px;
}

/* =========================
   MESSAGES
========================= */

.user,
.bot {
    max-width: 82%;
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-shadow: 0 2px 8px var(--shadow);
}

.user {
    margin-left: auto;
    background: var(--user-bg);
    border: 1px solid rgba(96, 165, 250, 0.18);
}

.bot {
    margin-right: auto;
    background: var(--bot-bg);
    border: 1px solid rgba(52, 211, 153, 0.14);
}

/* =========================
   LINKS
========================= */

.chat-container a,
.user a,
.bot a {
    color: var(--link);
    text-decoration: none;
    font-weight: 600;
}

.chat-container a:hover,
.user a:hover,
.bot a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* =========================
   INPUT AREA
========================= */

.input-area {
    display: flex;
    gap: 10px;
    padding: 14px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

input {
    flex: 1;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 15px;
}

input:focus {
    outline: none;
    border-color: var(--user-accent);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.20);
}

.input-area button {
    padding: 12px 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-weight: 600;
    cursor: pointer;
}

/* =========================
   CTA AREA
========================= */

.cta-container {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid rgba(96, 165, 250, 0.18);
}

.cta a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.22);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.cta a:hover {
    background: rgba(37, 99, 235, 0.20);
    color: white;
}

/* =========================
   MESSAGE LINKS
========================= */

.chat-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.chat-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.22);
    color: rgb(239, 165, 5);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: 0.18s ease;
}

.chat-link-btn:hover {
    background: rgba(37, 99, 235, 0.20);
    color: #ffffff;
}

/* =========================
   PHONE
========================= */

.phone-number {
    margin-top: 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

/* =========================
   LOADING / ERROR
========================= */

.loading-state,
.error-banner {
    padding: 14px;
    text-align: center;
}

.error-banner {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

/* =========================
   SCROLLBAR
========================= */

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,0.25) transparent;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,0.25);
    border-radius: 10px;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .chat-container {
        padding: 14px;
    }

    .user,
    .bot {
        max-width: 92%;
    }
}

/* =========================
   CTA OVERRIDES
========================= */

#cta-container a {
    color: rgb(239, 165, 5) !important;
    font-weight: 600;
    text-decoration: none;
}

#cta-container a:hover {
    color: #ffffff !important;
}

/* =========================
   SIDEBAR GROUPING
========================= */

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 34px;
    margin-bottom: 18px;
}

.sidebar-row {
    margin: 0;
}

/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* =========================
   ACTION LINKS
========================= */

.action-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.22);
    color: rgb(239, 165, 5);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: 0.18s ease;
}

.action-link:hover {
    background: rgba(37, 99, 235, 0.20);
    color: #ffffff;
}

/* =========================
   LANGUAGE BUTTON ACTIVE
========================= */

.lang-active {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-weight: 600;
}

.ai-notice {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.disclaimer-red {
    color: #ff4d4d; /* clean, readable red */
    font-size: 12px;
}
