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

html {
    overflow-x: hidden;
    max-width: 100vw;
}

:root {
    --primary-color: #191918;
    --accent-coral: #cc6b5a;
    --accent-purple: #6b5b95;
    --background: #f4f1ea;
    --background-alt: #f9f7f4;
    --surface: #ffffff;
    --text-primary: #191918;
    --text-secondary: #5a5a5a;
    --text-muted: #8a8a8a;
    --border: #e0ddd4;
    --border-light: #f0ede4;
    --error: #cc6b5a;
    --success: #6b9c7a;
    --shadow-sm: 0 1px 2px rgba(25, 25, 24, 0.05);
    --shadow-md: 0 4px 12px rgba(25, 25, 24, 0.08);
    --shadow-lg: 0 12px 40px rgba(25, 25, 24, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.65;
    height: 100vh;
    overflow: hidden;
    overflow-x: hidden; /* Prevent horizontal scroll */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    max-width: 100vw; /* Ensure body doesn't exceed viewport width */
}

.container {
    width: 100%;
    min-height: 100vh;
    max-width: 100vw; /* Prevent horizontal overflow */
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

.screen {
    display: none;
    width: 100%;
    height: 100vh;
    max-width: 1200px;
    overflow-y: auto;
    overflow-x: hidden;
}

.screen.active {
    display: block;
}

/* Ensure screens don't overlap */
#chat-screen {
    max-width: 100%;
}

/* Onboarding Screen */
#onboarding-screen {
    padding: 20px 0;
}

.card {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    max-width: 580px;
    margin: 10px auto 40px auto;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent-coral);
}

.header {
    margin-bottom: 8px;
}

.header h1 {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--primary-color);
    margin-bottom: 4px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.3;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: -0.01em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 3px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-coral);
    box-shadow: 0 0 0 3px rgba(204, 107, 90, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.time-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.time-input-group input[type="number"] {
    width: 90px;
    text-align: center;
}

.time-input-group select {
    width: 110px;
}

.separator {
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-weight: 300;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.btn-primary {
    width: 100%;
    background: var(--accent-coral);
    color: var(--surface);
    margin-top: 12px;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: #b85a4a;
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Keep sign-in buttons black */
#login-btn {
    background: var(--primary-color) !important;
}

#login-btn:hover:not(:disabled) {
    background: #000000 !important;
}

.btn-google {
    width: 100%;
    background: white;
    color: #1f1f1f;
    border: 1px solid #dadce0;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.btn-google:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #dadce0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-google svg {
    flex-shrink: 0;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-secondary);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 12px;
    font-size: 14px;
}

.btn-secondary {
    background: transparent;
    color: var(--accent-coral);
    border: 1.5px solid var(--accent-coral);
    padding: 12px 20px;
}

.btn-secondary:hover {
    background: rgba(204, 107, 90, 0.1);
    border-color: var(--accent-coral);
    color: var(--primary-color);
}

.btn-google {
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #c4c7c5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-google svg {
    flex-shrink: 0;
}

.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 16px;
    background: var(--background);
    z-index: 1;
}

.loading {
    text-align: center;
    padding: 50px 20px;
}

.loading.hidden,
.error-message.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.error-message {
    background: rgba(204, 107, 90, 0.08);
    border: 1.5px solid var(--error);
    color: var(--error);
    padding: 16px 20px;
    border-radius: 3px;
    margin-top: 20px;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Chat Screen */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--background);
    border-radius: 0;
    overflow: hidden;
}

.chat-header {
    margin: 10px 10px 0 10px;
    padding: 6px 12px;
    background: var(--surface);
    border-radius: 20px !important;
    -webkit-border-radius: 20px !important;
    -moz-border-radius: 20px !important;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    min-height: 40px;
    transition: all 0.3s ease;
}

.header-top-bar {
    display: none; /* Hidden by default, shown on mobile */
    align-items: center;
    gap: 12px;
    width: 100%;
}

.header-compact-info {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    transition: all 0.3s ease;
}

/* When collapsed, hide the full content */
.chat-header.collapsed .header-content {
    display: none;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
}

