/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-content h1 i {
    margin-right: 15px;
    color: #ffd700;
}

.header-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff6b6b;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

.status-dot.healthy {
    background: #51cf66;
}

.status-dot.loading {
    background: #ffd43b;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Models Section */
.models-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.models-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
}

.models-section h2 i {
    margin-right: 10px;
    color: #667eea;
}

.models-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.model-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.model-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.model-card.active {
    border-color: #667eea;
    background: #f0f2ff;
}

.model-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.model-details {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 8px;
}

.model-status {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.model-status.active {
    background: #d4edda;
    color: #155724;
}

.model-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Chat Section */
.chat-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.chat-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: #2c3e50;
}

.chat-section h2 i {
    margin-right: 10px;
    color: #667eea;
}

.chat-container {
    margin-bottom: 30px;
}

.model-selector,
.system-prompt-section,
.message-input-section {
    margin-bottom: 20px;
}

.model-selector label,
.system-prompt-section label,
.message-input-section label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #2c3e50;
}

.model-selector select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
}

.model-selector select:focus {
    outline: none;
    border-color: #667eea;
}

.system-prompt-section textarea,
.message-input-section textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
}

.system-prompt-section textarea:focus,
.message-input-section textarea:focus {
    outline: none;
    border-color: #667eea;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.token-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.token-control label {
    margin: 0;
    font-weight: 500;
    color: #2c3e50;
}

.token-control input {
    width: 80px;
    padding: 8px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    text-align: center;
}

.send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Response Section */
.response-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.response-section h3 i {
    margin-right: 8px;
    color: #667eea;
}

.response-container {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

.placeholder {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
}

.placeholder i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #dee2e6;
}

.response-content {
    line-height: 1.7;
    color: #2c3e50;
}

.response-meta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* Footer */
.footer {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loading-spinner i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
}

.loading-spinner p {
    color: #2c3e50;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .token-control {
        justify-content: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

/* Scrollbar Styling */
.response-container::-webkit-scrollbar {
    width: 6px;
}

.response-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.response-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.response-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
