/* Visually indicate disabled locker action buttons */
.action-btn:disabled,
.action-btn-disabled {
    background: #444 !important;
    color: #888 !important;
    border: 1px solid #666 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    box-shadow: none !important;
    text-decoration: line-through;
}
:root{
    --gold: #ffd700;
    --gold-strong: #ffed4e;
    --bg-dark: rgba(20,20,20,0.9);
    --panel-dark: rgba(30,30,30,0.7);
    --muted: #ccc;
    --text: #f2f2f2;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    background: url('../img/bg.webp') no-repeat center center fixed;
    background-size: cover;
    color: var(--text); /* lighter font color for dark background */
    /* overflow: hidden;  Allow body to scroll naturally */
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-dark);
    padding: 30px 0 10px 0;
    text-align: center;
    z-index: 10;
    backdrop-filter: blur(5px);
}


/* Remove old .user-info, add new .user-info-in-menu for menu frame top right */
.user-info-in-menu {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    font-size: 14px;
    color: #ccc;
    min-width: 120px;
    padding-right: 24px;
}

.logged-in-user {
    color: #ccc;
}

.logged-in-user strong {
    color: var(--gold);
    font-weight: 600;
}

.menu-frame,
.menu-frame.full-width {
    position: fixed;
    top: 50px; /* Position below smaller header */
    left: 32px;
    right: 32px;
    margin: 0;
    width: calc(100vw - 64px);
    max-width: calc(100vw - 64px);
    border: 2px solid #ffd700;
    border-radius: 12px;
    background: rgba(20,20,20,0.8);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    padding: 0.5em 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.menu-logo {
    height: 38px;
    width: auto;
    margin-left: 16px;
    margin-right: 20px;
}

.menu-bar {
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    width: 100%;
}

.menu-bar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-start;
    flex-grow: 1;
    gap: 0;
}

.menu-bar li {
    display: inline;
}

.menu-bar a {
    color: #f2f2f2;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5em 1em;
    border-radius: 4px;
    transition: background 0.2s;
}

.menu-bar a:hover {
    background: rgba(255, 215, 0, 0.2); /* gold highlight on hover */
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(20,20,20,0.9);
    padding: 30px 0 10px 0;
    text-align: center;
    z-index: 10;
    backdrop-filter: blur(5px);
}

h1 {
    margin: 0;
    font-size: 2.5em;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
}

#dynamic-content {
    position: fixed;
    top: 110px; /* Below smaller header and menu */
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 20px 32px;
    padding-bottom: 2px; /* reduce bottom padding to allow table closer to edge */
}

nav {
    margin: 20px 0;

}

nav a {
    margin: 0 15px;
    text-decoration: none;
    color: #f2f2f2;
}

nav a:hover {
    text-decoration: underline;
    color: #ffffff; /* gold highlight on hover */
}

main {
    padding: 20px;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: transparent;
    margin-top: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    background: rgba(30,30,30,0.7);
    color: #f2f2f2;
    font-family: 'Montserrat', Arial, sans-serif;
}

/* Table Container for Scrolling */
.table-container {
    /* Constrain table height to viewport minus header/menu area to avoid body overflow */
    max-height: calc(100vh - 120px);
    overflow-y: auto; /* allow scrolling when content is tall */
    overflow-x: auto;
    border: 2px solid #ffd700;
    border-radius: 8px;
    background: rgba(30,30,30,0.7);
    margin-top: 10px;
    margin-bottom: 8px; /* reduce bottom margin to minimize overflow */
}

/* Sticky table header */
.table-container thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255,215,0,0.9) !important;
    color: #000 !important;
}

.admin-table th, .admin-table td {
    border: 1px solid #ffd700;
    padding: 8px 6px;
    text-align: center;
}

.admin-table th {
    background: rgba(255,215,0,0.2);
    font-weight: 700;
    letter-spacing: 1px;
}

