/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

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

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.mode-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.mode-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: rgba(255,255,255,0.9);
    color: #333;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.main-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    background: #007bff;
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.assistant {
    background: #e9ecef;
    color: #333;
    margin-right: auto;
}

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

#chatInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

#chatInput:focus {
    border-color: #007bff;
}

#sendBtn {
    padding: 15px 30px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

#sendBtn:hover {
    background: #0056b3;
}

#sendBtn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.input-section, .output-section {
    margin-bottom: 20px;
}

.input-section h3, .output-section h3 {
    margin-bottom: 10px;
    color: #495057;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease;
}

textarea:focus {
    border-color: #007bff;
}

button {
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

button:hover {
    background: #0056b3;
}

button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

#summarizeOutput, #codegenOutput {
    min-height: 150px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    white-space: pre-wrap;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.hidden {
    display: none;
}

.metrics-panel, .config-panel {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.metrics-panel h3, .config-panel h3 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 1.2rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

.metric-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
}

.config-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 1px solid #e9ecef;
}

.config-section h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1rem;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
}

.config-item {
    margin-bottom: 20px;
}

.config-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.config-item input, .config-item select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.config-item input:focus, .config-item select:focus {
    border-color: #007bff;
}

.config-item input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.config-item label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
}

#resetConfig {
    background: #6c757d;
    margin-left: 10px;
}

#resetConfig:hover {
    background: #545b62;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
}

/* Configuration Display Styles */
.config-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.config-display {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
}

.config-display .config-item {
    margin-bottom: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #f1f3f4;
}

.config-display .config-item:last-child {
    border-bottom: none;
}

.config-methods {
    margin-top: 20px;
}

.method {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.method h6 {
    color: #495057;
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
}

.method p {
    margin: 8px 0;
    color: #6c757d;
    font-size: 13px;
}

.method code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #495057;
}

.url-examples {
    margin-top: 10px;
}

.url-examples ul {
    margin: 8px 0;
    padding-left: 20px;
}

.url-examples li {
    margin: 4px 0;
    font-size: 12px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.button-group button {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
}

/* Knowledge Base Panel Styles */
.knowledge-base-panel {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.knowledge-base-panel h3 {
    margin-bottom: 25px;
    color: #495057;
    font-size: 1.4rem;
    text-align: center;
    border-bottom: 3px solid #007bff;
    padding-bottom: 10px;
}

.knowledge-sections {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.knowledge-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
}

.knowledge-section:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.knowledge-section h4 {
    color: #007bff;
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 8px;
}

.knowledge-content {
    line-height: 1.6;
}

.knowledge-content h5 {
    color: #495057;
    margin: 20px 0 10px 0;
    font-size: 1.1rem;
}

.knowledge-content h6 {
    color: #6c757d;
    margin: 15px 0 8px 0;
    font-size: 1rem;
}

.knowledge-content p {
    margin: 10px 0;
    color: #495057;
}

.knowledge-content ul, .knowledge-content ol {
    margin: 10px 0;
    padding-left: 25px;
}

.knowledge-content li {
    margin: 5px 0;
    color: #495057;
}

.pillar, .business-benefit, .feature, .ecosystem-benefit, .technique {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.pillar h6, .business-benefit h6, .feature h6, .ecosystem-benefit h6, .technique h6 {
    color: #007bff;
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.knowledge-content pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.knowledge-content code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    color: #495057;
}

.knowledge-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .mode-selector {
        flex-wrap: wrap;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .message {
        max-width: 90%;
    }
    
    .button-group {
        flex-direction: column;
    }
}
