/* Agent Orchestration Page Styles */

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --active-glow: 0 0 30px rgba(102, 126, 234, 0.4);
    --card-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.orchestration-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    background: linear-gradient(180deg, #0a0f14 0%, #111827 100%);
}

.orchestration-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

.header-left {
    flex: 1;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.claude-md-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    width: fit-content;
}

.status-indicator {
    width: 10px;
    height: 10px;
    min-width: 10px;
    min-height: 10px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
    flex-grow: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

.file-path {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    color: #667eea;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Active Agents Summary */
.active-agents-summary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.active-agents-summary h3 {
    margin-bottom: 1rem;
    color: #667eea;
    font-size: 1.25rem;
}

.active-count {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #e5e7eb;
}

.active-agents-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.active-agent-chip {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 1px solid #667eea;
    border-radius: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--card-transition);
}

.active-agent-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.remove-agent {
    cursor: pointer;
    color: #f87171;
    font-weight: bold;
    margin-left: 0.5rem;
    transition: transform 0.2s;
}

.remove-agent:hover {
    transform: scale(1.2);
}

/* Agent Cards Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Agent Card Styles */
.agent-card {
    background: #1f2937;
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    transition: var(--card-transition);
    border: 2px solid transparent;
    overflow: hidden;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.agent-card.inactive {
    opacity: 0.6;
    background: rgba(31, 41, 55, 0.5);
}

.agent-card.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 2px solid #667eea;
    box-shadow: var(--active-glow);
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3),
                    0 0 40px rgba(102, 126, 234, 0.2),
                    inset 0 0 20px rgba(102, 126, 234, 0.1);
    }
    to {
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.5),
                    0 0 60px rgba(102, 126, 234, 0.3),
                    inset 0 0 30px rgba(102, 126, 234, 0.15);
    }
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.agent-info {
    flex: 1;
}

.agent-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agent-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    border-radius: 20px;
    font-size: 0.875rem;
}

.agent-type.gemini {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* Toggle Switch Styles */
.agent-toggle {
    position: relative;
    width: 60px;
    height: 30px;
}

.toggle-switch {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4b5563;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    min-height: 24px;
    min-width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch:checked + .toggle-label {
    background: var(--primary-gradient);
}

.toggle-switch:checked + .toggle-label:before {
    transform: translateX(30px);
}

.agent-description {
    color: #9ca3af;
    margin-bottom: 1rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.agent-capabilities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.capability-tag {
    padding: 0.25rem 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-radius: 12px;
    font-size: 0.875rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.agent-card.active .capability-tag {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
    font-weight: 500;
}

.agent-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.agent-priority {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
}

.priority-badge {
    padding: 0.25rem 0.5rem;
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border-radius: 8px;
    font-weight: 600;
}

.agent-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(248, 113, 113, 0.3);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

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

/* Empty State */
.empty-message {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #1f2937;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    color: #e5e7eb;
    font-size: 1.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #f87171;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #9ca3af;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: #1f2937;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 3000;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border: 1px solid #4ade80;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1) 0%, rgba(34, 197, 94, 0.1) 100%);
}

.notification-error {
    border: 1px solid #f87171;
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
}

.notification-info {
    border: 1px solid #60a5fa;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .agents-grid {
        grid-template-columns: 1fr;
    }
    
    .orchestration-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}