.admin-table tr:nth-child(even):not(.location-header) {
    background: rgba(255,255,255,0.05);
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: #ffd700;
    color: #222;
    padding: 6px 14px;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.dropbtn:hover, .dropbtn:focus {
    background-color: #ffe066;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    min-width: 160px;
    background-color: #222;
    border: 1px solid #ffd700;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 20;
}

.dropdown-content a {
    color: #ffd700;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 1em;
    transition: background 0.2s, color 0.2s;
}

.dropdown-content a:hover {
    background-color: #ffd700;
    color: #222;
}

.admin-table th:nth-child(1),
.admin-table td:nth-child(1),
.admin-table th:nth-child(2),
.admin-table td:nth-child(2),
.admin-table th:nth-child(3),
.admin-table td:nth-child(3),
.admin-table th:nth-child(5),
.admin-table td:nth-child(5) {
    text-align: left;
    padding-left: 16px;
}

/* Status column - set minimum width to accommodate "ChargeDone" */
.admin-table th:nth-child(8),
.admin-table td:nth-child(8) {
    min-width: 100px;
    text-align: center;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    /* remove flexbox centering */
}

.modal-content {
    background: #222;
    color: #ffd700;
    padding: 32px 24px 24px 24px;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    max-width: 320px;
    margin: auto;
    text-align: center;
}

.modal-actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 16px;
}

.modal-btn {
    background: #ffd700;
    color: #222;
    border: none;
    border-radius: 4px;
    padding: 8px 22px;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-btn:hover {
    background: #e5c200;
}

/* Status Change Toast Notification */
.status-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 300px;
    background: #2a2a2a;
    border: 1px solid #ffd700;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transform: translateX(320px);
    transition: transform 0.3s ease-in-out;
    font-size: 13px;
    opacity: 0;
    visibility: hidden;
}

.status-toast.show {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #1a1a1a;
    border-bottom: 1px solid #444;
    border-radius: 7px 7px 0 0;
}

.status-change-icon {
    font-size: 14px;
    margin-right: 6px;
}

.toast-title {
    color: #ffd700;
    font-weight: 600;
    font-size: 12px;
    flex-grow: 1;
}

.toast-close {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    color: #fff;
}

.toast-content {
    padding: 10px 12px;
    color: #ddd;
}

.toast-line {
    margin-bottom: 4px;
}

.toast-line strong {
    color: #ffd700;
}

