/* === Global Page Layout === */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    color: #fff;
    background-color: #111;
    display: flex;
    align-items: center;
    justify-content: center;  /* horizontal centering only */
    flex-direction: column;   /* keep content stacked vertically */
    min-height: 100vh;        /* allow content to grow beyond viewport */
    text-align: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    transition: background-image 0.5s ease-in-out;
}

body.bg-waking {
  background-image: url('../waking-up-bg.png');
}
body.bg-hibernating {
  background-image: url('../shutdown-bg.png');
}
body.bg-deleted {
  background-image: url('../deleted-bg.png');
}

body.bg-debug {
    background-image: url('../debug-bg.png');
    background-color: #343619;
    background-size: contain;
    background-position: top center;
    background-attachment: fixed;
}

body.bg-scenarios {
    background-image: url('../scenarios-bg.png');
    background-color: #0c0213;
    background-size: contain;
    background-position: top center;
    background-attachment: fixed;
}

body.bg-troubleshoot {
    background-image: url('../troubleshoot-bg.png');
    background-color: #0c0213;
    background-size: cover;
    background-position: top center;
    background-attachment: fixed;
}

body.bg-handbook {
    background-color: #0d1a2d;
}

body.bg-info {
    background-color: #0d1a2d;
}

body.bg-lockouts {
    background-color: #1a0d2d;
}

body.bg-reset {
    background-color: #2d1a0d;
}

body.bg-hibernate-status {
    background-color: #0d2d1a;
}

/* === Search Input === */
.search-input {
    padding: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 5px;
    border: 1px solid #555;
    background: #2a2a2a;
    color: white;
}

/* === Main Container === */
.container {
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    margin: auto;
    max-width: 900px;
}

