/* ---------------------------------------------------
   FONT IMPORT (fallback for sites that override it)
--------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap');

/* ---------------------------------------------------
   ROOT THEME VARIABLES (Build.py replaces these)
--------------------------------------------------- */
:root {
    --primary-color: #4A7C8C;
    --primary-hover: #528a9c;
    --primary-dark: #3c6572;
    --accent-color: #6BA4B8;

    --background: #FAFCFD;
    --background-alt: #F5FAFE;

    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border-color: #D1E9F0;

    --assistant-message-bg: #FFFFFF;
    --user-message-bg: #E5F3F8;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.12);

    /* Custom per-site bubble tuning */
    --bubble-radius: 16px;
    --bubble-padding: 14px 18px;

    --font-family: 'Crimson Text', 'Georgia', serif;
}

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

body {
    font-family: var(--font-family);
    background: var(--background-alt);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------
   HEADER
--------------------------------------------------- */
.header {
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
}

.header-content {
    width: 100%;
    max-width: 1100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.submit-event-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--primary-color);
    color: white;
    padding: .6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    border: none;
}

/* ---------------------------------------------------
   BETA BANNER (Diagonal Ribbon)
--------------------------------------------------- */
.beta-banner {
    position: fixed;
    top: 20px;
    left: -50px;
    background: #059669;
    color: white;
    padding: 0.6rem 4rem;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    transform: rotate(-45deg);
    transform-origin: center;
    z-index: 999;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
}

/* ---------------------------------------------------
   CHAT CONTAINER
--------------------------------------------------- */
.chat-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-logo {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 2rem 0;
    text-align: center;
}

.hero-logo img {
    width: 320px;
    height: auto;
}

/* ---------------------------------------------------
   MESSAGES LIST
--------------------------------------------------- */
.messages-wrapper {
    width: 100%;
    max-width: 1100px;
    overflow-y: auto;
    flex: 1;
    padding: 1rem 2rem;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ---------------------------------------------------
   MESSAGE BLOCK
--------------------------------------------------- */
.message {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Avatar */
.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent avatar from being squeezed */
}

/* Assistant vs User */
.message-content {
    padding: var(--bubble-padding);
    background: var(--assistant-message-bg);
    border-radius: var(--bubble-radius);
    border: 1px solid var(--border-color);
    max-width: 1100px;
    line-height: 1.6;
}

.user-message .message-content {
    background: var(--user-message-bg);
}

/* ---------------------------------------------------
   TYPING INDICATOR (Bouncing Dots)
--------------------------------------------------- */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.6;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

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

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

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    40% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ---------------------------------------------------
   ANIMATIONS (controlled by body class)
--------------------------------------------------- */
@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes popInMsg {
    0% { opacity: 0; transform: scale(.95); }
    80% { opacity: 1; transform: scale(1.02); }
    100% { transform: scale(1); }
}

body.anim-fade .message { animation: fadeInMsg .25s ease-out; }
body.anim-slide .message { animation: slideInMsg .25s ease-out; }
body.anim-pop .message { animation: popInMsg .25s ease-out; }

/* ---------------------------------------------------
   INPUT BAR
--------------------------------------------------- */
.input-container {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--background);
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    background: white;
    padding: .5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.message-input {
    flex: 1;
    border: none;
    resize: none;
    outline: none;
    padding: .6rem;
    font-size: 1rem;
    line-height: 1.4;
}

.send-button {
    border: none;
    background: var(--primary-color);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.input-footer {
    margin-top: .4rem;
    text-align: center;
    font-size: .8rem;
    color: var(--text-secondary);
}

.catalog-shortcut {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.catalog-shortcut:hover {
    background: rgba(139, 69, 19, 0.1);
}

/* Footer catalog link */
.catalog-link-footer {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0;
    transition: color 0.2s;
    font-family: inherit;
}

.catalog-link-footer:hover {
    color: var(--primary-color);
}

/* Hide input button on all screen sizes */
.catalog-shortcut {
    display: none;
}

/* ---------------------------------------------------
   MODAL (Event form)
--------------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-content {
    width: 95%;
    max-width: 600px;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none;
    border: none;
    cursor: pointer;
}

/* ---------------------------------------------------
   SUCCESS MESSAGE
--------------------------------------------------- */
.success-message {
    text-align: center;
    padding: 2rem;
}

/* ---------------------------------------------------
   FOOTER
--------------------------------------------------- */
.footer {
    padding: 1rem;
    background: var(--background);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family);
    font-size: .9rem;
    color: var(--text-secondary);
}

.footer-logo {
    height: 20px;
}

/* ---------------------------------------------------
   MOBILE
--------------------------------------------------- */
@media (max-width: 768px) {
    .messages-wrapper { padding: 1rem; }
    .hero-logo img { width: 240px; }

    /* Hide keyboard hint on mobile to save space */
    .input-hint { display: none; }

    /* Fix message layout on mobile */
    .message {
        gap: 0.75rem; /* Reduce gap slightly on mobile */
    }

    .message-avatar {
        flex-shrink: 0; /* Prevent avatar from being squeezed */
        width: 36px;    /* Slightly smaller on mobile */
        height: 36px;
    }

    .message-content {
        max-width: calc(100vw - 1rem - 0.75rem - 36px - 2rem); /* Full width minus padding and avatar */
    }
}


