/* INCY AI Helper — matching incy-index.html design */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #050505;
    --bg-card: #0a0a0a;
    --bg-card-hover: #111111;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);

    --accent: #B8D94A;
    --accent-dim: #8fb033;
    --accent-glow: rgba(184, 217, 74, 0.5);
    --gradient: linear-gradient(135deg, #B8D94A 0%, #7cb342 50%, #4caf50 100%);

    --text: #ffffff;
    --text-secondary: rgba(255,255,255,0.6);
    --text-muted: rgba(255,255,255,0.4);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent);
    color: #000;
}

/* ===== App Layout ===== */

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 820px;
    margin: 0 auto;
}

/* ===== Header ===== */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

.header-text h1 {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.header-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.header-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

/* ===== Chat Area ===== */

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

.chat-area::-webkit-scrollbar {
    width: 5px;
}

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

.chat-area::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
}

.chat-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.14);
}

/* ===== Welcome Screen ===== */

.welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    min-height: 100%;
}

.welcome-icon {
    width: 76px;
    height: 76px;
    background: var(--gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    margin-bottom: 24px;
    box-shadow: 0 8px 40px rgba(184, 217, 74, 0.2);
}

.welcome h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text);
}

.welcome p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 28px;
    max-width: 420px;
    line-height: 1.6;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 520px;
}

.quick-btn {
    padding: 9px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 100px;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.2s;
}

.quick-btn:hover {
    border-color: rgba(184, 217, 74, 0.3);
    color: var(--accent);
    background: rgba(184, 217, 74, 0.06);
}

/* ===== Messages ===== */

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    animation: fadeIn 0.3s ease;
}

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

.message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-user .message-avatar {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.message-bot .message-avatar {
    background: var(--gradient);
    color: #000;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-name {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-text {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.7;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-user .message-text {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
}

.message-bot .message-text {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
}

.message-text strong {
    color: var(--accent);
    font-weight: 600;
}

.message-text a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.15s;
}

.message-text a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.message-text code {
    background: rgba(184, 217, 74, 0.08);
    border: 1px solid rgba(184, 217, 74, 0.12);
    padding: 1px 7px;
    border-radius: 5px;
    font-size: 13px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--accent);
}

.message-text hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 14px 0;
}

.message-text table {
    border-collapse: collapse;
    margin: 10px 0;
    width: 100%;
    font-size: 13px;
}

.message-text table th,
.message-text table td {
    border: 1px solid var(--border);
    padding: 7px 12px;
    text-align: left;
}

.message-text table th {
    background: var(--bg-card-hover);
    font-weight: 600;
    color: var(--text);
}

.message-text table td {
    color: var(--text-secondary);
}

/* ===== Related Questions ===== */

.related-questions,
.message-related {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.related-btn {
    padding: 6px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 100px;
    cursor: pointer;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.2s;
}

.related-btn:hover {
    border-color: rgba(184, 217, 74, 0.3);
    color: var(--accent);
    background: rgba(184, 217, 74, 0.06);
}

/* ===== Typing Indicator ===== */

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 4px 0;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    animation: typingBounce 1.2s ease-in-out infinite;
}

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-7px); opacity: 1; }
}

/* ===== Input Area ===== */

.input-area {
    padding: 14px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 5px 5px 5px 16px;
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    border-color: rgba(184, 217, 74, 0.3);
    box-shadow: 0 0 0 3px rgba(184, 217, 74, 0.06);
}

#userInput {
    flex: 1;
    border: none;
    background: none;
    color: var(--text);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    resize: none;
    outline: none;
    max-height: 120px;
    padding: 8px 0;
}

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

.send-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: var(--gradient);
    color: #000;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:disabled {
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    cursor: not-allowed;
}

.send-btn:not(:disabled):hover {
    box-shadow: 0 4px 20px rgba(184, 217, 74, 0.3);
    transform: translateY(-1px);
}

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

.input-footer a {
    color: var(--accent-dim);
    text-decoration: none;
}

.input-footer a:hover {
    text-decoration: underline;
}

/* ===== Mobile ===== */

@media (max-width: 600px) {
    .app {
        max-width: 100%;
    }

    .header {
        padding: 12px 16px;
    }

    .chat-area {
        padding: 16px;
    }

    .input-area {
        padding: 12px 16px;
    }

    .welcome {
        padding: 24px 16px;
    }

    .welcome h2 {
        font-size: 22px;
    }

    .welcome-icon {
        width: 60px;
        height: 60px;
        border-radius: 16px;
    }

    .quick-actions {
        max-width: 100%;
    }

    .quick-btn {
        font-size: 12px;
        padding: 7px 14px;
    }
}
