/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #f38020;
    --primary-dark: #e06d00;
    --secondary-color: #1a1a1a;
    --background: #0f0f0f;
    --surface: #1a1a1a;
    --surface-light: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --border: #333333;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

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

/* Screen management */
.screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Login Screen */
#login-screen {
    background: linear-gradient(135deg, var(--background) 0%, var(--surface) 100%);
    justify-content: center;
    align-items: center;
    position: relative;
}

#login-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23333" stroke-width="0.5" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.1;
}

.login-container {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

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

.login-form h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(243, 128, 32, 0.1);
}

.btn-primary, .btn-secondary, .btn-ghost {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    width: auto;
    padding: 0.5rem 1rem;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--surface-light);
}

.divider {
    text-align: center;
    margin: 1.5rem 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 1rem;
    color: var(--text-muted);
    position: relative;
}

/* Chat Screen */
#chat-screen {
    background: var(--background);
}

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

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

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-indicator {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator.online {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.welcome-message, .message {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

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

.bot-avatar {
    background: var(--primary-color);
}

.user-avatar {
    background: var(--surface-light);
    border: 1px solid var(--border);
}

.message-content {
    flex: 1;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    max-width: 70%;
}

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

.message-content h3 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.message-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.message.user .message-content p {
    color: rgba(255, 255, 255, 0.9);
}

.message-content pre {
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    border: 1px solid var(--border);
}

.message-content code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

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

.chat-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1rem;
}

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

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

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

.send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.send-btn:disabled {
    background: var(--surface-light);
    color: var(--text-muted);
    cursor: not-allowed;
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.dots {
    display: flex;
    gap: 2px;
}

.dots span {
    width: 4px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

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

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        margin: 1rem;
        padding: 2rem;
    }
    
    .header {
        padding: 1rem;
    }
    
    .chat-container {
        padding: 0 1rem;
    }
    
    .header-right .user-info span {
        display: none;
    }
}

/* Website deployment styles */
.deployment-message {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
    color: white !important;
    border: none !important;
}

.deployment-message p {
    color: rgba(255, 255, 255, 0.9) !important;
}

.website-preview-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
    display: inline-block;
}

.website-preview-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

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

.chat-messages::-webkit-scrollbar-track {
    background: var(--surface);
}

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

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