:root {
    --primary-color: #2563eb;
    /* Royal Blue */
    --hover-color: #1d4ed8;
    --bg-color: #f3f4f6;
    --text-color: #1f2937;
    --secondary-text: #6b7280;
    --border-color: #e5e7eb;
    --chat-bg-user: #2563eb;
    /* Solid Blue */
    --chat-bg-bot: #ffffff;
    --status-online: #10b981;
    --avatar-user-bg: #f97316;
    /* Orange */
    --avatar-bot-bg: #ffffff;
    /* White */
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    color: var(--text-color);
    overflow: hidden;
}

/* Header */
.app-header {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

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

.logo-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-icon img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.header-text h1 {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.1;
    font-weight: 700;
}

.header-text .subtitle {
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 400;
}

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

#session-id-display {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: monospace;
    margin-right: 4px;
}

.header-right .icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    /* Rounded square */
    cursor: pointer;
    margin-left: 8px;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-right .icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Status Bar */
.status-bar {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 1.5rem;
    font-size: 0.85rem;
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ccc;
}

.status-indicator.online {
    background-color: var(--status-online);
}

.status-help {
    margin-left: auto;
    color: var(--secondary-text);
}

/* Main Content */
.main-container {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Welcome Screen */
.welcome-screen {
    max-width: 800px;
    width: 100%;
    text-align: center;
    margin-top: 4vh;
    animation: fadeIn 0.5s ease-out;
}

.welcome-content {
    background: #ffffff;
    border-radius: 24px;
    padding: 3rem 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    /* Added shadow for card look */
}

.brand-logo-large {
    width: 80px;
    height: 80px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    overflow: hidden;
}

.brand-logo-large img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.welcome-screen h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #111827;
}

.welcome-screen p {
    color: var(--secondary-text);
    max-width: 500px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.disclaimer-container {
    text-align: left;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 0 auto 2rem;
    max-width: 700px;
}

.disclaimer-container h3 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #111827;
}

.disclaimer-text {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.5;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-right: 10px;
}

.disclaimer-text p {
    margin: 0 0 1rem 0;
    max-width: none;
}

.disclaimer-text p:last-child {
    margin-bottom: 0;
}

.acceptance-container {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
}

.suggestion-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.card.invisible-placeholder {
    visibility: hidden;
    pointer-events: none;
    border: none;
    box-shadow: none;
    background: transparent;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.card i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.card span {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}

.prompt-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: #4b5563;
}

/* Chat Screen */
.chat-screen {
    width: 100%;
    max-width: 900px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 2rem;
}

/* Message Container (Flex for Avatar + Bubble) */
.message-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    max-width: 85%;
    animation: messageSlide 0.3s ease-out;
}

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

.message-container.bot {
    align-self: flex-start;
}

/* Avatars */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.avatar.user {
    background-color: var(--avatar-user-bg);
}

.avatar.bot {
    background-color: var(--avatar-bot-bg);
    overflow: hidden;
}

.avatar.bot img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

/* Message Bubble */
.message-bubble {
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message-container.user .message-bubble {
    background-color: var(--chat-bg-user);
    color: white;
    border-bottom-right-radius: 4px;
    /* Sharp corner */
}

.message-container.bot .message-bubble {
    background-color: var(--chat-bg-bot);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    /* Card style */
    border-bottom-left-radius: 4px;
    /* Sharp corner */
}

/* Content within bubble */
.message-content {
    word-break: break-word;
    /* Handle overflow */
    overflow-wrap: break-word;
}

.message-content p {
    margin: 0 0 0.5rem 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Links in user bubble should be white */
.message-container.user .message-bubble a {
    color: white;
    text-decoration: underline;
}

/* Timestamp */
.message-time {
    font-size: 0.7rem;
    margin-top: 6px;
    display: block;
    text-align: right;
    opacity: 0.7;
}

.message-container.user .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.message-container.bot .message-time {
    color: var(--secondary-text);
}


/* Footer / Input */
.app-footer {
    padding: 1rem 2rem;
    background: white;
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    /* Pill shape */
    background: white;
    padding: 4px;
    transition: all 0.2s;
    /* Removed blue border/shadow by default */
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#user-input {
    width: 100%;
    border: none;
    outline: none;
    padding: 12px 20px;
    font-size: 1rem;
    color: #1f2937;
    background: transparent;
    padding-right: 100px;
}

.input-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
}

.send-btn {
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    /* Circle */
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.send-btn:hover {
    background-color: var(--hover-color);
}

.chips-container {
    max-width: 900px;
    margin: 12px auto 6px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.chip {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    color: #4b5563;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.chip:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.footer-info {
    text-align: right;
    font-size: 0.7rem;
    color: #9ca3af;
    max-width: 900px;
    margin: 4px auto 0;
    padding-right: 12px;
}

/* Typing Indicator */
.typing-indicator-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

.typing-indicator {
    background-color: var(--chat-bg-bot);
    padding: 12px 20px;
    border-radius: 1rem;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
    display: inline-block;
}

.typing-dot {
    height: 8px;
    width: 8px;
    background-color: #6b7280;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out both;
}

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

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

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .suggestion-cards {
        grid-template-columns: 1fr;
    }

    .chat-screen {
        padding-bottom: 80px;
    }

    .app-header h1 {
        font-size: 1rem;
    }
}

/* Message Images */
.message-content img {
    max-width: 100%;
    height: auto;
    margin-top: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: block;
}