/* Deployment Status Page Styling */

:root {
    --status-healthy: #28a745;
    --status-warning: #ffc107;
    --status-error: #dc3545;
    --status-unknown: #6c757d;
    --status-pending: #17a2b8;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.2);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

/* Health Indicator */
.health-indicator {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    transition: var(--transition);
    position: relative;
}

.health-indicator.healthy {
    background: linear-gradient(135deg, var(--status-healthy), #20c997);
    color: white;
    box-shadow: 0 0 30px rgba(40, 167, 69, 0.3);
}

.health-indicator.warning {
    background: linear-gradient(135deg, var(--status-warning), #fd7e14);
    color: var(--bs-body-color, #212529);
    box-shadow: 0 0 30px rgba(255, 193, 7, 0.3);
}

.health-indicator.error {
    background: linear-gradient(135deg, var(--status-error), #e74c3c);
    color: white;
    box-shadow: 0 0 30px rgba(220, 53, 69, 0.3);
}

.health-indicator.unknown {
    background: linear-gradient(135deg, var(--status-unknown), #adb5bd);
    color: white;
}

.health-indicator::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: pulse 2s infinite;
    z-index: -1;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Metric Cards */
.metric-card {
    transition: var(--transition);
    height: 100%;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 24px;
    color: white;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--bs-body-color, #212529);
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Service Status Items */
.service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-radius: var(--border-radius);
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.service-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.service-item.healthy {
    border-left-color: var(--status-healthy);
    background: var(--bs-success-bg-subtle, #d4edda);
}

.service-item.warning {
    border-left-color: var(--status-warning);
    background: var(--bs-warning-bg-subtle, #fff3cd);
}

.service-item.error {
    border-left-color: var(--status-error);
    background: var(--bs-danger-bg-subtle, #f8d7da);
}

.service-item.pending {
    border-left-color: var(--status-pending);
    background: var(--bs-info-bg-subtle, #d1ecf1);
}

.service-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.service-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.service-icon.healthy { background: var(--status-healthy); }
.service-icon.warning { background: var(--status-warning); color: var(--bs-body-color, #212529); }
.service-icon.error { background: var(--status-error); }
.service-icon.pending { background: var(--status-pending); }
.service-icon.unknown { background: var(--status-unknown); }

.service-details h6 {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    color: var(--bs-body-color, #212529);
}

.service-details small {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.85rem;
}

.service-status {
    text-align: right;
}

.service-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    display: inline-block;
}

.service-badge.healthy {
    background: var(--status-healthy);
    color: white;
}

.service-badge.warning {
    background: var(--status-warning);
    color: var(--bs-body-color, #212529);
}

.service-badge.error {
    background: var(--status-error);
    color: white;
}

.service-badge.pending {
    background: var(--status-pending);
    color: white;
}

.service-meta {
    font-size: 0.8rem;
    color: var(--bs-secondary-color, #6c757d);
}

/* Deployment History */
.deployment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bs-body-bg, #fff);
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.deployment-item:hover {
    box-shadow: var(--card-shadow);
    transform: translateY(-2px);
}

.deployment-item.success {
    border-left: 4px solid var(--status-healthy);
}

.deployment-item.failed {
    border-left: 4px solid var(--status-error);
}

.deployment-item.in-progress {
    border-left: 4px solid var(--status-pending);
}

.deployment-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.deployment-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.deployment-icon.success { background: var(--status-healthy); }
.deployment-icon.failed { background: var(--status-error); }
.deployment-icon.in-progress { background: var(--status-pending); }

.deployment-details h6 {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
}

.deployment-details .text-muted {
    font-size: 0.9rem;
}

.deployment-meta {
    text-align: right;
    font-size: 0.85rem;
    color: var(--bs-secondary-color, #6c757d);
}

.deployment-duration {
    font-weight: 600;
    color: var(--bs-body-color, #212529);
    margin-bottom: 0.25rem;
}

/* Environment Details */
.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

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

.detail-label {
    font-weight: 500;
    color: var(--bs-secondary-color, #6c757d);
    min-width: 120px;
}

.detail-value {
    font-weight: 600;
    color: var(--bs-body-color, #212529);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Resource Usage */
.resource-meter {
    text-align: center;
    margin-bottom: 2rem;
}

.resource-label {
    font-weight: 500;
    color: var(--bs-secondary-color, #6c757d);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.resource-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--bs-body-color, #212529);
}

.progress {
    height: 12px;
    border-radius: 6px;
    background: #e9ecef;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Health Checks */
.health-check-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-radius: 8px;
    transition: var(--transition);
}

.health-check-item:hover {
    background: #e9ecef;
}

.health-check-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.health-check-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
}

.health-check-icon.pass { background: var(--status-healthy); }
.health-check-icon.fail { background: var(--status-error); }
.health-check-icon.running { background: var(--status-pending); }

.health-check-result {
    font-size: 0.85rem;
    color: var(--bs-secondary-color, #6c757d);
}

.health-check-duration {
    font-weight: 600;
    color: var(--bs-body-color, #212529);
}

/* Log Viewer */
.log-viewer {
    background: #212529;
    color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.log-entry {
    margin-bottom: 0.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.log-timestamp {
    color: var(--bs-secondary-color, #6c757d);
    min-width: 180px;
    flex-shrink: 0;
}

.log-level {
    min-width: 60px;
    flex-shrink: 0;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.log-level.ERROR { background: var(--status-error); color: white; }
.log-level.WARN { background: var(--status-warning); color: var(--bs-body-color, #212529); }
.log-level.INFO { background: var(--status-pending); color: white; }
.log-level.DEBUG { background: var(--status-unknown); color: white; }

.log-message {
    flex: 1;
    word-break: break-word;
}

/* Loading States */
.service-loading {
    text-align: center;
    color: var(--bs-secondary-color, #6c757d);
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .metric-card {
        margin-bottom: 1rem;
    }

    .service-item,
    .deployment-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .service-status,
    .deployment-meta {
        text-align: center;
    }

    .detail-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .log-entry {
        flex-direction: column;
        gap: 0.25rem;
    }

    .log-timestamp {
        min-width: auto;
    }
}

/* Animation for auto-refresh */
.btn-auto-refresh.active {
    background: var(--status-healthy);
    color: white;
    border-color: var(--status-healthy);
}

.btn-auto-refresh.active i {
    animation: spin 2s linear infinite;
}

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

/* Status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-dot.healthy { background: var(--status-healthy); }
.status-dot.warning { background: var(--status-warning); }
.status-dot.error { background: var(--status-error); }
.status-dot.pending {
    background: var(--status-pending);
    animation: pulse 1.5s infinite;
}

/* Configuration status indicators */
.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

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

.config-label {
    font-weight: 500;
    color: var(--bs-secondary-color, #495057);
}

.config-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.config-badge.configured {
    background: var(--bs-success-bg-subtle, #d4edda);
    color: var(--bs-success-text-emphasis, #155724);
}

.config-badge.missing {
    background: var(--bs-danger-bg-subtle, #f8d7da);
    color: var(--bs-danger-text-emphasis, #721c24);
}

.config-badge.partial {
    background: var(--bs-warning-bg-subtle, #fff3cd);
    color: var(--bs-warning-text-emphasis, #856404);
}