/* Status dashboard styles moved from status-section.php */
.status-row { display:flex; gap:24px; margin:24px 0; }
.status-card { background: rgba(30,30,30,0.72); color:#fff; padding:18px; border-radius:8px; flex:1; min-height:140px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; border: 1px solid rgba(255,255,255,0.04); box-shadow: 0 2px 8px rgba(0,0,0,0.3); backdrop-filter: blur(4px); }
.status-card-header { font-family: 'Montserrat', sans-serif; font-size:20px; color:#ffd700; margin-bottom:8px; }
.status-card-count { font-size:164px; font-weight:800; margin-bottom:4px; }
.status-card .subtle { color:#ccc; font-size:13px; }
.status-changes { margin:10px auto 0 auto; background: rgba(0,0,0,0.6); padding:10px; border-radius:8px; max-width:1100px; width:92%; }
.status-changes table { width:100%; border-collapse:collapse; color:#fff; }
.status-changes th, .status-changes td { padding:10px 8px; text-align:left; border-bottom:1px solid rgba(255,255,255,0.03); font-size:18px; }
.status-changes th { color:#ffd700; font-weight:700; }
.status-changes .status-from { color:#ccc; }
.status-changes .status-to { font-weight:700; }

/* Scrollable wrapper for recent status changes to avoid overflow on small screens */
.status-changes-body-wrap {
    max-height: 36vh; /* responsive: ~36% of viewport height on small screens */
    overflow-y: auto;
    padding-right: 6px; /* room for scrollbar */
}

@media (min-width: 900px) {
    .status-changes-body-wrap {
        max-height: 400px; /* fixed max height on larger screens */
    }
}

/* Thin, subtle scrollbar for modern browsers */
.status-changes-body-wrap::-webkit-scrollbar { width:8px; }
.status-changes-body-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius:4px; }

/* Small button used in status header */
.btn-small {
    background: rgba(255,255,255,0.04);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.06);
    padding:6px 10px;
    border-radius:6px;
    font-size:13px;
    cursor:pointer;
}
.btn-small:hover { background: rgba(255,255,255,0.06); }

/* Full-screen centered section spinner overlay */
.section-spinner { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.35); z-index: 2000; }
.spinner-circle { width: 56px; height: 56px; border: 6px solid rgba(255,255,255,0.12); border-top-color: #ffd700; border-radius: 50%; animation: spin 1s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.toast-time {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.old-status {
    color: #ff6b6b;
    font-weight: 600;
    padding: 1px 4px;
    background: rgba(255, 107, 107, 0.2);
    border-radius: 2px;
    font-size: 11px;
}

.new-status {
    color: #4ecdc4;
    font-weight: 600;
    padding: 1px 4px;
    background: rgba(78, 205, 196, 0.2);
    border-radius: 2px;
    font-size: 11px;
}

.toast-actions {
    padding: 8px 12px;
    text-align: right;
    border-top: 1px solid #444;
}

.toast-btn {
    background: #ffd700;
    color: #222;
    border: none;
    border-radius: 3px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.toast-btn:hover {
    background: #e5c200;
}

.active-menu {
    border-bottom: 3px solid #ffd700;
    background: rgba(255,215,0,0.15);
    color: #ffd700 !important;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255,215,0,0.15);
    transition: background 0.2s, color 0.2s;
}

/* Collapsible Location Styles */
.location-header {
    background-color: #4a4a4a !important;
    color: #ffffff !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease;
}

.location-header:hover {
    background-color: #333333 !important;
}

.location-header td {
    border: 1px solid #ffd700 !important;
    padding: 8px 6px !important;
}

.location-arrow {
    font-size: 12px;
    margin-right: 8px;
    transition: transform 0.2s ease;
}

.locker-row {
    transition: all 0.3s ease;
    background: rgba(30,30,30,0.7) !important;
}

.locker-row:nth-child(even) {
    background: rgba(255,255,255,0.05) !important;
}

.locker-row td:first-child {
    padding-left: 20px !important;
    color: #666;
}

/* Search Box Styles */
.search-container {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

#locker-search {
    width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.2s ease;
}

#locker-search:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

#chargers-search {
    width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.2s ease;
}

#chargers-search:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

#locations-search {
    width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.2s ease;
}

#locations-search:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.search-container button {
    padding: 8px 12px;
    background: #666;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.search-container button:hover {
    background: #555;
}

/* Search Highlighting Styles */
.search-highlight {
    background-color: #ffd700;
    color: #222;
    font-weight: bold;
    padding: 1px 2px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Expand/Collapse All Buttons */
.expand-collapse-buttons {
    display: flex;
    gap: 5px;
}

.expand-collapse-buttons button {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #666;
    color: white;
}

.expand-collapse-buttons button:hover {
    background: #555;
    transform: translateY(-1px);
}

/* Custom Scrollbar Styling */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(255,215,0,0.5);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255,215,0,0.7);
}

.table-container::-webkit-scrollbar-corner {
    background: rgba(30,30,30,0.7);
}

/* Edit Locker Styles */
.edit-locker-container {
    margin: 20px 32px;
    background: rgba(20,20,20,0.8);
    border: 2px solid #ffd700;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    font-family: Arial, sans-serif;
    color: #f2f2f2;
}

.edit-locker-container h2 {
    margin: 0 0 30px 0;
    font-size: 1.8em;
    font-weight: bold;
    color: #ffd700;
    border-bottom: 2px solid #ffd700;
    padding-bottom: 10px;
}

.form-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.readonly-section,
.editable-section,
.actions-section {
    flex: 1;
}

.readonly-section {
    border-right: 1px solid #555;
    padding-right: 20px;
}

.editable-section {
    border-right: 1px solid #555;
    padding-right: 20px;
}

.readonly-section h3,
.editable-section h3,
.actions-section h3 {
    margin: 0 0 20px 0;
    font-size: 1.3em;
    color: #ffd700;
    font-weight: bold;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    background: #ffd700;
    color: #000;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    width: 150px;
    margin: 0 auto;
}

.action-btn:hover {
    background: #ffed4e;
}

.action-btn:active {
    background: #e6c200;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #f2f2f2;
}

.form-group input,
.form-group select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 1px solid #555;
    border-radius: 4px;
    background: rgba(40,40,40,0.9);
    color: #f2f2f2;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 5px rgba(255,215,0,0.3);
}

.form-group input[readonly] {
    background: rgba(60,60,60,0.9);
    color: #ccc;
    cursor: not-allowed;
}

/* Consolidated form-actions: combines spacing, top border and flex layout */
.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #555;
    display: flex;
    gap: 15px;
    clear: both;
}

.form-actions button {
    padding: 12px 20px;
    margin-right: 15px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    font-family: Arial, sans-serif;
}

