/* AI Chat Hero - Core UI (2025 refresh) */

:root {
    --ach-font: "Space Grotesk", "IBM Plex Sans", "Work Sans", "Noto Sans", sans-serif;
    --ach-text: #1b2230;
    --ach-text-muted: #5d6a7b;
    --ach-text-inverse: #ffffff;
    --ach-accent: #ff6a3d;
    --ach-accent-strong: #f24616;
    --ach-shell-bg: linear-gradient(180deg, #f7f2ea 0%, #f1ede6 100%);
    --ach-shell-border: rgba(24, 30, 40, 0.12);
    --ach-hero-bg: radial-gradient(circle at 15% 20%, rgba(255, 193, 140, 0.45), transparent 45%),
        radial-gradient(circle at 90% 10%, rgba(90, 157, 255, 0.18), transparent 40%),
        linear-gradient(135deg, #fef6ef 0%, #f5efe8 100%);
    --ach-panel-bg: #ffffff;
    --ach-panel-border: rgba(24, 30, 40, 0.1);
    --ach-shadow: 0 24px 60px rgba(20, 24, 32, 0.16);
    --ach-soft-shadow: 0 12px 30px rgba(20, 24, 32, 0.08);
    --ach-input-bg: #ffffff;
    --ach-input-border: rgba(24, 30, 40, 0.16);
    --ach-ring: rgba(255, 106, 61, 0.35);
    --ach-chip-bg: rgba(255, 255, 255, 0.9);
    --ach-chip-border: rgba(255, 106, 61, 0.2);
    --ach-chip-text: #d54a20;
    --ach-user-bubble: linear-gradient(135deg, #ff6a3d 0%, #ff9955 100%);
    --ach-user-text: #ffffff;
    --ach-ai-bubble: #f4f3f0;
    --ach-ai-text: #1f2a3a;
    --ach-composer-bg: #f7f4ef;
    --ach-composer-border: rgba(24, 30, 40, 0.12);
    --ach-radius-xl: 24px;
    --ach-radius-lg: 18px;
    --ach-radius-md: 14px;
    --ach-modal-overlay: rgba(14, 18, 26, 0.65);
}

.my-ai-chatbot-container {
    font-family: var(--ach-font);
    color: var(--ach-text);
    background: transparent;
    border: 1px solid var(--ach-shell-border);
    border-radius: var(--ach-radius-xl);
    box-shadow: var(--ach-shadow);
    overflow: hidden;
    position: relative;
    min-height: 0;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

.my-ai-chatbot-container * {
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

.ach-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: transparent;
}

.ach-section {
    padding: 3.5rem 2.5rem;
}

.ach-hero {
    position: relative;
    background: transparent;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ach-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
}

.ach-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ach-text-muted);
    margin-bottom: 1rem;
}

.ach-title {
    font-size: clamp(2rem, 3vw, 3.2rem);
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: var(--ach-text);
}

.ach-subtitle {
    margin: 0 auto 2rem;
    font-size: 1.05rem;
    color: var(--ach-text-muted);
    max-width: 560px;
}

.ach-hero-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #ffffff;
    border-radius: 999px;
    padding: 0.7rem 0.9rem 0.7rem 1.4rem;
    box-shadow: 0 2px 10px rgba(20, 24, 32, 0.12);
    border: 1px solid rgba(60, 64, 67, 0.16);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    max-width: 640px;
    margin: 0 auto;
}

.ach-hero-card:focus-within {
    box-shadow: 0 4px 16px rgba(20, 24, 32, 0.18);
    border-color: rgba(60, 64, 67, 0.36);
}

.ach-hero-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #202124;
    outline: none;
    height: 44px;
}

.ach-hero-input::placeholder {
    color: #5f6368;
}

.ach-hero-submit {
    border: none;
    background: transparent;
    color: #5f6368;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.ach-hero-submit:hover {
    background: rgba(60, 64, 67, 0.08);
    color: #202124;
}

.ach-suggestions {
    margin-top: 2rem;
    background: transparent;
    border: none;
    padding: 0;
}

.ach-suggestions-title {
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: #202124;
}

.ach-suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.predefined-question-button {
    border: 1px solid rgba(60, 64, 67, 0.2);
    background: #ffffff;
    color: #3c4043;
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.predefined-question-button:hover {
    background: #f8f9fa;
    border-color: rgba(60, 64, 67, 0.35);
    color: #202124;
}

.ach-form {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 520px;
    background: var(--ach-hero-bg);
}

.ach-form-card {
    width: min(var(--ach-form-width-desktop, 520px), 100%);
    background: var(--ach-panel-bg);
    border-radius: var(--ach-radius-lg);
    border: 1px solid var(--ach-panel-border);
    box-shadow: var(--ach-soft-shadow);
    padding: 2.5rem;
}

.ach-form-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1.6rem;
}

.ach-form-card p {
    margin: 0 0 1.5rem;
    color: var(--ach-text-muted);
}

.ach-form-fields {
    display: grid;
    gap: 1rem;
}

