:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --error: #ef4444;
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--surface-light);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--primary);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.service-panel {
    display: none;
    background: var(--surface);
    padding: 30px;
    border-radius: 16px;
    animation: fadeIn 0.3s ease;
}

.service-panel.active {
    display: block;
}

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

.service-panel h2 {
    margin-bottom: 20px;
    color: var(--primary);
}

/* Chat styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-messages {
    flex: 1;
    background: var(--bg);
    border-radius: 12px;
    padding: 20px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.message.user {
    background: var(--primary);
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message.ai {
    background: var(--surface-light);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.message .time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 5px;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.chat-input-area input:focus {
    outline: 2px solid var(--primary);
}

/* Form elements */
textarea, select, input[type="text"] {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 15px;
    font-family: inherit;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

textarea:focus, select:focus, input:focus {
    outline: 2px solid var(--primary);
}

select {
    cursor: pointer;
}

button {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Result boxes */
.result-box {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg);
    border-radius: 12px;
    min-height: 100px;
    white-space: pre-wrap;
}

.result-box code {
    background: var(--surface-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
}

.result-box pre {
    background: var(--surface-light);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}

/* Loading spinner */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--surface-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    margin-top: 15px;
    color: var(--text-muted);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 100%;
    }
    
    .service-panel {
        padding: 20px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