.welcome-icon {
    font-size: 1.5rem;
    color: var(--accent-coral);
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.user-info h2 {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    color: var(--primary-color);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.birth-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-info {
    display: flex;
    gap: 24px;
    padding-left: 24px;
    border-left: 1px solid var(--border);
    align-items: center;
    flex-wrap: wrap;
}

.chart-info-item {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-size: 0.875rem;
}

.chart-info-item:not(:last-child)::after {
    content: '|';
    color: var(--border);
    margin-left: 16px;
    font-weight: 300;
}

.chart-info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    white-space: nowrap;
}

.chart-info-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent-coral);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* Simple animations for chart info appearance */
.chart-info-item {
    animation: fadeIn 0.4s ease-out;
}

.chart-info-item:nth-child(2) {
    animation-delay: 0.1s;
}

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

.chat-layout {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    min-height: 0; /* Ensure flex children can shrink */
    position: relative;
}

.chat-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    order: 2;
    min-width: 0; /* Allow flex item to shrink below content size */
    transition: margin-left 0.3s ease;
    position: relative; /* Ensure proper stacking context for sticky children */
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.message {
    display: flex;
    gap: 20px;
    animation: slideIn 0.3s ease;
    width: 100%;
}

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

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    font-weight: 500;
}

.message.assistant .message-avatar {
    background: var(--accent-coral);
    border-color: var(--accent-coral);
    color: var(--surface);
}

.message.user .message-avatar {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--surface);
}

.message-content {
    flex: 1;
    padding: 0;
    line-height: 1.7;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.message.user .message-content {
    background: var(--surface);
    padding: 14px 18px;
    border-radius: 24px;
    border: 1px solid var(--border);
    max-width: 70%;
}

.message-content p {
    margin-bottom: 12px;
}

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

/* Markdown Support Styles */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin: 16px 0 8px 0;
    font-weight: 600;
    color: var(--primary-color);
}

.message-content h1 { font-size: 1.5rem; }
.message-content h2 { font-size: 1.3rem; }
.message-content h3 { font-size: 1.2rem; }
.message-content h4 { font-size: 1.1rem; }
.message-content h5 { font-size: 1.05rem; }
.message-content h6 { font-size: 1rem; }

.message-content h1:first-child,
.message-content h2:first-child,
.message-content h3:first-child,
.message-content h4:first-child,
.message-content h5:first-child,
.message-content h6:first-child {
    margin-top: 0;
}

.message-content strong {
    font-weight: 600;
    color: var(--primary-color);
}

.message-content em {
    font-style: italic;
    color: var(--text-secondary);
}

.message-content code {
    background: var(--border-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent-coral);
}

.message-content pre {
    background: var(--border-light);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
    border-left: 3px solid var(--accent-coral);
}

.message-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.message-content blockquote {
    border-left: 3px solid var(--accent-coral);
    padding-left: 12px;
    margin: 12px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.message-content ul,
.message-content ol {
    margin: 12px 0;
    padding-left: 20px;
}

.message-content ul li,
.message-content ol li {
    margin: 4px 0;
    line-height: 1.6;
}

.message-content ul {
    list-style-type: disc;
}

.message-content ol {
    list-style-type: decimal;
}

.message-content a {
    color: var(--accent-coral);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s ease;
}

.message-content a:hover {
    border-bottom-color: var(--accent-coral);
}

.message-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.message-content th,
.message-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
}

