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

:root {
--primary-color: #007AFF;
--secondary-color: #5856D6;
--background: #FFFFFF;
--surface: #F5F5F7;
--text-primary: #1D1D1F;
--text-secondary: #86868B;
--border: #D2D2D7;
--user-message: #007AFF;
--assistant-message: #F5F5F7;
--shadow: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
:root {
--background: #000000;
--surface: #1C1C1E;
--text-primary: #F5F5F7;
--text-secondary: #98989D;
--border: #38383A;
--assistant-message: #1C1C1E;
--shadow: rgba(0, 0, 0, 0.3);
}
}

body {
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
background: var(--background);
color: var(--text-primary);
line-height: 1.6;
overflow: hidden;
}

.container {
max-width: 100vw;
height: 100vh;
display: flex;
flex-direction: column;
}

header {
background: var(--surface);
border-bottom: 1px solid var(--border);
padding: 1rem 2rem;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
}

.header-content {
max-width: 900px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}

.logo {
display: flex;
align-items: center;
gap: 0.75rem;
}

.logo svg {
color: var(--primary-color);
}

.logo h1 {
font-size: 1.5rem;
font-weight: 600;
letter-spacing: -0.5px;
}

.built-with {
color: var(--text-secondary);
text-decoration: none;
font-size: 0.875rem;
transition: color 0.2s;
}

.built-with:hover {
color: var(--primary-color);
}

.chat-container {
flex: 1;
position: relative;
overflow: hidden;
}

.loading-screen {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
background: var(--background);
z-index: 10;
}

.loading-content {
text-align: center;
max-width: 400px;
padding: 2rem;
}

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

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

.loading-content h2 {
font-size: 1.5rem;
margin-bottom: 0.5rem;
font-weight: 600;
}

.loading-content p {
color: var(--text-secondary);
margin-bottom: 1.5rem;
}

.progress-bar {
width: 100%;
height: 6px;
background: var(--border);
border-radius: 3px;
overflow: hidden;
margin-bottom: 0.5rem;
}

.progress-fill {
height: 100%;
background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
border-radius: 3px;
transition: width 0.3s ease;
width: 0%;
}

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

.chat-interface {
height: 100%;
display: flex;
flex-direction: column;
}

.messages-container {
flex: 1;
overflow-y: auto;
padding: 2rem;
scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar {
width: 8px;
}

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

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

.welcome-message {
max-width: 600px;
margin: 4rem auto;
text-align: center;
}

.welcome-message h2 {
font-size: 2rem;
margin-bottom: 0.5rem;
font-weight: 600;
}

.welcome-message p {
color: var(--text-secondary);
margin-bottom: 2rem;
}

.suggestions {
display: flex;
flex-wrap: wrap;
gap: 0.75rem;
justify-content: center;
}

.suggestion-btn {
background: var(--surface);
border: 1px solid var(--border);
padding: 0.75rem 1.25rem;
border-radius: 20px;
cursor: pointer;
font-size: 0.875rem;
color: var(--text-primary);
transition: all 0.2s;
}

.suggestion-btn:hover {
background: var(--primary-color);
color: white;
border-color: var(--primary-color);
transform: translateY(-2px);
}

.message {
max-width: 700px;
margin: 0 auto 1.5rem;
display: flex;
gap: 1rem;
animation: fadeIn 0.3s ease;
}

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

.message-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
font-size: 1.25rem;
}

.user-message .message-avatar {
background: var(--user-message);
}

.assistant-message .message-avatar {
background: var(--assistant-message);
border: 1px solid var(--border);
}

.message-content {
flex: 1;
padding: 1rem 1.25rem;
border-radius: 18px;
line-height: 1.6;
}

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

.assistant-message .message-content {
background: var(--assistant-message);
border: 1px solid var(--border);
}

.typing-indicator {
display: inline-flex;
gap: 4px;
padding: 0.5rem 0;
}

.typing-indicator span {
width: 8px;
height: 8px;
background: var(--text-secondary);
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% {
opacity: 0.3;
transform: translateY(0);
}
30% {
opacity: 1;
transform: translateY(-8px);
}
}

.input-container {
padding: 1.5rem 2rem;
background: var(--background);
border-top: 1px solid var(--border);
}

.input-wrapper {
max-width: 700px;
margin: 0 auto;
display: flex;
gap: 0.75rem;
align-items: flex-end;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 24px;
padding: 0.75rem 1rem;
transition: border-color 0.2s;
}

.input-wrapper:focus-within {
border-color: var(--primary-color);
}

#userInput {
flex: 1;
border: none;
background: transparent;
color: var(--text-primary);
font-size: 1rem;
font-family: inherit;
resize: none;
outline: none;
max-height: 120px;
}

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

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

.send-button:hover:not(:disabled) {
transform: scale(1.05);
box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.send-button:disabled {
opacity: 0.4;
cursor: not-allowed;
}

@media (max-width: 768px) {
header {
padding: 1rem;
}

.messages-container {
padding: 1rem;
}

.input-container {
padding: 1rem;
}

.welcome-message {
margin: 2rem auto;
}

.welcome-message h2 {
font-size: 1.5rem;
}
}