/* CHIMERA Monitor Dashboard Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: #fff;
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    color: #333;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    padding: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

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

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

.refresh-status {
    font-size: 14px;
    color: #666;
}

/* Buttons */
/*
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: #003f8f;
    color: white;
}

.btn-primary:hover {
    background: #003880;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}
*/
/* Status Section */
.status-section,
.components-section,
.metrics-section,
.config-section,
.settings-section {
    margin-bottom: 30px;
}

.status-section h2,
.components-section h2,
.metrics-section h2,
.config-section h2,
.settings-section h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Status Cards */
.status-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.overall-status {
    display: flex;
    align-items: center;
    gap: 30px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 18px;
    font-weight: 600;
}

.status-pulse {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator[data-status="healthy"] .status-pulse {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.status-indicator[data-status="unhealthy"] .status-pulse {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.status-indicator[data-status="loading"] .status-pulse {
    background: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

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

.status-details {
    flex: 1;
}

.status-details p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

/* Components Grid */
.components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.component-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.component-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

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

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-badge[data-status="healthy"] {
    background: #dcfce7;
    color: #166534;
}

.status-badge[data-status="healthy"] .status-dot {
    background: #10b981;
}

.status-badge[data-status="unhealthy"] {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge[data-status="unhealthy"] .status-dot {
    background: #ef4444;
}

.status-badge[data-status="loading"] {
    background: #fef3c7;
    color: #92400e;
}

.status-badge[data-status="loading"] .status-dot {
    background: #f59e0b;
}

.status-badge[data-status="unknown"] {
    background: #e5e7eb;
    color: #374151;
}

.status-badge[data-status="unknown"] .status-dot {
    background: #9ca3af;
}

.card-body {
    padding-top: 15px;
}

.component-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.component-details p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.detail-item {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
}

.detail-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 12px;
}

.detail-value {
    display: block;
    font-size: 14px;
    /*color: #667eea;*/
    color: #003f8f;
    word-break: break-all;
}

.loading-text {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.metric-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
}

.metric-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    /*color: #667eea;*/
    color: #003f8f;
    margin-bottom: 5px;
    word-break: break-word;
}

.metric-unit {
    font-size: 12px;
    color: #999;
}

/* Configuration Section */
.config-details {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.config-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: flex-start;
    gap: 20px;
}

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

.config-label {
    font-weight: 600;
    color: #333;
    min-width: 200px;
    flex-shrink: 0;
}

.config-value {
    /*color: #667eea;*/
    color: #003f8f;
    word-break: break-all;
    flex: 1;
}

.auto-refresh-value {
    display: flex;
    flex-direction: row;    
    gap: 20px;    
}

/* Settings Section */
.settings-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-controls {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.settings-controls label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
}

.settings-controls input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.refresh-interval-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.refresh-interval-control label {
    font-weight: 600;
    color: #333;
}

.input-small {
    width: 40px;
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-controls {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .components-grid {
        grid-template-columns: 1fr;
    }

    .overall-status {
        flex-direction: column;
        align-items: flex-start;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .settings-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    body {
        padding: 10px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-value {
        font-size: 24px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-badge {
        align-self: flex-start;
    }
}

/* E2E Processing Section */
.e2e-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.e2e-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

.e2e-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.e2e-controls {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 250px;
}

.form-group label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-control {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
}

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

/* Progress Section */
.progress-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #667eea;
}

.progress-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.progress-label {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.progress-indicator {
    font-size: 20px;
    min-width: 30px;
    text-align: center;
}

.progress-indicator.waiting {
    animation: pulse 1.5s infinite;
}

.progress-indicator.completed {
    color: #28a745;
}

.progress-indicator.failed {
    color: #dc3545;
}

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

/* Results Section */
.results-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #28a745;
}

.results-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.results-card {
    background: white;
    border-radius: 4px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

#resultsContent {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.result-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.result-label {
    font-weight: 600;
    color: #333;
    display: inline-block;
    min-width: 150px;
}

.result-value {
    /*color: #667eea;*/
    color: #003f8f;
    font-family: monospace;
}

/* Error Section */
.error-section {
    background: #ffe5e5;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #dc3545;
}

.error-message {
    color: #721c24;
    font-weight: 500;
    word-break: break-word;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #003f8f;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #003880;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

.btn-primary:disabled {
    background-color: #ccc;
}


/*
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: #003f8f;
    color: white;
}

.btn-primary:hover {
    background: #003880;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}
*/

/* Responsive */
@media (max-width: 768px) {
    .e2e-controls {
        flex-direction: column;
    }

    .form-group {
        min-width: 100%;
    }

    .btn {
        width: 100%;
    }
}
/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: #007bff;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #333;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

.badge-light {
    background-color: #f8f9fa;
    color: #333;
}

.badge-dark {
    background-color: #343a40;
    color: white;
}

/* Environment badge in header */
#environmentBadge {
    margin: 0 15px;
}