/* Dashboard Main Layout */
.dashboard {
    padding: 20px;
    background-color: #f5f7fa;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-header h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 28px;
}

.last-updated {
    color: #7f8c8d;
    font-size: 14px;
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 10px;
}

.stat-label {
    color: #7f8c8d;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Dashboard Sections */
.dashboard-section {
    margin-bottom: 30px;
}

.dashboard-section h2 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 20px;
    padding-left: 10px;
    border-left: 4px solid #3498db;
}

/* Health Grid */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Health Status Card */
.health-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #95a5a6;
}

.health-card.status-healthy {
    border-left-color: #27ae60;
}

.health-card.status-degraded {
    border-left-color: #f39c12;
}

.health-card.status-unhealthy {
    border-left-color: #e74c3c;
}

.health-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.health-icon {
    font-size: 24px;
    margin-right: 10px;
}

.health-card-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.health-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.status-healthy {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-degraded {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-unhealthy {
    background: #f8d7da;
    color: #721c24;
}

.response-time {
    color: #7f8c8d;
    font-size: 14px;
}

.health-description {
    color: #7f8c8d;
    font-size: 14px;
    margin: 10px 0;
}

.health-data {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ecf0f1;
}

.data-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
}

.data-label {
    color: #7f8c8d;
}

.data-value {
    color: #2c3e50;
    font-weight: 500;
}

.last-checked {
    margin-top: 10px;
    font-size: 12px;
    color: #95a5a6;
}

/* Process Monitor */
.process-monitor {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.monitor-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
}

.refresh-indicator {
    color: #7f8c8d;
    font-size: 14px;
}

.refresh-indicator.refreshing .spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

.process-grid {
    display: grid;
    gap: 15px;
}

.process-card {
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    padding: 15px;
}

.process-card.process-running {
    border-left: 3px solid #3498db;
}

.process-card.process-completed {
    border-left: 3px solid #27ae60;
}

.process-card.process-failed {
    border-left: 3px solid #e74c3c;
}

.process-card.process-idle {
    border-left: 3px solid #95a5a6;
}

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

.process-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
}

.process-status-badge {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-running {
    background: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
}

.status-idle {
    background: #e2e3e5;
    color: #383d41;
}

.progress-container {
    margin-bottom: 10px;
}

.progress-bar {
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #3498db;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: #7f8c8d;
    margin-left: 10px;
}

.process-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.info-item {
    font-size: 13px;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-item.error {
    color: #e74c3c;
}

.info-label {
    color: #7f8c8d;
    margin-right: 5px;
}

.info-value {
    color: #2c3e50;
    font-weight: 500;
}

.no-processes {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* Log Viewer */
.log-viewer {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.log-header {
    margin-bottom: 20px;
}

.log-header h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
}

.log-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 300px;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-button, .clear-button, .refresh-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.search-button {
    background: #3498db;
    color: white;
}

.clear-button {
    background: #95a5a6;
    color: white;
}

.refresh-button {
    background: #27ae60;
    color: white;
}

.refresh-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.filter-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.level-filter, .source-filter, .page-size {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.log-stats {
    display: flex;
    gap: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
}

.error-count {
    color: #e74c3c;
    font-weight: bold;
}

.warning-count {
    color: #f39c12;
    font-weight: bold;
}

.log-container {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
}

.log-entries {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.log-entry {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.log-entry:hover {
    background: #f8f9fa;
}

.log-entry.log-trace {
    color: #95a5a6;
}

.log-entry.log-debug {
    color: #3498db;
}

.log-entry.log-info {
    color: #2c3e50;
}

.log-entry.log-warning {
    background: #fff3cd;
    color: #856404;
}

.log-entry.log-error {
    background: #f8d7da;
    color: #721c24;
}

.log-entry.log-critical {
    background: #721c24;
    color: white;
}

.log-main {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.log-timestamp {
    color: #7f8c8d;
    white-space: nowrap;
}

.log-level {
    font-weight: bold;
    white-space: nowrap;
}

.log-source {
    color: #3498db;
    white-space: nowrap;
}

.log-message {
    flex: 1;
}

.log-details {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.exception-details {
    margin: 0;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-top: 1px solid #ecf0f1;
}

.page-button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.page-button:hover:not(:disabled) {
    background: #f8f9fa;
}

.page-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: #7f8c8d;
    font-size: 14px;
}

.no-logs {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.loading-indicator {
    text-align: center;
    padding: 40px;
    color: #3498db;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}