/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sage-green: #6B8476;
    --sage-light: #8FA396;
    --sage-lighter: #B8C9BF;
    --sage-pale: #E8EDE9;
    --sage-dark: #4A5D52;
    --cream: #F5F3EF;
    --white: #FFFFFF;
    --text-dark: #2C3E37;
    --text-medium: #5A6B63;
    --text-light: #8FA396;
    --warning: #E89B7D;
    --shadow: rgba(107, 132, 118, 0.1);
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background-color: var(--cream);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--white);
    border-bottom: 1px solid var(--sage-pale);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Avenir Next', sans-serif;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--sage-green);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.menu-btn:hover {
    background: var(--sage-pale);
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--cream);
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Message Styles */
.message {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

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

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kora-avatar {
    width: 32px;
    height: 32px;
    background: var(--sage-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 0.8;
}

.kora-avatar::after {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--white);
    border-radius: 50%;
}

.message-sender {
    font-weight: 600;
    color: var(--sage-dark);
    font-size: 14px;
}

.message-bubble {
    background: var(--sage-pale);
    padding: 16px 20px;
    border-radius: 20px;
    border-top-left-radius: 4px;
    color: var(--text-dark);
    line-height: 1.6;
    max-width: 90%;
}

.message-bubble p {
    margin: 0;
}

.user-message {
    align-self: flex-end;
    align-items: flex-end;
}

.user-message .message-bubble {
    background: var(--sage-green);
    color: var(--white);
    border-top-left-radius: 20px;
    border-top-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 16px 20px;
    background: var(--sage-pale);
    border-radius: 20px;
    border-top-left-radius: 4px;
    max-width: 70px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--sage-green);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Input Area */
.input-area {
    padding: 20px 24px;
    background: var(--white);
    border-top: 1px solid var(--sage-pale);
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-btn {
    background: var(--sage-pale);
    border: 2px solid var(--sage-light);
    color: var(--sage-dark);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
}

.action-btn:hover {
    background: var(--sage-green);
    color: var(--white);
    border-color: var(--sage-green);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

.response-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.response-chip {
    background: var(--sage-pale);
    border: none;
    color: var(--sage-dark);
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    font-weight: 500;
}

.response-chip:hover {
    background: var(--sage-green);
    color: var(--white);
    transform: scale(1.05);
}

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

.text-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--sage-pale);
    border-radius: 12px;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    color: var(--text-dark);
    background: var(--cream);
    transition: border-color 0.3s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--sage-green);
}

.send-btn {
    background: var(--sage-green);
    color: var(--white);
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-btn:hover {
    background: var(--sage-dark);
    transform: translateY(-2px);
}

.send-btn:disabled {
    background: var(--sage-lighter);
    cursor: not-allowed;
    transform: none;
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    transition: right 0.3s ease;
}

.menu-overlay.active {
    right: 0;
}

.menu-content {
    position: absolute;
    right: 0;
    top: 0;
    width: 300px;
    height: 100vh;
    background: var(--white);
    padding: 24px;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.close-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 36px;
    color: var(--text-medium);
    cursor: pointer;
    line-height: 1;
}

.menu-nav {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-nav a {
    padding: 14px 16px;
    color: var(--text-medium);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.menu-nav a:hover {
    background: var(--sage-pale);
    color: var(--sage-dark);
}

.menu-nav a.active {
    background: var(--sage-green);
    color: var(--white);
}

.menu-nav hr {
    border: none;
    border-top: 1px solid var(--sage-pale);
    margin: 12px 0;
}

/* Warning Alert */
.warning-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(232, 155, 125, 0.1);
    border-left: 4px solid var(--warning);
    border-radius: 8px;
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-dark);
}

.warning-icon {
    color: var(--warning);
    font-size: 20px;
}

/* Responsive */
@media (max-width: 640px) {
    .app-container {
        max-width: 100%;
    }

    .message-bubble {
        max-width: 85%;
    }

    .menu-content {
        width: 80%;
        max-width: 300px;
    }
}

/* Scroll behavior */
.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: var(--cream);
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--sage-lighter);
    border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: var(--sage-light);
}
