/* ==========================================
   AI AGENTS MANAGEMENT PAGE STYLES
   ========================================== */

.agents-management-page {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

/* Navigation */
.management-nav {
    margin-bottom: 1.5rem;
}

/* Loading & Error States */
.management-loading,
.management-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1rem;
}

.management-loading .loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.management-error {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 1rem;
    border: 2px solid #ef4444;
}

.management-error i {
    font-size: 4rem;
    color: #ef4444;
    margin-bottom: 1rem;
}

/* Header */
.management-header {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #374151;
}

.header-title h1 {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-title h1 i {
    color: #3b82f6;
}

.header-subtitle {
    color: #9ca3af;
    font-size: 1rem;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 0.75rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.total {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
}

.stat-icon.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.stat-icon.inactive {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
}

.stat-label {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Filters */
.management-filters {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #374151;
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 1rem;
    align-items: center;
}

.search-box {
    position: relative;
}

.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #374151;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.875rem;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 600;
}

.filter-group select {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #374151;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.875rem;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Agents Grid Container */
.agents-grid-container {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid #374151;
}

.agents-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 0.5rem;
    color: #3b82f6;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.agents-count i {
    font-size: 1rem;
}

/* Agents Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Agent Card */
.agent-card {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.8) 100%);
    border-radius: 1rem;
    border: 1px solid #374151;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.agent-card:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

.agent-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.agent-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.agent-card-info {
    flex: 1;
}

.agent-card-title {
    font-size: 1.125rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

.agent-card-id {
    font-size: 0.75rem;
    color: #9ca3af;
}

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

.btn-icon {
    width: 36px;
    height: 36px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid #3b82f6;
    border-radius: 0.5rem;
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.1);
}

.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Agent Card Body */
.agent-card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.agent-status-badge,
.agent-type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.agent-status-badge.active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid #10b981;
}

.agent-status-badge.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.agent-status-badge.maintenance {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

.agent-type-badge {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    border: 1px solid #8b5cf6;
}

.agent-type-badge.analysis {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

.agent-type-badge.trading {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid #10b981;
}

.agent-type-badge.risk {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.agent-type-badge.sentiment {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    border: 1px solid #8b5cf6;
}

.agent-type-badge.portfolio {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

.agent-description {
    color: #d1d5db;
    font-size: 0.875rem;
    line-height: 1.5;
}

.agent-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.metric {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
}

.metric-label {
    font-size: 0.75rem;
    color: #9ca3af;
}

.metric-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}

.metric-value.positive {
    color: #10b981;
}

.metric-value.negative {
    color: #ef4444;
}

.agent-tech-info {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tech-badge {
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.tech-badge i {
    color: #3b82f6;
}

/* No Agents */
.no-agents {
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
}

.no-agents i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #374151;
}

.no-agents h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.no-agents p {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .management-filters {
        grid-template-columns: 1fr;
    }
    
    .agents-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .agents-management-page {
        padding: 1rem;
    }
    
    .management-header {
        padding: 1rem;
    }
    
    .header-title h1 {
        font-size: 1.5rem;
    }
    
    .header-stats {
        grid-template-columns: 1fr;
    }
    
    .agents-grid {
        grid-template-columns: 1fr;
    }
    
    .agent-metrics {
        grid-template-columns: 1fr;
    }
}