.ach-input {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: var(--ach-radius-md);
    border: 1px solid var(--ach-input-border);
    background: var(--ach-input-bg);
    font-size: 0.95rem;
    color: var(--ach-text);
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.ach-input:focus {
    border-color: var(--ach-accent);
    box-shadow: 0 0 0 4px var(--ach-ring);
}

.ach-form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.ach-button {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: var(--ach-radius-md);
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ach-button--primary {
    background: var(--ach-accent);
    color: var(--ach-text-inverse);
    box-shadow: 0 12px 24px rgba(255, 106, 61, 0.25);
}

.ach-button--primary:hover {
    background: var(--ach-accent-strong);
    transform: translateY(-1px);
}

.ach-button--ghost {
    background: transparent;
    border: 1px solid var(--ach-panel-border);
    color: var(--ach-text);
}

.ach-chat {
    display: flex;
    flex-direction: column;
    height: var(--ach-chat-height, 350px);
    min-height: var(--ach-chat-height, 350px);
    background: var(--ach-panel-bg);
}

.ach-chat-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--ach-panel-border);
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
}

.ach-chat-title {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

.ach-chat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ach-text-muted);
}

.ach-messages {
    flex: 1;
    padding: 1.5rem 2rem;
    overflow-y: auto;
    background: var(--ach-panel-bg);
    min-height: 0;
}

.ach-message-row {
    display: flex;
    margin-bottom: 1rem;
}

.ach-message-row.user {
    justify-content: flex-end;
}

.ach-message-row.ai {
    justify-content: flex-start;
}

.ach-bubble {
    max-width: 70%;
    padding: 0.85rem 1rem;
    border-radius: var(--ach-radius-lg);
    background: var(--ach-ai-bubble);
    color: var(--ach-ai-text);
    box-shadow: 0 12px 24px rgba(20, 24, 32, 0.08);
}

.ach-message-row.user .ach-bubble {
    background: var(--ach-user-bubble);
    color: var(--ach-user-text);
    border-bottom-right-radius: 4px;
}

.ach-message-row.ai .ach-bubble {
    border-bottom-left-radius: 4px;
}

.ach-bubble a {
    color: inherit;
    text-decoration: underline;
}

.ach-timestamp {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    opacity: 0.7;
    text-align: right;
}

.ach-composer {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--ach-composer-border);
    background: var(--ach-composer-bg);
}

.ach-composer-input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid var(--ach-input-border);
    background: var(--ach-input-bg);
    padding: 0.9rem 1.25rem;
    font-size: 0.95rem;
    color: var(--ach-text);
    outline: none;
}

.ach-composer-input:focus {
    border-color: var(--ach-accent);
    box-shadow: 0 0 0 4px var(--ach-ring);
}

.ach-composer-send {
    border: none;
    background: var(--ach-accent);
    color: var(--ach-text-inverse);
    border-radius: 999px;
    padding: 0 1.4rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ach-composer-send:hover {
    background: var(--ach-accent-strong);
    transform: translateY(-1px);
}

.ach-loading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ach-loading span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.4;
    animation: ach-bounce 1.4s infinite ease-in-out both;
}

.ach-loading span:nth-child(2) { animation-delay: -0.32s; }
.ach-loading span:nth-child(3) { animation-delay: -0.16s; }

@keyframes ach-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); opacity: 0.9; }
}

.ach-modal {
    position: fixed;
    inset: 0;
    background: var(--ach-modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.ach-modal-panel {
    width: min(960px, 94vw);
    height: min(86vh, 780px);
    background: transparent;
    border-radius: var(--ach-radius-xl);
    box-shadow: var(--ach-shadow);
    overflow: visible;
    position: relative;
}

.ach-modal-panel .my-ai-chatbot-container {
    height: 100%;
    max-width: 100%;
    margin: 0;
}

.ach-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--ach-panel-border);
    background: rgba(255, 255, 255, 0.9);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.ach-floating-bubble {
    position: fixed;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ach-accent);
    color: var(--ach-text-inverse);
    box-shadow: 0 12px 24px rgba(255, 106, 61, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 99999;
}

.ach-floating-bubble:hover {
    background: var(--ach-accent-strong);
    transform: translateY(-2px);
}

.ach-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.ach-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.ach-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(24, 30, 40, 0.2);
    border-radius: 999px;
}

@media (max-width: 900px) {
    .ach-section {
        padding: 2.5rem 1.5rem;
    }

    .ach-hero-card {
        padding: 0.75rem 0.75rem 0.75rem 1rem;
    }

    .ach-composer {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 640px) {
    .ach-form-card {
        width: min(var(--ach-form-width-mobile, 90%), 100%);
    }

    .my-ai-chatbot-container {
        border-radius: 18px;
        min-height: 0;
    }

    .ach-hero {
        min-height: 380px;
    }

    .ach-chat-header {
        padding: 1.25rem 1.5rem;
    }

    .ach-messages {
        padding: 1.25rem 1.5rem;
    }

    .ach-composer {
        flex-direction: column;
        align-items: stretch;
    }

    .ach-composer-send {
        justify-content: center;
        padding: 0.85rem 1rem;
    }
}
