/* =========================================================
   BASE LAYOUT
========================================================= */

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f2f2f2;
}

.container {
    max-width: 500px; /* Scanner width */
    margin: auto;
    margin-top: 15px;
    padding: 15px;
    text-align: center;
    border: #0b0894 3px solid;
}

/* Admin layout override */
.admin-container {
    max-width: 1100px;
    padding: 20px;
}


/* =========================================================
   HEADINGS
========================================================= */

h2 {
    text-align: center;
}


/* =========================================================
   FORM CONTROLS
========================================================= */

select,
input,
button {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    margin: 8px 0;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

button {
    background-color: #2c3e50;
    color: white;
    border: none;
    cursor: pointer;
}

button:active {
    opacity: 0.85;
}

/* Button Variants */

.logout-btn {
    background-color: #c0392b;
}

.export-btn {
    background-color: #27ae60;
}


/* =========================================================
   SCANNER PAGE
========================================================= */

#reader {
    width: 100%;
    margin-top: 10px;
}

#result {
    margin-top: 15px;
    font-size: 28px;
    font-weight: bold;
    min-height: 60px;
    padding: 10px;
    border-radius: 8px;
}

/* Confirmation Panel */

.confirm-panel {
    display: none;
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.confirm-name {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 10px;
}

.confirm-details {
    margin-bottom: 15px;
}

.confirm {
    background: #27ae60;
}

.cancel {
    background: #c0392b;
}


/* =========================================================
   ADMIN PAGE
========================================================= */

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.controls input,
.controls select,
.controls button {
    width: auto;
    flex: 1;
    padding: 10px;
    font-size: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    background-color: #2c3e50;
    color: white;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 768px) {

    .admin-container {
        padding: 15px;
    }

    .controls {
        flex-direction: column;
    }

    .controls input,
    .controls select,
    .controls button {
        width: 100%;
    }
}


/* =========================================================
   TOP RIGHT HAMBURGER MENU (SECURITY PAGE)
========================================================= */

.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
}

/* Parent container */
.menu {
    position: relative;
}

/* Hamburger button */
#menuToggle {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Override global full-width rule for hamburger */
.top-bar #menuToggle {
    width: 40px;
}

/* Dropdown panel */
.dropdown {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    width: 200px;
    z-index: 1000;
}

/* Show dropdown */
.dropdown.open {
    display: block;
}

/* Dropdown buttons */
.dropdown button {
    width: 100%;
    background: white;
    color: black;
    border: none;
    padding: 12px;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
}

.dropdown button:hover {
    background: #f2f2f2;
}

/* ================= FIX MOBILE TAP BLOCKING ================= */

/* Ensure scanner does not block clicks */
#reader {
    position: relative;
    z-index: 1;
}

/* Force top bar above scanner */
.top-bar {
    position: relative;
    z-index: 9999;
}

/* Ensure dropdown is highest layer */
.dropdown {
    z-index: 10000;
}

video {
    pointer-events: none;
}
/* ================= ADMIN LOGIN WIDTH FIX ================= */

#loginSection {
    max-width: 500px;
    margin: 0 auto;
}

/* =========================================================
   ACTIVE SCAN MODE DISPLAY
========================================================= */

#activeModeDisplay {
    display: none;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 12px;
    text-align: center;
}

/* Optional color states */
.mode-entry {
    color: #27ae60;
}

.mode-exit {
    color: #c0392b;
}

.hidden {
    display: none;
}

#scanList div {
    font-size: 15px;
}

#footer {
text-align: center;
margin-top: 20px;
font-size: 0.8em;
}

.back-container {
    margin-top: 20px;
    text-align: center;
}

.back-btn {
    padding: 10px 20px;
}