/* === Buttons === */
button, .button {
    background: #0c3b13;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    user-select: none;
    display: inline-block;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button:hover, .button:hover {
    transform: translateY(-2px);
}

button:active, .button:active {
    transform: translateY(0);
}

button.btn-primary {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    margin-bottom: 10px;
}

button.btn-logs {
    background: #0c3b13;
}

button.btn-logs-init {
    background: rgb(255, 166, 0);
}

button.delete-all-btn {
    background: #f57c00;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    margin-bottom: 10px;

}

button.delete-btn {
    background: #d9534f;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 5px;
}

button.set-active-btn {
    background: rgb(34, 116, 46);
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 5px;
}

button.set-active-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

button.refresh-btn {
    background: rgb(34, 116, 46);
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    margin-bottom: 10px;
}

button.copy-btn {
    background: #555;
    padding: 2px 4px;
    margin-left: 10px;
    font-size: 14px;
    border-radius: 5px;
}

button.copy-btn:hover {
    background: #666;
}

button.start-btn {
    background: rgb(255, 166, 0);
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    margin-bottom: 10px;
}
button.cancel-btn {
    background: #f44336;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    margin-bottom: 10px;
}
button.home-btn {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    margin-bottom: 10px;
}
button.login-btn {
    background: #0af;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    margin-bottom: 10px;
}
button.hibernation-btn {
    background: #666;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* Left-aligned button group */
.controls-left {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

/* Centered button group */
.controls-center {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Right-aligned button group (optional) */
.controls-right {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
}

/* Code blocks styling */
code {
  background: #444;
  padding: 2px 6px;
  border-radius: 4px;
}

pre {
  background: #444;
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
}

/* color-code appsettings output  */
.json-string { color: #ce9178; }
.json-number { color: #b5cea8; }
.json-boolean { color: #569cd6; }
.json-null { color: #569cd6; font-style: italic; }
.json-key { color: #9cdcfe; }

/* === About Button & Popup === */
.about-container {
    position: fixed;
    top: 20px;
    right: 20px;
    text-align: right;
    z-index: 1000;
}

.about-button {
    width: 35px;
    height: 35px;
    background-color: #455a64;
    color: white;
    font-weight: bold;
    font-size: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: background 0.3s;
}

.about-button:hover {
    background-color: #607d8b;
}

.about-button.active {
    background-color: #3b7691;
    box-shadow: 0 0 10px #81d4fa, 0 0 20px #4fc3f7;
}

.about-popup {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    background: rgba(0,0,0,0.85);
    color: #ccc;
    padding: 15px;
    border-radius: 8px;
    width: 250px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    animation: fadeIn 0.3s ease;
    text-align: left;
    z-index: 1001;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}


/* === Collapsible === */
.collapsible {
    background-color: #333;
    color: white;
    cursor: pointer;
    padding: 10px;
    width: 100%;
    border: none;
    align-items: left;
    justify-content: left;
    text-align: left;
    outline: none;
    font-size: 18px;
    border-radius: 5px;
    margin-bottom: 5px;
}

.collapsible:hover,
.collapsible.active {
    background-color: #444;
}

.collapsible-small {
    background-color: rgba(0, 255, 55, 0.5);
    color: white;
    cursor: pointer;
    padding: 8px;
    width: 100%;
    border: none;
    align-items: left;
    justify-content: left;
    text-align: left;
    outline: none;
    font-size: 12px;
    border-radius: 2px;
    margin-bottom: 2px;
}

.collapsible-small:hover,
.collapsible-small.active {
    background-color: #444;
}

.content {
    padding: 0 15px;
    display: none;
    overflow: hidden;
    margin-bottom: 10px;
    align-items: left;
    justify-content: left;
    text-align: left;
}

.content.show {
    display: block;
}

/* === Cards === */

.card-scenario {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-debug {
    background: rgba(42, 42, 42, 0.5);
    backdrop-filter: blur(5px);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* === Troubleshoot cards === */
.card-troubleshoot {
    background-color: rgba(40, 40, 40, 0.6); /* dark gray with 60% opacity */
    flex-direction: column;
    align-items: stretch;
}

/* Header row inside troubleshoot card */
.card-troubleshoot .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Actions (Restart / Logs buttons) */
.card-troubleshoot .card-actions {
    display: flex;
    gap: 10px;
}

/* To not hide when using search */
.card-troubleshoot-hidden {
  display: none !important;
}


.card {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* === Info box === */
.info-box {
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 4px solid #2196F3;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.5;
    color: #eee;
}

/* === option box === */
.option-box {
    margin: 15px 0;
    text-align: left;
    font-size: 14px;
    background-color: rgba(255,255,255,0.05);
    padding: 10px 15px;
    border-radius: 8px;
    display: inline-block;
}

.option-box label {
    cursor: pointer;
}

.option-box.stacked label {
    display: block;
    margin: 4px 0;
}

/* === status box === */
#status-box {
    margin-top: 20px;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 5px;
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 14px;
}

/* Log colors for different types */
#status-box .log-redis { color: #ffd166; }         /* yellow-ish for Redis */
#status-box .log-user-lockout { color: #4caf50; }  /* green for user lockout */
#status-box .log-error { color: #f44336; }         /* red for errors */
#status-box .log-info { color: #ccc; }             /* default/info gray */

/* Small text labels inside info box */
.delete-btn-text {
    background-color: #d9534f;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}
.delete-all-text {
    background-color: #f57c00;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

/* === Labels === */
.active-label { color: #4caf50; font-weight: bold; margin-left: 10px; }
.inactive-label { color: #f44336; font-weight: bold; margin-left: 10px; }
.single-user-label { color: #ff9800; font-weight: bold; margin-left: 10px; }

/* === Current step (reset.html)=== */
#current-step {
    font-size: 13px;
    color: #aaa;
    margin-top: 5px;
    font-style: italic;
}

#ready-buttons {
    display: none;
    margin-top: 20px;
}

/* === History Modal === */
#historyModal {
    display: none;
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    color: white;
    border: 1px solid #555;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 1000;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    font-family: Arial, sans-serif;
}

#historyModal h3 {
    margin-top: 0;
    font-size: 1.5em;
    color: #fff;
}

#historyModal table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#historyModal th,
#historyModal td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #444;
}

#historyModal th {
    background-color: #222;
    color: #fff;
    position: sticky;
    top: 0;
}

#historyModal tr:hover {
    background-color: #333;
}

#historyModal button {
    margin-top: 20px;
    padding: 8px 16px;
    font-size: 14px;
    background: #444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#historyModal button:hover {
    background: #666;
}

#modalBackdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
}

/* === Tooltip === */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.custom-tooltip {
    visibility: hidden;
    background-color: rgba(50, 50, 50, 0.95);
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 100;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    width: 280px;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.tooltip-wrapper:hover .custom-tooltip {
    visibility: visible;
    opacity: 1;
}

.custom-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(50, 50, 50, 0.95) transparent transparent transparent;
}

/* === Spinner & Progress Bar === */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #0af;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

#progress-bar-container {
    width: 100%;
    background-color: rgba(255,255,255,0.2);
    border-radius: 5px;
    height: 10px;
    margin-top: 15px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background-color: #0af;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 16px;
    color: #ccc;
    margin-top: 10px;
}

.progress-bar-debug-page-container {
    width: 100%;
    height: 4px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.progress-bar-debug-page {
    height: 100%;
    width: 0%;
    background-color: #0af;
    transition: width 50ms linear;
    opacity: 0; /* hidden initially */
}


/* === Spinner (reset.html) === */

.spinner-reset {
    border: 4px solid rgba(255,255,255,0.2);
    border-top: 4px solid #0af;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}

/* === Loading Overlay === */
#loadingOverlay {
    display: none; /* HIDDEN by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    color: white;
    font-size: 20px;
    font-weight: bold;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* === Animations === */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Toast notifications */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(50,50,50,0.9);
    color: white;
    padding: 12px 18px;
    border-radius: 6px;
    min-width: 200px;
    font-size: 15px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideIn 0.4s forwards;
}

.toast.success { border-left: 4px solid #4caf50; }
.toast.error { border-left: 4px solid #f44336; }
.toast.info { border-left: 4px solid #2196f3; }

/* Status badge on the debug page */
.status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    color: white;
    font-weight: bold;
}

.status-badge.on { 
    background-color: green; 
}
.status-badge.off { 
    background-color: gray; 
}
.status-badge.partial {
    background-color: orange;
}

/* Troubleshoot page */
/* === Logs panel === */
.logs-panel {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #444;
    text-align: left;
}

/* Container buttons */
.container-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

/* Logs controls row */
.logs-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Log output */
.logs-box {
    background: #111;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;     /* ✅ multiline */
    word-break: break-word;
    font-family: monospace;
    font-size: 13px;
    color: #e0e0e0;
}

/* Container for existing env vars list in troubleshooting page*/
.env-list-box {
    margin-top: 10px;
    padding: 12px;
    background: #1e1e1e;        /* dark panel background */
    color: #fff;                 /* white text */
    border-radius: 5px;
    font-family: monospace;
    font-size: 14px;
    max-height: 200px;           /* scroll if too many */
    overflow-y: auto;
    text-align: left;            /* left align text */
}

/* Individual env var row */
.env-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #333;
}

/* Last row has no border */
.env-list-row:last-child {
    border-bottom: none;
}

/* Checkbox style */
.env-list-row input[type="checkbox"] {
    margin-right: 8px;
}

.env-existing {
    margin-top: 16px;
    text-align: left;
}

.env-existing strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.env-list-box label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-family: monospace;
    font-size: 13px;
    color: #fff;
}

.env-list-box input[type="checkbox"] {
    accent-color: #2196f3; /* checkbox color */
}

.env-existing .remove-btn {
    margin-top: 6px;
    display: inline-block;
}

/* === Health Page === */
body.bg-health {
    background-color: #0d1a2d;
}

.health-summary {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    flex-wrap: wrap;
}

.summary-item {
    font-size: 15px;
    color: #ccc;
    padding: 4px 12px;
    border-radius: 4px;
}

.summary-item strong {
    font-size: 18px;
}

.summary-total strong { color: #fff; }
.summary-healthy strong { color: #4caf50; }
.summary-warning strong { color: #ff9800; }
.summary-error strong { color: #f44336; }

.card-health {
    background: #2a2a2a;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid transparent;
    cursor: pointer;
    transition: background 0.2s;
}

.card-health:hover {
    background: #333;
}

.card-health-healthy { border-left-color: #4caf50; }
.card-health-warning { border-left-color: #ff9800; }
.card-health-error   { border-left-color: #f44336; }

.card-health .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.card-health .card-title {
    font-weight: bold;
    font-size: 14px;
}

.pod-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.pod-status-indicator.status-healthy { background-color: #4caf50; }
.pod-status-indicator.status-warning { background-color: #ff9800; }
.pod-status-indicator.status-error   { background-color: #f44336; }

.card-health-meta {
    margin-left: auto;
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 13px;
    color: #aaa;
}

.health-meta-item {
    white-space: nowrap;
}

.status-badge.healthy { background-color: #4caf50; }
.status-badge.warning { background-color: #ff9800; }
.status-badge.error   { background-color: #f44336; }

.health-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #444;
    font-size: 13px;
}

.health-details table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.health-details th {
    text-align: left;
    color: #999;
    padding: 4px 8px;
    border-bottom: 1px solid #444;
    font-size: 12px;
    text-transform: uppercase;
}

.health-details td {
    padding: 4px 8px;
    color: #ddd;
    border-bottom: 1px solid #333;
    word-break: break-word;
}

.health-details .issue-label {
    font-weight: bold;
    margin-bottom: 4px;
    color: #ff9800;
}

.event-row {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid #333;
    font-size: 13px;
    align-items: flex-start;
}

.event-row:last-child {
    border-bottom: none;
}

.event-reason {
    color: #ff9800;
    font-weight: bold;
    min-width: 120px;
    flex-shrink: 0;
}

.event-object {
    color: #9cdcfe;
    min-width: 150px;
    flex-shrink: 0;
}

.event-message {
    color: #ddd;
    flex: 1;
    word-break: break-word;
}

.event-meta {
    color: #888;
    font-size: 12px;
    min-width: 100px;
    text-align: right;
    flex-shrink: 0;
}

.health-log-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.btn-logs-prev {
    background-color: #555;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-logs-prev:hover {
    background-color: #777;
}

.health-logs-panel {
    margin-top: 10px;
    border: 1px solid #444;
    border-radius: 6px;
    overflow: hidden;
}

.health-logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #333;
    font-size: 13px;
    color: #ccc;
}

.health-logs-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.follow-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
}

.health-logs-box {
    background: #111;
    color: #ddd;
    font-family: monospace;
    font-size: 12px;
    padding: 10px;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.health-warning-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    margin-bottom: 15px;
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid #ff9800;
    border-radius: 8px;
    color: #ffcc80;
    font-size: 14px;
}

.health-warning-link {
    color: #ff9800;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}

.health-warning-link:hover {
    text-decoration: underline;
}

.card-health-hidden {
    display: none !important;
}