﻿/* Base Styles */
body {
    font-family: Arial, sans-serif;
}

/* Container Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
}

/* UK Refresh Alert */
.uk-refresh-alert {
    background-color: #d1ecf1;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border-left: 4px solid #0c5460;
    display: flex;
    align-items: center;
    gap: 15px;
}

.uk-refresh-alert-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.uk-refresh-alert-content {
    flex-grow: 1;
}

.uk-refresh-alert-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.uk-refresh-alert-link {
    color: #0c5460;
    font-weight: bold;
    text-decoration: none;
}

.uk-refresh-alert-link:hover {
    text-decoration: underline;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th, 
.table td {
    padding: 12px;
    border: 1px solid darkgray;
    text-align: left;
    vertical-align: top;
}

.table th {
    background-color: darkgray;
    color: #fff;
}

.table tbody tr:nth-child(even) {
    background-color: lightgrey;
}

.table tbody tr:target {
    background-color: #fff3b0;
    outline: 4px solid #f0ad4e;
    outline-offset: -4px;
    scroll-margin-top: 12px;
}

/* Map Container Styles */
.map-container {
    width: 200px;
    height: 150px;
    border: 2px solid #ccc;
    border-radius: 4px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.map-container:hover {
    border-color: #337ab7;
    box-shadow: 0 0 5px rgba(51, 122, 183, 0.5);
}

.map-details {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

a:has(.map-container) {
    text-decoration: none;
    display: block;
}

a:has(.map-container):hover .map-container {
    border-color: #337ab7;
}

/* Status Indicators */
.status-circle {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    color: white;
    font-size: 14px;
}

.status-circle.completed {
    background-color: green;
}

.status-circle.failed {
    background-color: red;
}

.connection-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 10px;
}

.connection-status.connected {
    background-color: #28a745;
}

.connection-status.disconnected {
    background-color: #dc3545;
}

.connection-status.error {
    background-color: #ffc107;
}

/* Stats Section */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    flex: 1 1 calc(33.333% - 20px);
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

.stats-item > :not(.stats-completion) {
    position: relative;
    z-index: 1;
}

.stats-completion {
    appearance: none;
    background: transparent;
    border: 0;
    height: 100%;
    inset: 0;
    pointer-events: none;
    position: absolute;
    width: 100%;
}

.stats-completion::-webkit-progress-bar {
    background: transparent;
}

.stats-completion::-webkit-progress-value {
    background-color: #eeeeee;
}

.stats-completion::-moz-progress-bar {
    background-color: #eeeeee;
}

.stats-item svg {
    flex-shrink: 0;
}

.stats-item span {
    font-size: 1.2em;
}

/* Messages */
.message {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 1em;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-text {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    font-style: italic;
}

/* Progress Bars */
.progress {
    height: 20px;
    margin-bottom: 5px;
    background-color: #f5f5f5;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}

.progress-bar {
    float: left;
    height: 100%;
    font-size: 12px;
    line-height: 20px;
    color: #fff;
    text-align: center;
    background-color: #337ab7;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
    transition: width 0.5s ease-in-out;
    min-width: 2em;
}

.progress-bar.progress-complete {
    background-color: #28a745;
}

.progress-bar.progress-zero {
    background-color: #6c757d;
}

/* Progress percentage classes using CSS custom property */
.progress-bar {
    --progress: 0;
    width: calc(var(--progress) * 1%);
}

/* Job Status Styles */
.running-job-row {
    background-color: rgba(255, 255, 0, 0.1);
}

.completed-job-row {
    background-color: rgba(0, 255, 0, 0.1);
}

.failed-job-row {
    background-color: rgba(255, 0, 0, 0.1);
}

/* Stage Info */
.stage-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 5px;
}

/* Status Cell */
.status-cell {
    font-weight: bold;
}

.status-cell:empty::before {
    content: "Pending";
    color: #6c757d;
    font-style: italic;
}

.text-warning {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 10px;
    border-radius: 4px;
}
