/* === 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;
}

/* === 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.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.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;
}

.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;
}

/* === 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); }
}

/* 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; }

/* 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;
}