/* Custom styles for Application Control */

/* Add some padding to the body */
body {
    padding-bottom: 60px; /* Space for the fixed footer */
}

/* Style for the main content container */
.container {
    max-width: 1400px;
}

/* Card styling */
.card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    font-weight: bold;
}

/* Table styling */
.table th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
}

.table-responsive {
    max-height: 600px;
    overflow-y: auto;
}

/* Badge styling */
.badge {
    font-size: 0.9em;
    padding: 0.4em 0.6em;
}

/* Update button styling */
.update-btn {
    min-width: 80px;
}

/* Version highlighting */
.version-current {
    font-weight: bold;
}

.version-available {
    color: #28a745;
    font-weight: bold;
}

/* Environment labels */
.env-dev {
    color: #17a2b8;
    font-weight: bold;
}

.env-prd {
    color: #dc3545;
    font-weight: bold;
}

/* Footer styling */
footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
}

/* Form styling */
.form-select, .form-control {
    margin-bottom: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .table-responsive {
        max-height: 400px;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
}

/* Health indicators */
.health-dot {
    --health-color: #ffc107;
    --health-pulse-color: rgba(255, 193, 7, 0.45);
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--health-color);
    animation: health-pulse 2.8s ease-in-out infinite;
    position: relative;
}

.health-dot.health-dot-interactive {
    cursor: pointer;
}

.health-dot.health-ok {
    --health-color: #198754;
    --health-pulse-color: rgba(25, 135, 84, 0.45);
}

.health-dot.health-down {
    --health-color: #dc3545;
    --health-pulse-color: rgba(220, 53, 69, 0.45);
}

.health-dot.health-pending {
    --health-color: #ffc107;
    --health-pulse-color: rgba(255, 193, 7, 0.45);
}

.health-dot.health-missing {
    --health-color: #6c757d;
    --health-pulse-color: rgba(108, 117, 125, 0.35);
    animation: none;
}

.health-history-chart-container {
    position: relative;
    height: 260px;
}

.test-icon {
    --test-color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    background-color: var(--test-color);
    color: #fff;
}

.test-icon.test-running {
    --test-color: #0d6efd;
    animation: test-pulse 1.6s ease-in-out infinite;
}

.test-icon.test-passed {
    --test-color: #198754;
}

.test-icon.test-failed {
    --test-color: #dc3545;
}

.test-icon.test-never-ran {
    --test-color: #6c757d;
    animation: none;
}

@keyframes test-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(13, 110, 253, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0);
    }
}

@keyframes health-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--health-pulse-color);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(0, 0, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .health-dot {
        animation: none;
    }
}

.log-viewer {
    --log-grid-template: auto;
    --log-row-line-height: 1.35rem;
    background-color: #1e1e1e;
    color: #f8f9fa;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85rem;
    height: 44rem;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #343a40;
    border-radius: 0.25rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.log-viewer.log-wrap-disabled {
    overflow-x: auto;
}

.log-row {
    --log-row-lines: 1;
    display: grid;
    grid-template-columns: var(--log-grid-template, auto);
    column-gap: 1.25rem;
    align-items: flex-start;
    row-gap: 0.35rem;
    min-height: calc(var(--log-row-lines) * var(--log-row-line-height));
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    background-color: #0f0f0f;
}

.log-cell {
    display: block;
    min-width: 6rem;
    min-height: calc(var(--log-row-lines, 1) * var(--log-row-line-height, 1.35rem));
    word-break: break-word;
    align-self: flex-start;
}

.log-row:nth-child(even) {
    background-color: #1d1d1d;
}

.log-cell.log-cell-truncated {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-viewer.log-wrap-disabled .log-cell:not(.log-stack-trace) {
    white-space: nowrap;
}

.log-cell.log-stack-trace {
    white-space: pre;
    overflow-x: auto;
    overflow-y: hidden;
    word-break: normal;
    margin: 0;
}

.env-list code {
    font-family: inherit;
}
