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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    height: 100vh;
    overflow: hidden;
}

/* Container */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: white;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.tagline {
    font-size: 14px;
    opacity: 0.9;
}

.status-badge {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 20px;
    padding: 20px;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.welcome-message h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #667eea;
}

.quick-genes {
    margin-top: 20px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.gene-tag {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.gene-tag:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

/* Chat Messages */
.message {
    margin-bottom: 16px;
    animation: slideIn 0.3s ease-out;
}

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

.message.user {
    display: flex;
    justify-content: flex-end;
}

.message.assistant {
    display: flex;
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
}

.user .message-content {
    background: #667eea;
    color: white;
    border-radius: 12px 0 12px 12px;
}

.assistant .message-content {
    background: #f0f0f0;
    color: #333;
    border-radius: 0 12px 12px 12px;
}

.assistant .message-content a {
    color: #667eea;
    text-decoration: none;
}

.assistant .message-content a:hover {
    text-decoration: underline;
}

/* Input Area */
.input-area {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
}

.question-form {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

#questionInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

#questionInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loader {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}

.submit-btn.loading .loader {
    display: block;
}

.submit-btn.loading span:first-child {
    display: none;
}

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

.char-count {
    font-size: 12px;
    color: #999;
    text-align: right;
}

/* Sidebar */
.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.panel {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.panel h3 {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 12px;
}

/* Examples List */
.examples-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.example-item {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
    line-height: 1.4;
}

.example-item:hover {
    background: #667eea;
    color: white;
    transform: translateX(4px);
}

.example-category {
    font-weight: 600;
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 4px;
}

/* Genes List */
.genes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gene-item {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 12px;
}

.gene-item:hover {
    background: #667eea;
    color: white;
    transform: translateX(4px);
}

.gene-symbol {
    font-weight: 600;
}

.gene-info {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
}

/* Info List */
.info-list {
    list-style: none;
    font-size: 12px;
    line-height: 1.8;
    color: #666;
}

.info-list li {
    padding: 4px 0;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Error Message */
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        padding: 10px;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }

    .panel {
        flex: 0 0 250px;
    }

    .message-content {
        max-width: 90%;
    }
}