.message-content th {
    background: var(--border-light);
    font-weight: 600;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 16px 20px;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Single Loading Text Container */
.loading-container-single {
    padding: 20px;
}

.loading-text-with-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.loading-text-with-dots .step-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.loading-text-with-dots .step-text strong {
    color: var(--accent-coral);
    font-weight: 700;
    font-style: italic;
}

.loading-text-with-dots .typing-indicator {
    display: flex;
    gap: 3px;
    padding: 0;
    align-items: center;
}

.chat-input-section {
    padding: 16px;
    background: var(--background);
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    flex-shrink: 0; /* Prevent input from being compressed */
    order: 3; /* Ensure it comes after messages */
}

.suggested-questions {
    margin-bottom: 16px;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.suggestions-grid .suggestion-btn {
    padding: 16px 20px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 24px !important;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-weight: 400;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    box-sizing: border-box;
    -webkit-border-radius: 24px;
    -moz-border-radius: 24px;
    box-shadow: var(--shadow-sm);
    min-height: 60px;
}

.suggestion-btn {
    padding: 16px 20px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 24px !important;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-weight: 400;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    min-height: 60px;
}

.suggestion-btn svg {
    flex-shrink: 0;
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
}

.suggestion-btn:hover {
    background: var(--background-alt);
    border-color: var(--accent-coral);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.suggestion-btn:hover svg {
    color: var(--accent-coral);
}

.chat-input-container {
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 40px !important;
    padding: 4px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 3px rgba(25, 25, 24, 0.03);
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    resize: none;
    max-height: 200px;
    font-family: inherit;
    line-height: 1.6;
    outline: none;
}

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

.send-btn {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: #000000;
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Scroll to bottom button */
.scroll-to-bottom {
    position: absolute;
    bottom: 100px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--accent-coral);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.scroll-to-bottom.visible {
    opacity: 1;
    transform: scale(1);
}

.scroll-to-bottom:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

.scroll-to-bottom:active {
    transform: scale(0.95);
}

/* Conversation Sidebar */
.conversation-sidebar {
    position: relative;
    width: 350px;
    min-width: 350px;
    max-width: 350px;
    height: calc(100% - 20px);
    max-height: calc(100% - 20px);
    background: var(--surface);
    border-right: 1px solid var(--border);
    border-radius: 20px !important;
    -webkit-border-radius: 20px !important;
    -moz-border-radius: 20px !important;
    margin: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.3s ease, margin-left 0.3s ease, margin-right 0.3s ease;
    order: 1;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.conversation-sidebar.collapsed {
    position: absolute;
    left: -370px;
    width: 350px;
    height: calc(100% - 20px);
    margin: 10px;
    overflow: hidden;
}

.sidebar-toggle {
    position: fixed;
    left: 370px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 72px;
    background: var(--surface);
    border: 2px solid var(--accent-coral);
    border-left: none;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-coral);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.sidebar-toggle:hover {
    background: var(--accent-coral);
    color: var(--surface);
    border-color: var(--accent-coral);
    transform: translateY(-50%) scale(1.1);
}

.conversation-sidebar.collapsed .sidebar-toggle {
    left: 20px;
    transform: translateY(-50%);
    border-radius: 12px 0 0 12px;
    border-left: 2px solid var(--accent-coral);
    border-right: none;
}

.conversation-sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar-toggle svg {
    transition: transform 0.3s ease;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.questions-section {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    min-height: 150px;
    max-height: 50%;
    transition: all 0.3s ease;
}

.questions-section.collapsed {
    flex: 0 0 auto;
    min-height: auto;
    max-height: none;
}

.questions-section.collapsed .questions-map {
    display: none;
}

.conversations-section {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 150px;
    max-height: 100%;
    transition: all 0.3s ease;
}

.conversations-section.collapsed {
    flex: 0 0 auto;
    min-height: auto;
    max-height: none;
}

.conversations-section.collapsed .conversation-list {
    display: none;
}

.conversation-sidebar.collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
}

/* Chat expands naturally when sidebar is positioned absolute and off-screen */
.chat-layout.sidebar-collapsed .chat-content-wrapper {
    margin-left: 0;
}

.chat-layout.sidebar-collapsed .sidebar-toggle {
    position: fixed;
    left: 20px;
}

.sidebar-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-header:hover {
    background: var(--background-alt);
}

.sidebar-header .collapse-toggle {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    color: var(--accent-coral);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.sidebar-header.collapsed .collapse-toggle {
    transform: rotate(-90deg);
}

.sidebar-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    flex: 1;
    text-align: center;
}

.new-conversation-btn {
    background: var(--accent-coral);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    box-shadow: var(--shadow-sm);
}

.new-conversation-btn:hover {
    background: var(--accent-coral);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.new-conversation-btn:active {
    transform: scale(0.95);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 8px 16px 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* Custom scrollbar for webkit browsers */
.conversation-list::-webkit-scrollbar {
    width: 4px;
}

.conversation-list::-webkit-scrollbar-track {
    background: transparent;
}

.conversation-list::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 2px;
}

.conversation-list::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* Force rounded corners with highest specificity and override inline styles */
.conversation-item,
div.conversation-item,
.conversation-item[style],
div.conversation-item[style] {
    padding: 12px 12px;
    border-radius: 20px !important;
    -webkit-border-radius: 20px !important;
    -moz-border-radius: 20px !important;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    position: relative;
}

.conversation-item:hover {
    background: var(--background);
    border-color: var(--border);
}

.conversation-item.active {
    background: var(--background);
    border-color: var(--primary-color);
}

.conversation-preview {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.conversation-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Chart History Styles */
.history-separator {
    padding: 16px 12px 8px;
    margin: 8px 0;
    border-top: 1px solid var(--border);
    position: relative;
}

.history-separator span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--surface);
    padding-right: 8px;
}

.conversation-item.chart-history {
    background: white;
    border-color: var(--border-light);
}

.conversation-item.chart-history:hover {
    background: var(--background);
    border-color: var(--accent-coral);
}

.conversation-item.chart-history .conversation-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.conversation-item.current-session {
    background: rgba(204, 107, 90, 0.08);
    border-color: var(--accent-coral);
    border-width: 2px;
    border-left-width: 4px;
    box-shadow: 0 2px 8px rgba(204, 107, 90, 0.12);
}

.conversation-item.current-session:hover {
    background: rgba(204, 107, 90, 0.12);
    border-color: var(--accent-coral);
    transform: translateX(2px);
}

.conversation-item.current-session .conversation-info strong {
    color: var(--accent-coral);
    font-weight: 700;
}

.conversation-item.current-session .chart-session-info,
.conversation-item.current-session .conversation-count,
.conversation-item.current-session .conversation-time {
    color: var(--text-secondary);
}

.conversation-item.current-session .conversation-expand-icon path {
    stroke: var(--accent-coral);
}

.conversation-item.current-session .delete-conversation-btn {
    color: var(--text-muted);
    border-color: var(--border);
}

.conversation-item.current-session .delete-conversation-btn:hover {
    background: rgba(204, 107, 90, 0.1);
    border-color: var(--accent-coral);
    color: var(--accent-coral);
}

.conversation-item.current-session .timeline-number {
    background: var(--accent-coral);
    color: white;
}

.conversation-item.current-session .timeline-question-item .question-text {
    color: var(--text-primary);
}

.chart-session-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.delete-conversation-btn {
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px;
    border-radius: 12px !important;
    -webkit-border-radius: 12px !important;
    -moz-border-radius: 12px !important;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 12px;
    top: 12px;
    width: 30px;
    height: 30px;
    z-index: 10;
}

.conversation-item:hover .delete-conversation-btn {
    opacity: 0.8;
    border-color: var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.delete-conversation-btn:hover {
    opacity: 1;
    background: var(--background-alt);
    border-color: var(--accent-coral);
    color: var(--accent-coral);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.delete-conversation-btn:active {
    transform: scale(0.95);
    background: rgba(204, 107, 90, 0.2);
}

.delete-conversation-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 1.5;
}

.conversation-item .conversation-time {
    margin: 4px 0 0 0;
    padding-right: 44px; /* Make space for the delete button */
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Conversation Wrapper - Main Layout */
.conversation-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.conversation-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    cursor: pointer;
    width: 100%;
    position: relative;
}

.conversation-info {
    flex: 1;
}

.conversation-expand-icon {
    transition: transform 0.2s ease;
    flex-shrink: 0;
    color: var(--accent-coral);
}

.conversation-expand-icon path {
    stroke: var(--accent-coral);
}

/* Questions Timeline - Vertical Line with Numbered Circles */
.conversation-questions-timeline {
    margin-top: 12px;
    padding: 8px 12px 12px 12px;
    position: relative;
}

.timeline-question-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 28px;
    cursor: pointer;
    position: relative;
}

.timeline-question-item:last-child {
    margin-bottom: 0;
}

.timeline-question-item:last-child::after {
    display: none;
}

/* Vertical connecting line between circles */
.timeline-question-item::after {
    content: '';
    position: absolute;
    left: 12px;
    top: 24px;
    width: 1.5px;
    height: calc(100% + 4px);
    background: var(--accent-coral);
}

.timeline-number {
    width: 24px;
    height: 24px;
    background: var(--accent-coral);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(204, 107, 90, 0.3);
}

.timeline-question-item:hover .timeline-number {
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(204, 107, 90, 0.4);
}

.timeline-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 1px;
}

.timeline-question-item .question-text {
    font-size: 0.75rem;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.2s ease;
}

.timeline-question-item:hover .question-text {
    color: var(--accent-coral);
    font-weight: 500;
}

.timeline-question-item .question-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Questions Map Styles */
.questions-map {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 8px 16px 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.questions-map::-webkit-scrollbar {
    width: 4px;
}

.questions-map::-webkit-scrollbar-track {
    background: transparent;
}

.questions-map::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 2px;
}

.questions-map::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* Force rounded corners with highest specificity and override inline styles */
.question-item,
div.question-item,
.question-item[style],
div.question-item[style] {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    border-radius: 20px !important;
    -webkit-border-radius: 20px !important;
    -moz-border-radius: 20px !important;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: var(--border-light);
}

/* Override any inline border-radius styles */
.conversation-sidebar [style*="border-radius"],
.conversation-sidebar [style*="borderRadius"] {
    border-radius: 20px !important;
    -webkit-border-radius: 20px !important;
    -moz-border-radius: 20px !important;
}

/* Force style recalculation for conversation items */
.conversation-item {
    animation: forceRoundedCorners 0.1s ease-in-out;
}

.question-item {
    animation: forceRoundedCorners 0.1s ease-in-out;
}

@keyframes forceRoundedCorners {
    from { 
        border-radius: 20px !important;
    }
    to { 
        border-radius: 20px !important;
    }
}

.question-item:hover {
    background: var(--background);
    border-color: var(--accent-coral);
    transform: translateX(2px);
}

.question-number {
    background: var(--accent-coral);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.question-text {
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
}

.question-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 2px;
}

.no-questions {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

/* Highlighted message animation */
.message.highlighted {
    background: linear-gradient(90deg, 
        rgba(204, 107, 90, 0.1) 0%, 
        rgba(204, 107, 90, 0.05) 50%, 
        transparent 100%);
    border-left: 3px solid var(--accent-coral);
    animation: highlightPulse 2s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% { 
        background: linear-gradient(90deg, 
            rgba(204, 107, 90, 0.1) 0%, 
            rgba(204, 107, 90, 0.05) 50%, 
            transparent 100%);
    }
    50% { 
        background: linear-gradient(90deg, 
            rgba(204, 107, 90, 0.2) 0%, 
            rgba(204, 107, 90, 0.1) 50%, 
            transparent 100%);
    }
}

/* Responsive Design - Tablet screens */
@media (max-width: 1024px) {
    /* Make sidebar slide in from left on tablet and mobile */
    .conversation-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 100;
        width: 75%;
        max-width: 280px;
        min-width: 260px;
        margin: 0;
        border-radius: 0 20px 20px 0 !important;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease;
        /* Default hidden - will be overridden by :not(.collapsed) when expanded */
        transform: translateX(-100%);
    }

    /* When explicitly marked as expanded (remove collapsed class) */
    .conversation-sidebar:not(.collapsed) {
        transform: translateX(0) !important;
    }

    /* When explicitly marked as collapsed (add collapsed class) */
    .conversation-sidebar.collapsed {
        transform: translateX(-100%) !important;
    }

    /* Toggle button when moved outside sidebar (by JavaScript on mobile) */
    body > .sidebar-toggle,
    .chat-screen > .sidebar-toggle {
        position: fixed !important;
        left: 10px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 1001 !important;
        display: flex !important;
    }

    /* When sidebar is expanded and toggle is outside, move it to sidebar edge */
    .conversation-sidebar:not(.collapsed) ~ .sidebar-toggle {
        left: calc(85% - 30px) !important;
    }

    /* Toggle button styling when inside sidebar */
    .conversation-sidebar .sidebar-toggle {
        display: flex !important;
        position: absolute !important;
        z-index: 1001 !important;
        left: auto !important;
        right: -36px !important;
        transform: translateY(-50%) !important;
    }
}

/* Additional mobile-specific adjustments */
@media (max-width: 768px) {
    .conversation-sidebar {
        width: 75%;
        max-width: 280px;
        min-width: 260px;
        font-size: 13px;
    }

    /* Ensure profile/logout section is visible */
    .profile-section {
        padding: 10px 12px;
    }

    /* Adjust conversation item padding */
    .conversation-item {
        padding: 10px;
        font-size: 13px;
    }

    /* Make header info more compact */
    .user-info {
        min-width: 0; /* Remove min-width on mobile to prevent overflow */
        flex-shrink: 1;
    }

    .user-info h2 {
        font-size: 0.85rem;
    }

    .birth-info {
        font-size: 0.7rem;
    }

    /* Profile button adjustments for mobile - more compact */
    .profile-btn {
        padding: 10px 14px 10px 10px;
        font-size: 0.85rem;
        gap: 10px;
        min-width: auto;
        width: 90%;
        margin: 0 auto;
    }

    .profile-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    /* Make profile container fit properly */
    .profile-container {
        bottom: 16px;
        padding: 0 8px;
    }

    /* Dropdown positioning for mobile */
    .dropdown-menu {
        bottom: 60px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 90%;
        max-width: 200px;
    }

    /* Sidebar header compact on mobile */
    .sidebar-header h2 {
        font-size: 1rem;
    }

    /* Ensure sidebar content doesn't overflow on Chrome mobile */
    .conversation-sidebar {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Proper scrolling hierarchy for mobile */
    .sidebar-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
    }

    .conversations-section {
        flex: 1 1 auto;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        min-height: 0; /* Allow flex child to shrink */
    }

    /* Ensure conversations list has proper scrolling */
    .conversation-list {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 100px; /* Space for profile button */
    }

    /* Card adjustments for mobile */
    .card {
        padding: 24px 16px;
        margin: 10px;
        border-radius: 16px !important;
    }

    .header h1 {
        font-size: 1.1rem;
    }

    /* Full screen chat on mobile */
    .chat-container {
        border-radius: 0;
        height: 100vh;
        height: 100dvh; /* Use dynamic viewport height for mobile Chrome */
        display: flex;
        flex-direction: column;
        max-width: 100vw; /* Prevent horizontal overflow */
        overflow-x: hidden;
    }

    .chat-layout {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Prevent all screens from horizontal scrolling */
    .screen {
        max-width: 100vw;
        overflow-x: hidden;
    }

    .chat-header {
        padding: 8px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .header-left {
        max-width: 100%;
        overflow: hidden;
    }

    /* Show collapsible header on mobile */
    .header-top-bar {
        display: flex !important;
    }

    /* Start collapsed on mobile by default */
    .chat-header.collapsed {
        padding: 8px 12px;
        gap: 0;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .chart-info {
        gap: 16px;
        padding-left: 16px;
        flex-wrap: wrap;
        max-width: 100%;
        overflow: hidden;
    }

    .chart-info-item {
        font-size: 0.8125rem;
    }

    .chart-info-item:not(:last-child)::after {
        margin-left: 12px;
    }

    .chart-info-label {
        font-size: 0.6875rem;
    }

    .chart-info-value {
        font-size: 0.75rem;
    }

    .chat-messages {
        padding: 24px 16px;
        /* Chrome mobile scrolling fixes */
        -webkit-overflow-scrolling: touch;
        overflow-y: scroll;
        flex: 1 1 auto;
        min-height: 0;
    }

    .message {
        gap: 12px;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .suggestions-grid {
        grid-template-columns: 1fr;
    }

    .time-input-group input[type="number"] {
        width: 75px;
    }

    .chat-input-section {
        padding: 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        background: var(--surface);
        position: sticky;
        bottom: 0;
        z-index: 50;
        /* Chrome mobile specific fixes */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
        min-height: 80px;
    }

    /* Ensure chat content wrapper accounts for input section */
    .chat-content-wrapper {
        padding-bottom: 0;
        /* Chrome mobile flex fix */
        min-height: 0;
    }

    /* Make sure input is always visible on mobile */
    .chat-input-container {
        width: 100%;
    }

    /* Reduce input padding on very small screens */
    #chat-input {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

/* Input number arrows removal */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
}

.modal-container {
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent-coral);
    box-shadow: var(--shadow-lg);
    max-width: 580px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-overlay.hidden .modal-container {
    transform: translateY(-20px);
    opacity: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--primary-color);
    margin: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(204, 107, 90, 0.1);
    color: var(--accent-coral);
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* Custom scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

.modal-card {
    padding: 24px;
}

.modal-form-header {
    margin-bottom: 20px;
    text-align: center;
}

.modal-form-header h3 {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1.2;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
}

.modal-form .form-group {
    margin-bottom: 16px;
}

.modal-form .form-group:last-of-type {
    margin-bottom: 20px;
}

/* Modal error message styling */
.modal-card .error-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(204, 107, 90, 0.08);
    border: 1px solid var(--error);
    border-radius: 8px;
    color: var(--error);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Modal loading indicator styling */
.modal-card .loading {
    text-align: center;
    padding: 20px;
    margin-top: 16px;
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-container {
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 16px 20px;
    }
    
    .modal-card {
        padding: 20px;
    }
}

/* Selection color */
::selection {
    background: rgba(204, 107, 90, 0.2);
    color: var(--primary-color);
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Auth Screens Styling */
#login-screen,
#register-screen {
    background: var(--background);
}

#login-screen .card,
#register-screen .card {
    max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent-coral);
    box-shadow: var(--shadow-md);
}

#login-screen .header h1,
#register-screen .header h1 {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

#login-screen .subtitle,
#register-screen .subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-switch {
    margin-top: 24px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.auth-switch p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-switch a {
    color: var(--accent-coral);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.auth-switch a:hover {
    color: var(--primary-color);
}

#login-error-message,
#register-error-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(204, 107, 90, 0.08);
    border: 1px solid var(--error);
    border-radius: 12px;
    color: var(--error);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Homepage Auth Section */
.auth-section {
    text-align: center;
    padding: 20px 0;
    margin: 20px 0;
}

.auth-section .auth-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
}

.auth-section .btn {
    min-width: 140px;
    padding: 12px 24px;
}

.divider {
    text-align: center;
    margin: 30px 0 25px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
}

.divider span {
    background: var(--surface);
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 0.875rem;
    position: relative;
}

/* Google Auth Section */
.google-auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    padding: 0 20px;
}

.google-auth-section > div {
    width: 100%;
    max-width: 400px;
    display: flex;
    justify-content: center;
}

/* Header Right - Auth Section */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-container {
    position: relative;
    z-index: 100;
}

/* --- Profile Card at Bottom of Sidebar (Theme Match) --- */
.profile-container {
    position: absolute;
    left: 0;
    bottom: 24px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto; /* Allow clicks on profile and dropdown */
    background: none;
    box-shadow: none;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 2px 12px 0 rgba(204,107,90,0.10);
    padding: 16px 28px 16px 18px;
    font-size: 1rem;
    pointer-events: auto;
    min-width: 220px;
    min-height: 56px;
    transition: box-shadow 0.2s;
    color: var(--text-primary);
    position: relative;
    cursor: pointer;
}

.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-coral);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.profile-name {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.08rem;
  margin-bottom: 2px;
}

.profile-email {
  color: var(--text-secondary);
  font-size: 0.98rem;
  font-weight: 400;
}

.profile-badge {
  background: #ffe066;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 1px 4px 0 rgba(0,0,0,0.10);
}

/* Dropdown menu for profile */
.dropdown-menu {
  display: none;
  position: absolute;
  bottom: 70px; /* Position above the profile button */
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 8px;
  min-width: 180px;
  z-index: 1000;
  pointer-events: auto; /* Enable clicks on dropdown */
}

.dropdown-menu.show {
  display: block !important;
  z-index: 1000;
}

.dropdown-item {
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--accent-coral);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s;
  pointer-events: auto; /* Enable clicks on logout button */
}

.dropdown-item:hover {
  background-color: var(--hover-bg, rgba(204, 107, 90, 0.1));
}

.conversation-sidebar {
  position: relative;
}

/* Back to home button */
.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 12px;
}

.back-btn:hover {
    background: var(--primary-color);
    color: var(--surface);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Home button for login/register screens */
.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.home-btn:hover {
    background: var(--primary-color);
    color: var(--surface);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Header layout with home button */
.header-with-home {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.header-content {
    flex: 1;
}

.header-content h1 {
    margin-bottom: 4px;
}

/* Google OAuth Button */
.btn-google {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    color: #3c4043;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer !important;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    pointer-events: auto !important;
    opacity: 1 !important;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #c4c7c5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-google:active {
    background: #f1f3f4;
    transform: translateY(1px);
}

.btn-google svg {
    flex-shrink: 0;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    text-align: center;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider span {
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}
