:root {
    --primary-green: #28a745;
    --text-dark: #202124;
    --text-light: #f8f8f8;
    --user-bg: #a7bed3; 
    --bot-bg: #ffffff;   
    --body-bg: #ffffff;
    --border-color: #dadce0;
    
    --font-family: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --logo-font: "Vend Sans", "Noto Sans", sans-serif;

    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.18);
    --backdrop-blur: blur(8px);
}

html {
    height: 100%;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
    display: flex;
    flex-direction: column;
    height: 100dvh; /* Mobile viewport fix */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.chat-header {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-bottom: var(--glass-border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
    padding: 16px 24px;
    text-align: left;
    flex-shrink: 0;
    z-index: 10;
}
.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.logo-pestalytix,
.logo-ai {
    font-family: var(--logo-font);
    font-weight: 700;
}
.logo-pestalytix {
    color: #031f33;
}
.logo-ai {
    color: #ff9933;
}

.chat-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

#chat-start-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    margin: auto 0;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}
.start-title {
    font-size: 2.5rem;
}
.start-subtitle {
    font-size: 1.1rem;
    color: #5f6368;
    margin-top: -10px;
    text-shadow: 0 1px 1px rgba(255,255,255,0.8);
}
.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}
.chip {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-radius: 16px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
}
.chip:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.message {
    padding: 0;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 16px auto;
    box-sizing: border-box;
    position: relative;
}

.message-content {
    padding: 16px 20px;
    border-radius: 16px;
    word-wrap: break-word;
    overflow-x: auto;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.3);
}

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

.message-content p, 
.message-content ul, 
.message-content ol {
    margin: 0 0 1rem 0;
    line-height: 1.6;
    color: var(--text-dark);
}
.message-content p:last-child {
    margin-bottom: 0;
}

.message.bot strong {
    color: #000;
    font-weight: 600;
}
.message.bot ul,
.message.bot ol {
    padding-left: 24px;
}
.message.bot li {
    margin-bottom: 6px;
}

/* Subtle Link Styling */
.message-content a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dotted var(--primary-green);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
}
.message-content a:hover {
    background-color: rgba(40, 167, 69, 0.1);
    border-bottom: 1px solid var(--primary-green);
}
.message-content a .link-icon {
    font-size: 0.85em;
    position: relative;
    top: 2px;
}

/* Copy Button */
.copy-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    color: #777;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
}
.message.bot:hover .copy-btn {
    opacity: 1;
}
.copy-btn:hover {
    background-color: #fff;
    color: var(--text-dark);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.copy-btn .material-symbols-outlined {
    font-size: 18px;
}

.chat-input-area {
    flex-shrink: 0;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-top: var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.input-container {
    width: 100%;
    max-width: 800px;
    position: relative;
    display: flex;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(200, 200, 200, 0.4);
    border-radius: 24px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.input-container:focus-within {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(200, 200, 200, 0.8);
}
textarea#user-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    resize: none;
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.5;
    max-height: 150px;
    overflow-y: auto;
}
textarea#user-input:focus {
    outline: none;
}
button#send-btn {
    background-color: var(--primary-green);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.3);
}
button#send-btn:hover {
    background-color: #218838;
    transform: scale(1.05);
}
button#send-btn:disabled {
    background-color: #9ea7ad;
    transform: none;
    cursor: default;
}

button#send-btn .material-symbols-outlined {
    font-size: 22px; 
    font-weight: 600;
}

.footer-text {
    font-size: 0.75rem;
    color: #777;
    text-align: center;
    margin-top: 12px;
    margin-bottom: 0;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5); 
}
.footer-text.tagline {
    font-size: 0.8rem;
    color: #555;
    margin-top: 8px;
}

.suggestion-chips.horizontal {
    justify-content: flex-start;
    max-width: 800px;
    margin: 0 auto 16px auto;
    box-sizing: border-box;
    padding: 0 16px;
    align-items: center;
}

.chip-group-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #5f6368;
    margin-right: 8px;
    margin-left: 5px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chip-group-label .material-symbols-outlined {
    font-size: 18px;
    color: #5f6368;
}

.chip.chip-fill {
    background-color: rgba(232, 234, 246, 0.8); 
    border-color: #c5cae9;
    color: #3f51b5;
    font-weight: 500;
}
.chip.chip-fill:hover {
    background-color: #c5cae9;
}