/* YOYAKU Agents Dashboard Styles */

:root {
    --primary-color: #2c3e50;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #f44336;
    --info-color: #2196F3;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #34495e 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 2em;
    font-weight: 600;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9em;
}

.refresh-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--success-color);
    display: inline-block;
    transition: all 0.3s ease;
}

.refresh-indicator.refreshing {
    animation: pulse 1s infinite;
}

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

/* Alerts Section */
.alerts-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.alerts-section.has-alerts {
    border-left: 4px solid var(--warning-color);
}

.alerts-section h2 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-critical {
    background-color: #ffebee;
    border-left-color: var(--danger-color);
}

.alert-warning {
    background-color: #fff3e0;
    border-left-color: var(--warning-color);
}

.alert-icon {
    font-size: 1.2em;
}

.alert-content {
    flex: 1;
}

.alert-content strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.alert-content p {
    margin: 0;
    color: var(--text-secondary);
}

.alert-time {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.no-alerts {
    color: var(--text-secondary);
    font-style: italic;
}

/* Agent Cards Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.agent-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.agent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-left: 10px;
}

.card-header h3 {
    font-size: 1.3em;
    font-weight: 600;
}

.status-badge {
    font-size: 1.5em;
    transition: color 0.3s ease;
}

.status-healthy {
    color: var(--success-color);
}

.status-warning {
    color: var(--warning-color);
}

.status-down {
    color: var(--danger-color);
}

.agent-description {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 15px;
}

.agent-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--bg-color);
    border-radius: 8px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
}

.metrics-container {
    margin-top: 15px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.metric-item {
    padding: 10px;
    background-color: var(--bg-color);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.75em;
    color: var(--text-secondary);
    text-transform: capitalize;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
}

/* Activity Section */
.activity-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.activity-section h2 {
    margin-bottom: 20px;
}

.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.activity-card h3 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-items {
    list-style: none;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 0.85em;
    color: var(--text-secondary);
    min-width: 80px;
}

.activity-desc {
    flex: 1;
    color: var(--text-primary);
}

.no-activity {
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
    text-align: center;
}

/* Charts Section */
.charts-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.charts-section h2 {
    margin-bottom: 20px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.chart-container {
    padding: 15px;
    background-color: var(--bg-color);
    border-radius: 8px;
}

.chart-container h3 {
    font-size: 1em;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.chart-container canvas {
    max-height: 250px;
}

/* Loading States */
.loading {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    header h1 {
        font-size: 1.5em;
    }

    .agents-grid,
    .activity-grid,
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .agent-stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* Scrollbar Styling */
.activity-list::-webkit-scrollbar {
    width: 6px;
}

.activity-list::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 3px;
}

.activity-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.activity-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}
