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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Arial';
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
    position: relative;
}

.logo-section {
    margin-bottom: 20px;
}

.main-title {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.3em;
    opacity: 0.95;
    font-weight: 300;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.status-indicator {
    width: 12px;
    height: 12px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 30px;
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Main Content */
.main-content {
    padding: 40px;
    min-height: 500px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.5s;
}

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

.section-title {
    font-size: 2.2em;
    color: #667eea;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

/* Models Grid */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.model-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.model-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.model-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.3);
}

.model-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.model-name {
    font-size: 1.5em;
    color: #667eea;
    margin-bottom: 10px;
    font-weight: 700;
}

.model-name-ar {
    font-size: 1.2em;
    color: #764ba2;
    margin-bottom: 15px;
}

.model-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.model-status {
    display: inline-block;
    padding: 5px 15px;
    background: #4ade80;
    color: white;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 600;
}

.model-status.loading {
    background: #fbbf24;
}

.model-capabilities {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.capability-tag {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Agents Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.agent-card {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #f56565, #ed8936);
}

.agent-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(245, 101, 101, 0.3);
}

.agent-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.agent-name {
    font-size: 1.5em;
    color: #f56565;
    margin-bottom: 15px;
    font-weight: 700;
}

.agent-description {
    color: #666;
    line-height: 1.6;
}

/* Chat Interface */
.chat-container {
    background: #f8f9fa;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.model-selector {
    padding: 20px;
    background: white;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 15px;
}

.model-selector label {
    font-weight: 600;
    color: #667eea;
}

.model-selector select {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
}

.chat-messages {
    padding: 30px;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
}

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

.welcome-message h3 {
    font-size: 1.8em;
    color: #667eea;
    margin-bottom: 15px;
}

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

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

.message.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-right: auto;
    border-bottom-right-radius: 5px;
}

.message.ai {
    background: white;
    color: #333;
    margin-left: auto;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 2px solid #e9ecef;
    display: flex;
    gap: 15px;
}

#chatInput {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    resize: none;
}

#chatInput:focus {
    outline: none;
    border-color: #667eea;
}

.send-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.send-btn:active {
    transform: translateY(0);
}

/* Documentation */
.docs-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.doc-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.doc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.3);
}

.doc-card h3 {
    font-size: 1.5em;
    color: #10b981;
    margin-bottom: 15px;
}

.doc-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.doc-link {
    display: inline-block;
    padding: 10px 20px;
    background: #10b981;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.doc-link:hover {
    background: #059669;
    transform: translateX(5px);
}

/* Status Section */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.status-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.status-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(251, 191, 36, 0.3);
}

.status-card h3 {
    font-size: 1.2em;
    color: #f59e0b;
    margin-bottom: 15px;
}

.status-value {
    font-size: 3em;
    font-weight: 700;
    color: #d97706;
    margin: 15px 0;
}

.status-value.status-healthy {
    color: #10b981;
}

.status-label {
    color: #92400e;
    font-size: 0.95em;
}

.system-info {
    margin-top: 40px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.system-info h3 {
    font-size: 1.8em;
    color: #667eea;
    margin-bottom: 20px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table tr {
    border-bottom: 1px solid #e9ecef;
}

.info-table td {
    padding: 15px;
    font-size: 1em;
}

.info-table td:first-child {
    font-weight: 600;
    color: #667eea;
    width: 200px;
}

.info-table td a {
    color: #764ba2;
    text-decoration: none;
}

.info-table td a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    padding: 30px;
    text-align: center;
}

.footer p {
    margin: 10px 0;
    opacity: 0.9;
}

.github-link {
    margin-top: 20px;
}

.github-link a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    background: #4a5568;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s;
}

.github-link a:hover {
    background: #667eea;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2em;
    }

    .subtitle {
        font-size: 1em;
    }

    .navigation {
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
    }

    .models-grid,
    .agents-grid,
    .docs-content,
    .status-grid {
        grid-template-columns: 1fr;
    }

    .chat-input-container {
        flex-direction: column;
    }

    .send-btn {
        width: 100%;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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