.action-button {
    color: var(--background-color); /* Typically black */
    background-color: var(--secondary-color); /* Bold yellow */
    padding: var(--standard-pad);
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    text-align: center;
    border: none;
    letter-spacing: 0.5px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(255, 255, 0, 0.2);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    user-select: none;
}

.action-button:hover {
    background-color: var(--secondary-hover-color); /* Slightly darker yellow */
    box-shadow: 0 0 10px rgba(255, 221, 0, 0.5);
    transform: translateY(-1px);
}

.action-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(255, 255, 0, 0.2);
}

.action-button:disabled {
    background-color: #555;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}


.emergency-button {
    color: var(--background-color); /* Typically black or white depending on your background */
    background-color: #cc0000; /* Bold red */
    padding: var(--standard-pad);
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    text-align: center;
    border: none;
    letter-spacing: 0.5px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(204, 0, 0, 0.4);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.emergency-button:hover {
    background-color: #a30000; /* Darker red */
    box-shadow: 0 0 10px rgba(163, 0, 0, 0.7);
    transform: translateY(-1px);
}

.emergency-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(204, 0, 0, 0.2);
}

.emergency-button:disabled {
    background-color: #555;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}


.emergency-toggle-container {
    display: inline-block;
    margin-bottom: 1em;
    user-select: none;
}

.emergency-toggle {
    position: relative;
    display: inline-block;
    height: 100%;
    padding-left: 2em;
    padding-right: 2em;
    cursor: pointer;
    perspective: 600px;
    vertical-align: middle;
}

.emergency-toggle input {
    display: none;
}

/* The flip cover (the red safety cover) */
.cover {
    position: absolute;
    height: 100%;
    padding-left: 2em;
    padding-right: 2em;

    background: var(--emergency-color, #c0392b); /* dark red */
    border-radius: 8px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
    transform-origin: left center;
    transition: transform 0.3s ease;
    z-index: 2;

    /* Add some text on cover */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-family: 'Arial Black', sans-serif;
    letter-spacing: 1.5px;
    font-size: 0.9rem;
    text-transform: uppercase;
    user-select: none;
}

/* Text behind the cover */
.switch-text {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    text-align: center;
    font-weight: 600;
    font-family: Arial, sans-serif;
    font-size: 0.85rem;
    color: var(--text-color, #eee);
    pointer-events: none;
    user-select: none;
    z-index: 1;
    letter-spacing: 1px;
}

/* When toggled, flip the cover up */
.emergency-toggle input:checked + .cover {
    transform: rotateY(-110deg);
    box-shadow: none;
    background: #27ae60; /* green to show “safe” open state */
    color: #fff;
}



input,
select {
    color: white !important;
    background-color: #111 !important; /* Deep black for contrast */
    border: 2px solid var(--secondary-color); /* Bold yellow border */
    border-radius: 4px;
    padding: var(--half-pad);
    color-scheme: dark;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.05);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

textarea {
    color: white !important;
    background-color: #111 !important;
    border: 2px solid var(--secondary-color);
    border-radius: 4px;
    padding: var(--half-pad);
    color-scheme: dark;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.05);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

/* Placeholder text */
input::placeholder,
textarea::placeholder {
    color: #bbb;
    opacity: 1;
}

/* Focus state */
input:focus,
select:focus,
textarea:focus {
    border-color: #ffc107; /* Brighter yellow on focus */
    box-shadow: 0 0 6px 2px rgba(255, 208, 0, 0.4);
}

/* Disabled inputs */
input:disabled,
select:disabled,
textarea:disabled {
    background-color: #222 !important;
    border-color: #555 !important;
    color: #777 !important;
    cursor: not-allowed;
}

input:read-only,
textarea:read-only {
    background-color: #1a1a1a !important;  /* Slightly lighter than active bg */
    color: #bbb !important;               /* Dimmed text */
    border-color: #444 !important;        /* Muted border */
    cursor: not-allowed;
/*     opacity: 0.8; */
}

input:read-only:hover,
textarea:read-only:hover {
    border-color: #555 !important;
}



.alert-box {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: black;
    color: white;
    border: 2px solid var(--secondary-color); /* Yellow border */
    padding: 1rem 1.5rem;
    border-radius: 6px;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(255, 221, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideUp 0.3s ease-out;
    max-width: 90vw;
}

.alert-box.success {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.alert-box.error {
    border-color: red;
    color: red;
}

.close-alert {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}


.loading-overlay {
    display: flex; /* Hidden by default */
    width: 100%; /* Full width (cover the whole page) */
    height: 100%; /* Full height (cover the whole page) */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.95); /* Black background with opacity */
    z-index: 10; /* Specify a stack order in case you're using a different order for other elements */
}

.loading-overlay-contents{
    margin: auto auto auto auto;
}

.loader {
    border: 16px solid #f3f3f3; /* Light grey */
    border-top: 16px solid var(--secondary-color); /* Blue */
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



.overlay {
    position: fixed; /* Sit on top of the page content */
    display: none; /* Hidden by default */
    width: 100%; /* Full width (cover the whole page) */
    height: 100%; /* Full height (cover the whole page) */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.95); /* Black background with opacity */
    z-index: 2; /* Specify a stack order in case you're using a different order for other elements */
}

.overlay-contents{

    min-width: 20em;
    max-width: 75%;
    max-height: 75%;

    background-color: rgba(0,0,0,1);
    margin: auto auto auto auto;

    padding: 1.5em 1.5em 1.5em 1.5em;
    overflow: auto;

    border-style: solid;
    border-width: 2px;
    border-color: var(--secondary-color);
}

