/* General body styling */
html, body {
    height: 100%;
}

body {
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    background-color: #f3f7ed;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    min-height: 100vh;
}

.app-shell {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    color: #2f5d34;
    margin: 0 0 20px 0;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Chat mode container styling */
.chat-mode-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.chat-mode-container label {
    font-weight: 600;
    color: #2f5d34;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

#chat-mode {
    padding: 9px 16px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 500;
    color: #2f5d34;
    background-color: #ffffff;
    border: 1.5px solid #c5d9c0;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    min-width: 200px;
}

#chat-mode:hover {
    background-color: #f8fdf7;
    border-color: #4b8a3e;
    box-shadow: 0 3px 10px rgba(75, 138, 62, 0.15);
}

#chat-mode:focus {
    background-color: #ffffff;
    border-color: #4b8a3e;
    box-shadow: 0 0 0 3px rgba(75, 138, 62, 0.1);
}

/* Chat container styling */
#chat-container {
    font-size: 0.9rem;
    border: 1px solid #cdd1b6;
    border-radius: 12px;
    padding: 18px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 16px;
    background-color: #ffffff;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.08);
}

.message {
    margin-bottom: 10px;
    padding: 9px 12px;
    border-radius: 14px;
    max-width: 68%;
    display: inline-block;
    word-wrap: break-word;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
}

.message.user {
    text-align: right;
    background-color: #d2e8cf;
    color: #1e441e;
}

.message.assistant {
    text-align: left;
    background-color: #f1f1f1;
    color: #333;
}

.assistant-loading::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    border: 3px solid rgba(75, 138, 62, 0.3);
    border-top-color: #4b8a3e;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Progress message styling */
.progress-message {
    margin-bottom: 12px;
    padding: 8px 12px;
    background-color: #f8fdf7;
    border-left: 3px solid #4b8a3e;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #2f5d34;
    opacity: 0.9;
}

.progress-message strong {
    font-weight: 600;
}

/* Progress bar container */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background-color: #e0e7dc;
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

/* Progress bar fill */
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4b8a3e, #6bb05d);
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border: 1px solid #cdd1b6;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.08);
}

#user-input {
    flex: 1;
    padding: 9px 12px;
    font-size: 0.9rem;
    border: 1px solid #cdd1b6;
    border-radius: 8px;
}

#send-button {
    padding: 9px 20px;
    font-size: 0.9rem;
    background-color: #4b8a3e;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#send-button:hover {
    background-color: #3b6f2c;
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .app-shell {
        padding: 12px;
    }

    h1 {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }

    .chat-mode-container {
        margin-bottom: 10px;
    }

    #chat-container {
        padding: 12px;
        margin-bottom: 12px;
    }

    .message {
        max-width: 85%;
        padding: 8px 10px;
    }

    .input-container {
        padding: 12px;
        gap: 8px;
    }

    #user-input {
        padding: 8px 10px;
    }

    #send-button {
        padding: 8px 16px;
    }
}
