/* ============================================
   AI Trust Advisor — Styles
   Navy (#0c1a2e, #112240) + Gold (#c9a84c, #d4b85c)
   ============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy-deep: #0c1a2e;
    --navy: #112240;
    --navy-light: #1a365d;
    --navy-lighter: #1e3a5f;
    --gold: #c9a84c;
    --gold-light: #d4b85c;
    --gold-dim: rgba(201, 168, 76, 0.15);
    --gold-glow: rgba(201, 168, 76, 0.3);
    --text-primary: #e8e6e3;
    --text-secondary: #8892a4;
    --text-muted: #5a6577;
    --text-dark: #0c1a2e;
    --border: rgba(201, 168, 76, 0.12);
    --shadow: rgba(0, 0, 0, 0.3);
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--navy-deep);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Chat App Container ---- */
.chat-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* ---- Header ---- */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    min-height: 60px;
    padding: 0 20px;
    background: var(--navy);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shield-logo svg {
    width: 32px;
    height: 36px;
}

.header-title h1 {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--gold);
    line-height: 1.2;
}

.header-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clear-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-chat-btn:hover {
    color: var(--gold);
    border-color: var(--gold-glow);
    background: var(--gold-dim);
}

.clear-chat-btn svg {
    width: 16px;
    height: 16px;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--gold);
    border-color: var(--gold-glow);
    background: var(--gold-dim);
}

.back-link svg {
    width: 14px;
    height: 14px;
}

/* ---- Suggested Questions Bar ---- */
.suggestions-bar {
    background: var(--navy);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    min-height: 52px;
}

.suggestions-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
}

.suggestions-scroll::-webkit-scrollbar {
    display: none;
}

.suggestion-chip {
    flex-shrink: 0;
    padding: 7px 16px;
    background: var(--gold-dim);
    border: 1px solid rgba(201, 168, 76, 0.25);
    border-radius: 20px;
    color: var(--gold-light);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.suggestion-chip:hover {
    background: rgba(201, 168, 76, 0.25);
    border-color: var(--gold);
    color: var(--gold);
    transform: translateY(-1px);
}

.suggestion-chip:active {
    transform: translateY(0);
}

/* ---- Chat Messages Area ---- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 168, 76, 0.35);
}

/* ---- Message Bubbles ---- */
.message {
    display: flex;
    gap: 10px;
    max-width: 80%;
    animation: messageIn 0.3s ease-out;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.ai {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.message.ai .message-avatar {
    background: var(--gold-dim);
    border: 1px solid rgba(201, 168, 76, 0.3);
}

.message.ai .message-avatar svg {
    width: 18px;
    height: 20px;
}

.message.user .message-avatar {
    background: rgba(201, 168, 76, 0.2);
    border: 1px solid rgba(201, 168, 76, 0.35);
}

.message.user .message-avatar svg {
    width: 16px;
    height: 16px;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.message.ai .message-bubble {
    background: var(--navy-light);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.message.user .message-bubble {
    background: var(--gold);
    color: var(--text-dark);
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 4px;
}

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

/* ---- Typing Indicator ---- */
.typing-indicator {
    display: flex;
    gap: 10px;
    max-width: 80%;
    align-self: flex-start;
    animation: messageIn 0.3s ease-out;
}

.typing-indicator .message-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    background: var(--gold-dim);
    border: 1px solid rgba(201, 168, 76, 0.3);
}

.typing-indicator .message-avatar svg {
    width: 18px;
    height: 20px;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px 20px;
    background: var(--navy-light);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

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

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

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

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

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

/* ---- Input Area ---- */
.input-area {
    padding: 16px 20px 12px;
    background: var(--navy);
    border-top: 1px solid var(--border);
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

#messageInput {
    flex: 1;
    padding: 12px 18px;
    background: var(--navy-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s ease;
}

#messageInput::placeholder {
    color: var(--text-muted);
}

#messageInput:focus {
    border-color: rgba(201, 168, 76, 0.4);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.08);
}

.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: var(--gold);
    border: none;
    border-radius: 12px;
    color: var(--navy-deep);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--gold-light);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(201, 168, 76, 0.3);
}

.send-btn:active {
    transform: scale(0.97);
}

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

.input-disclaimer {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .header {
        padding: 0 12px;
    }

    .header-title h1 {
        font-size: 15px;
    }

    .header-subtitle {
        font-size: 10px;
    }

    .back-link span {
        display: none;
    }

    .back-link {
        padding: 6px 8px;
    }

    .suggestions-bar {
        padding: 8px 12px;
    }

    .suggestion-chip {
        font-size: 11.5px;
        padding: 6px 12px;
    }

    .chat-messages {
        padding: 16px 12px;
        gap: 12px;
    }

    .message {
        max-width: 90%;
    }

    .message-bubble {
        font-size: 13.5px;
        padding: 10px 14px;
    }

    .input-area {
        padding: 12px;
    }

    #messageInput {
        padding: 10px 14px;
        font-size: 13.5px;
    }

    .send-btn {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 480px) {
    .shield-logo svg {
        width: 26px;
        height: 30px;
    }

    .header-title h1 {
        font-size: 14px;
    }

    .clear-chat-btn {
        width: 32px;
        height: 32px;
    }

    .message-avatar {
        width: 28px;
        height: 28px;
    }

    .message.ai .message-avatar svg {
        width: 14px;
        height: 16px;
    }

    .message.user .message-avatar svg {
        width: 13px;
        height: 13px;
    }
}
