/* AI Demo Pages - Global Styles */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --info-gradient: linear-gradient(135deg, #17a2b8 0%, #0c5a72 100%);
    --success-gradient: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    --warning-gradient: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    --danger-gradient: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

/* Workflow Orchestrator Styles */
.planning-output,
.retrieval-output,
.summary-output,
.evaluation-output {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.retrieved-chunks {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chunk-item {
    padding: 1rem;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.chunk-item:hover {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    transform: translateX(4px);
}

.chunk-preview {
    margin: 0.5rem 0;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
}

.summary-stats,
.eval-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.eval-metric {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.eval-metric:last-child {
    border-bottom: none;
}

/* RAG Explorer Styles */
.search-result {
    transition: all 0.2s ease;
}

.search-result:hover {
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.1);
}

.embeddings-canvas canvas {
    max-width: 100%;
    height: auto;
}

/* Dropdown menu improvements */
.dropdown-menu {
    min-width: 300px;
}

.dropdown-item {
    padding: 0.75rem 1rem;
}

.dropdown-item small {
    display: block;
    margin-top: 0.25rem;
    color: #6c757d;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .architecture-diagram {
        flex-direction: column;
        gap: 1.5rem;
    }

    .arch-arrow {
        transform: rotate(90deg);
    }

    .rag-comparison {
        grid-template-columns: 1fr;
    }

    .iteration-flow {
        flex-direction: column;
        gap: 1rem;
    }

    .iteration-arrow {
        transform: rotate(90deg);
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Loading animation */
.stage-status.loading::before {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility classes */
.code-block code {
    display: block;
    line-height: 1.6;
}

.alert-info, .alert-warning, .alert-success, .alert-danger {
    border-radius: 8px;
    border: none;
}

/* Smooth transitions */
* {
    transition: color 0.2s ease, background-color 0.2s ease;
}

button, a {
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Card enhancements */
.card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

/* Table enhancements */
table {
    border-collapse: separate;
    border-spacing: 0;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

/* Badge and label styles */
.badge {
    border-radius: 20px;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

/* Form improvements */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Textarea styling */
textarea.form-control {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: vertical;
    min-height: 100px;
}

/* List styling */
.list-unstyled li {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.list-unstyled li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* Print styles */
@media print {
    .workflow-header, .rag-header, .eval-header, .dev-header {
        page-break-after: avoid;
    }

    .card {
        page-break-inside: avoid;
    }
}