.form-actions button[type="submit"] {
    background: #ffd700;
    color: #000;
}

.form-actions button[type="submit"]:hover {
    background: #ffed4e;
}

.form-actions button[type="button"] {
    background: rgba(60,60,60,0.9);
    color: #f2f2f2;
}

.form-actions button[type="button"]:hover {
    background: rgba(80,80,80,0.9);
}

/* Activities Section Styles */
.activities-section {
    margin-top: 30px;
    padding: 20px;
    background: rgba(30,30,30,0.7);
    border: 2px solid #ffd700;
    border-radius: 8px;
}

.activities-section h3 {
    color: #ffd700;
    font-family: 'Montserrat', Arial, sans-serif;
    margin-bottom: 15px;
    font-size: 18px;
}

.activities-table-container {
    background: rgba(20,20,20,0.5);
    border-radius: 4px;
    overflow: hidden;
}

.activities-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

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

.activities-table th {
    background: rgba(255,215,0,0.9);
    color: #000;
    font-weight: 600;
    font-size: 14px;
}

.activities-table td {
    color: #ddd;
    font-size: 13px;
}

.timestamp-column {
    width: 160px;
    min-width: 160px;
    font-family: monospace;
    white-space: nowrap;
}

.activities-table tbody tr:hover {
    background: rgba(255,215,0,0.1);
}

.activities-actions {
    padding: 10px;
    text-align: center;
    background: rgba(20,20,20,0.3);
}

.show-more-btn {
    background: #ffd700;
    color: #222;
    border: none;
    border-radius: 4px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.show-more-btn:hover {
    background: #e5c200;
}

.show-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #999;
}

.show-more-btn:disabled:hover {
    background: #999;
}

/* Activities Loading and Error States */
.activities-loading {
    text-align: center;
    padding: 40px;
    font-size: 1.1em;
    color: #ffd700;
    background: rgba(30,30,30,0.5);
    border-radius: 4px;
}

.activities-error {
    padding: 15px;
    background: rgba(255,0,0,0.1);
    border: 1px solid #ff4444;
    border-radius: 4px;
    color: #ff6666;
    text-align: center;
}

#loading-message {
    text-align: center;
    padding: 40px;
    font-size: 1.1em;
    color: #ffd700;
}

#error-message {
    padding: 15px;
    background: rgba(255,0,0,0.1);
    border: 1px solid #ff4444;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Responsive design for smaller screens */
@media (max-width: 1024px) {
    .form-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .readonly-section,
    .editable-section {
        border-right: none;
        border-bottom: 1px solid #555;
        padding-right: 0;
        padding-bottom: 20px;
    }
    
    .actions-section {
        border-bottom: none;
        padding-bottom: 0;
    }
}

@media (max-width: 768px) {
    .action-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

/* Status styling */
.status-free {
    background-color: #28a745;
    color: white;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
}

.status-timeout {
    background-color: #dc3545;
    color: white;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
}

/* Chargers table styling */
#chargers-table {
    width: 100%;
    table-layout: fixed;
}

#chargers-table th:nth-child(1) { /* Charger Name */
    width: 25%;
}

#chargers-table th:nth-child(2) { /* Description */
    width: 45%;
}

#chargers-table th:nth-child(3) { /* # Installed */
    width: 15%;
    text-align: center;
}

#chargers-table th:nth-child(4) { /* Actions */
    width: 15%;
    text-align: center;
}

#chargers-table td:nth-child(3) { /* # Installed column */
    text-align: center;
}

#chargers-table td:nth-child(4) { /* Actions column */
    text-align: center;
}

/* Button styling improvements */
.btn-success {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 8px;
    transition: background-color 0.3s;
}

.btn-success:hover {
    background-color: #218838;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Sortable table headers */
.admin-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px;
}

.admin-table th.sortable:hover {
    background-color: #e9ecef;
}

.admin-table th.sortable::after {
    content: "↕";
    position: absolute;
    right: 8px;
    opacity: 0.5;
    font-size: 12px;
}

.admin-table th.sortable.sort-asc::after {
    content: "↑";
    opacity: 1;
}

.admin-table th.sortable.sort-desc::after {
    content: "↓";
    opacity: 1;
}

/* Hover effect for charger table rows */
#chargers-tbody tr:hover {
    background-color: rgba(255, 215, 0, 0.1);
}

