/* Agent Orchestration Platform - Custom Styles */

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

html, body, #root {
    height: 100%;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.5;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

.animate-fade-in {
    animation: fadeIn 0.2s ease-out;
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Modal backdrop */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* Card hover effects */
.card-hover {
    transition: all 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Button styles */
.btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.4);
}

.btn-secondary {
    background: white;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #d1d5db;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Toggle switch custom styles */
.toggle-switch {
    position: relative;
    display: inline-flex;
    height: 1.5rem;
    width: 2.75rem;
    align-items: center;
    border-radius: 9999px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.toggle-switch-enabled {
    background-color: #7c3aed;
}

.toggle-switch-disabled {
    background-color: #d1d5db;
}

.toggle-switch-knob {
    display: inline-block;
    height: 1rem;
    width: 1rem;
    transform: translateX(0.25rem);
    border-radius: 9999px;
    background-color: white;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-switch-knob-enabled {
    transform: translateX(1.5rem);
}

/* Chat message styles */
.chat-message {
    max-width: 85%;
    word-wrap: break-word;
}

.chat-message-user {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 1rem 1rem 0.25rem 1rem;
}

.chat-message-agent {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 1rem 1rem 1rem 0.25rem;
}

/* Sidebar styles */
.sidebar {
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
}

.sidebar-item {
    transition: all 0.2s ease;
    border-radius: 0.5rem;
}

.sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-item-active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left: 3px solid #a78bfa;
}

/* Status badge styles */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-inactive {
    background-color: #f3f4f6;
    color: #6b7280;
}

.status-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-warning {
    background-color: #fef3c7;
    color: #92400e;
}

/* Table styles */
.table-container {
    overflow-x: auto;
}

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

.table-container th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e5e7eb;
}

.table-container td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.table-container tr:hover {
    background-color: #f9fafb;
}

/* Form input styles */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* Textarea styles */
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s ease;
}

.form-textarea:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Select styles */
.form-select {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background-color: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Chip/Tag styles */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: #f3f4f6;
    border-radius: 9999px;
    font-size: 0.75rem;
    color: #374151;
}

.chip-purple {
    background-color: #ede9fe;
    color: #6d28d9;
}

.chip-blue {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.chip-green {
    background-color: #dcfce7;
    color: #166534;
}

.chip-red {
    background-color: #fee2e2;
    color: #991b1b;
}

.chip-yellow {
    background-color: #fef3c7;
    color: #92400e;
}

/* Loading spinner */
.spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #e5e7eb;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Tooltip styles */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background-color: #1f2937;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 50;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Progress bar */
.progress-bar {
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed 0%, #a78bfa 100%);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Notification dot */
.notification-dot {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}

/* Guardrail severity colors */
.severity-critical {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.severity-high {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.severity-medium {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.severity-low {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Code block styles */
.code-block {
    background-color: #1f2937;
    color: #e5e7eb;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
}

/* Markdown table styles */
.markdown-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.markdown-table th,
.markdown-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.markdown-table th {
    background-color: #f9fafb;
    font-weight: 600;
}

.markdown-table tr:nth-child(even) {
    background-color: #f9fafb;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        height: auto;
        flex-direction: row;
        padding: 0.5rem;
    }
    
    .hide-mobile {
        display: none;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
}

/* Focus visible styles for accessibility */
:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
