:root {
    /* Gemini Web Light Theme Colors */
    --gemini-bg: #ffffff;
    --gemini-surface: #f0f4f9;
    --gemini-border: #dde3ea;
    --text-primary: #1f1f1f;
    --text-secondary: #444746;
    --text-tertiary: #0b57d0; /* Blue accent */
    --msg-user-bg: #e1e3e1;
    
    /* Gradients (Bright version) */
    --gradient-hello: linear-gradient(74deg, #4285f4 0, #9b72cb 9%, #d96570 20%, #d96570 24%, #9b72cb 35%, #4285f4 44%, #9b72cb 50%, #d96570 56%, #ffffff 75%, #ffffff 100%);
}

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

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

/* --- Layout --- */
.gemini-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* --- Top Navigation --- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    height: 64px;
    flex-shrink: 0;
    position: relative; /* Base for centering */
}

.nav-left {
    display: flex;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
}

.brand-logo img {
    max-height: 24px;
    width: auto;
}

.brand-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
    
    /* Center it absolutely in the header */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.brand-title:hover {
    background-color: var(--gemini-surface);
}

.caret {
    fill: var(--text-secondary);
    margin-left: 2px;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    fill: var(--text-primary);
    color: var(--text-primary);
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: var(--gemini-surface);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #5c6bc0;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* --- Main Content area --- */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.chat-container {
    width: 100%;
    max-width: 850px; /* Gemini max-width is quite wide */
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

/* --- Chat Feed --- */
.chat-feed {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
}

.chat-feed:not(.active) {
    overflow: hidden; /* Prevent scrolling during initial centered state */
}

/* --- Greeting Screen --- */
.greeting-screen {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 820px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
    z-index: 10;
}

.greeting-title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 500;
    letter-spacing: -0.5px;
    line-height: 1.2;
    color: #1f1f1f;
}

.greeting-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 400;
    color: #1f1f1f;
    margin-bottom: 8px;
}

.sam-sparkle {
    width: 32px;
    height: 32px;
}

.gradient-text {
    background: var(--gradient-hello);
    background-size: 200% auto;
    color: #fff;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 6s ease-in-out infinite alternate;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.sub-greeting {
    color: #c4c7c5;
}

@media (prefers-color-scheme: dark) {
    /* Optional: keep user preferences if they have dark mode forced, 
       but for this request we are forcing 'Bright' */
}

/* --- Messages --- */
.message {
    margin-top: 32px;
    display: flex;
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

/* User Message */
.user-message {
    justify-content: flex-end;
}

.user-bubble {
    background-color: var(--msg-user-bg);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 16px;
    line-height: 1.5;
    max-width: 80%;
    word-wrap: break-word;
}

/* Assistant Message */
.assistant-message {
    justify-content: flex-start;
    align-items: flex-start;
    gap: 16px;
}

.sam-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2px;
    background: white; /* Give vector a white background if needed, or transparent */
}

.sam-avatar img {
    border-radius: 50%;
    width: 100%;
    height: 100%;
}

.assistant-content {
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
    max-width: calc(100% - 48px);
    width: 100%;
}

.assistant-content p {
    margin-bottom: 1em;
}

.assistant-content pre {
    background-color: #f7f9fb;
    border: 1px solid var(--gemini-border);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    overflow-x: auto;
}

.assistant-content code {
    font-family: 'Roboto Mono', ui-monospace, monospace;
    font-size: 14px;
}

/* --- Generation Stats (Now clean and small) --- */
.generation-stats-wrapper {
    margin-top: 8px;
    display: flex;
    width: 100%;
}

.generation-stats {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.7;
}

.stat-item {
    display: flex;
    align-items: center;
}

.stat-divider {
    color: var(--gemini-border);
}

.stat-value {
    color: var(--text-primary);
    font-weight: 500;
    margin-right: 4px;
}


.input-area-wrapper {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), 
                position 0.6s ease;
}

/* Centered state for initial screen */
.input-area-wrapper.centered {
    position: absolute;
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%); /* Dead center alignment */
    background: transparent;
    z-index: 20;
}

/* Bottom state for active chat */
.input-area-wrapper.at-bottom {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    background: linear-gradient(to top, var(--gemini-bg) 80%, transparent);
    padding: 24px 16px 4px; /* Reduced bottom padding since disclaimer has margin */
    z-index: 100;
}

.input-area-wrapper.at-bottom .input-box {
    max-width: 820px;
}

.input-box {
    width: 100%;
    max-width: 820px;
    min-height: 140px; /* Increased height as requested */
    background-color: var(--gemini-surface);
    border-radius: 32px; /* More rounded */
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    transition: background-color 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.input-box:focus-within {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    border-color: var(--gemini-border);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    resize: none;
    outline: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    width: 100%;
}

.send-btn-container {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.send-btn {
    width: 40px;
    height: 40px;
    background-color: transparent;
    border-radius: 50%;
    margin-bottom: -10px; /* Slight adjustment for better look */
    fill: var(--text-tertiary); /* Use the primary icon color */
}

.send-btn svg {
    fill: currentColor;
}

#chat-input::placeholder {
    color: var(--text-secondary);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

/* Styles for send-btn are now merged into .send-btn-container and .send-btn above */

.send-btn:disabled {
    opacity: 0.3;
    cursor: default;
}
.send-btn:disabled:hover {
    background-color: transparent;
}

.disclaimer {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 16px;
    margin-bottom: 8px;
    width: 100%;
    max-width: 820px;
    z-index: 200;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.thinking-indicator {
    font-style: italic;
    color: var(--text-secondary);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