/* Charger Table Image Preview Styles */
.charger-preview-cell {
    width: 80px;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.charger-preview-img {
    max-width: 50px;
    max-height: 40px;
    width: auto;
    height: auto;
    object-fit: contain;
    -o-object-fit: contain; /* Opera */
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #ddd;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
}

.charger-preview-img:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-color: #ffd700;
}

.charger-no-image {
    color: #999;
    font-style: italic;
    font-size: 12px;
}

/* Full-size Image Modal Styles */
.image-modal-content {
    background: #222;
    border: 2px solid #ffd700;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
}

.image-modal-content .modal-header {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #222;
    padding: 16px 24px;
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid #e6c200;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.image-modal-content .modal-header h3 {
    margin: 0;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 700;
    font-size: 18px;
}

.image-modal-content .close {
    color: #222;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content .close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.image-modal-body {
    padding: 24px;
    text-align: center;
    position: relative;
    background: #222;
    border-radius: 0 0 10px 10px;
}

.image-modal-body img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
}

.image-modal-body .image-loading {
    display: none;
    padding: 60px 40px;
    color: #ffd700;
    font-size: 18px;
    font-family: 'Montserrat', Arial, sans-serif;
}

.image-modal-body.loading img {
    display: none;
}

.image-modal-body.loading .image-loading {
    display: block;
}

/* Edit Charger Page Styles */
.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ffd700;
}

.edit-header h2 {
    margin: 0;
    color: #ffd700;
    font-family: 'Montserrat', Arial, sans-serif;
    font-weight: 700;
}

.back-btn {
    padding: 8px 16px;
    background: #666;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.back-btn:hover {
    background: #555;
}

.edit-form {
    max-width: 900px;
    background: rgba(34, 34, 34, 0.95);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #444;
}

/* Duplicate .form-layout removed - canonical definition exists earlier and responsive behavior is handled by media queries */

.form-column-left {
    flex: 1;
    min-width: 300px;
}

.form-column-right {
    flex: 0 0 300px;
    min-width: 300px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #ffd700;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="file"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #666;
    border-radius: 4px;
    background: #333;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.form-group input[readonly] {
    background: #444;
    color: #ccc;
    cursor: not-allowed;
}

.current-image-container {
    padding: 15px;
    border: 1px solid #666;
    border-radius: 4px;
    background: #333;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-image-container img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 4px;
}

.no-image-text {
    color: #999;
    font-style: italic;
}

.form-help {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.btn-primary {
    padding: 12px 24px;
    background: #ffd700;
    color: #222;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background: #ffe066;
}

.btn-secondary {
    padding: 12px 24px;
    background: #666;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background: #555;
}

.loading-message,
.error-message {
    padding: 20px;
    text-align: center;
    border-radius: 4px;
    margin-bottom: 20px;
}

.loading-message {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    border: 1px solid #ffd700;
}

.error-message {
    background: rgba(255, 0, 0, 0.1);
    color: #ff6666;
    border: 1px solid #ff6666;
}

/* Responsive design for edit form */
@media (max-width: 768px) {
    .form-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .form-column-right {
        flex: 1;
        min-width: auto;
    }
    
    .edit-form {
        max-width: 100%;
        margin: 0 15px;
    }
}

/* In Production Status Styling */
.in-production-yes {
    background-color: #28a745 !important;
    color: white !important;
    font-weight: bold;
    text-align: center;
}

.in-production-no {
    background-color: transparent;
    color: #f2f2f2;
    text-align: center;
}

/* Checkbox container and alignment styles for edit forms */
.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 10px;
    text-align: left;
    line-height: 1.4;
}

.checkbox-input {
    width: auto !important;
    max-width: none !important;
    margin: 0 10px 0 0 !important;
    padding: 0 !important;
    transform: scale(1.1);
    flex-shrink: 0;
    vertical-align: middle;
    position: relative;
    top: 0;
}

.checkbox-label {
    color: white !important;
    cursor: pointer !important;
    font-weight: normal !important;
    margin: 0 !important;
    flex: 1;
    text-align: left !important;
    display: flex !important;
    align-items: center !important;
    line-height: 1.4 !important;
    font-size: 14px !important;
}

.applications-container {
    background: rgba(20,20,20,0.5);
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #555;
    min-height: 200px;
    text-align: left;
}