html, body {
    height: 100%;
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f2f2f2;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    background: #f2f2f2;
    z-index: 999;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-top-row {
    display: flex;
    flex-direction: column; /* Standaard al column, om sub-elementen te stapelen */
    align-items: center;
    width: 100%;
    height: auto;
    padding: 30px 20px 10px;
    box-sizing: border-box;
    gap: 10px; /* Ruimte tussen de gestapelde elementen */
    justify-content: center;
}

/* Nieuwe wrapper voor logo+titel en klok, zodat ze naast elkaar kunnen staan */
.header-main-elements {
    display: flex;
    align-items: center;
    width: 100%; /* Neemt volledige breedte van parent */
    justify-content: space-between;
}

/* Groep voor logo en titeltekst */
.logo-and-title {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.logo svg {
    height: 80px; /* Standaard logo grootte */
}
.title-text {
    font-size: 1.5em;
    font-weight: bold;
    color: #24256d;
    line-height: 1.2em;
}
.clock-display {
    font-size: 4em; /* Standaard klok grootte */
    color: #24256d;
    font-weight: bold;
    flex-shrink: 0;
    flex-grow: 0;
    text-align: right;
    min-width: 150px;
}

.clock-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.kiosk-reset-link {
    align-items: center;
    background: #fff;
    border: 1px solid #d5d5df;
    border-radius: 5px;
    box-sizing: border-box;
    color: #24256d;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    text-decoration: none;
    width: 38px;
}

.kiosk-reset-link:active,
.kiosk-reset-link:hover {
    background: #ededf6;
}

.location-select-container {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1em;
    color: #24256d;
    font-weight: bold;
    line-height: 1;
    margin-top: 10px; /* Ruimte onder de main-elements groep */
}

#locationSelect {
    padding: 5px 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1em;
}

.column-titles-row {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.column-titles-row h3 {
    text-align: center;
    color: #24256d;
    font-size: 1.8em;
    font-weight: bold;
    flex: 1;
    margin: 0;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
}

.column-count {
    font-size: 0.7em;
    background-color: #24256d;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 25px;
    text-align: center;
}

.employee-columns {
    display: flex;
    gap: 20px;
    flex-grow: 1;
    padding: 0 20px 20px;
    box-sizing: border-box;
    min-height: 0;
}

/* Nieuwe styling voor de individuele lijst containers */
.employee-list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 10px 0 0;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    overscroll-behavior-y: contain;
}

.employee {
    background: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.info {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    align-items: flex-start; /* Corrected to align-items: center for consistency */
    gap: 2px;
}
.status-dot {
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 2px;
}
.name-and-time {
    display: flex;
    flex-direction: row;
    align-items: center;
}
.name {
    font-weight: 600;
    font-size: 1em;
}

/* HERSTELDE STIJLEN VOOR WERKTIJD */
.total-time {
    font-size: 0.8em; /* Hersteld */
    color: #666; /* Hersteld */
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* HERSTELDE STIJLEN VOOR LOCATIE */
.location-details {
    font-size: 0.8em; /* Hersteld, was 0.9em in de laatste versie */
    color: #666; /* Hersteld, was #555 in de laatste versie */
    margin-left: 0;
    margin-top: 3px; /* Blijft voor afstand onder naam/tijd */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.clock-btn {
    padding: 10px;
    font-size: 0.85em;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
}
.clock-in {
    background-color: green;
}
.clock-out {
    background-color: red;
}
.break {
    background-color: orange;
}

/* Standaard voor desktop: knoppen naast elkaar */
.employee .button-wrapper {
    display: flex;
    flex-direction: row; /* Standaard: knoppen naast elkaar (voor desktop) */
    gap: 10px; /* Horizontale afstand tussen knoppen op desktop */
    flex-shrink: 0;
}

/* Loader Overlay Styles */
#loaderOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s ease-in-out;
}

#loaderOverlay.visible {
    visibility: visible;
    opacity: 1;
}

.loader-spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #24256d;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================= */
/* ALGEMEEN MOBIELE STIJLEN (Max-width 768px - voor telefoons en tablets) */
/* ========================= */
@media (max-width: 768px) {
    .header-top-row {
        padding: 20px 10px 10px;
        height: auto;
        gap: 5px;
    }

    .header-main-elements {
        justify-content: space-between;
        gap: 10px;
    }

    .logo-and-title {
        gap: 8px;
    }
    .logo svg {
        height: 40px;
    }
    .title-text {
        font-size: 1em;
    }

    .clock-display {
        font-size: 2em;
        min-width: auto;
    }

    .clock-actions {
        gap: 8px;
    }

    .kiosk-reset-link {
        height: 32px;
        width: 32px;
    }

    .location-select-container {
        font-size: 0.9em;
        margin-top: 5px;
        width: 100%;
        justify-content: center;
    }
    #locationSelect {
        font-size: 0.9em;
        padding: 3px 6px;
    }

    .column-titles-row {
        flex-direction: row;
        padding: 0 10px;
        justify-content: space-around;
    }
    .column-titles-row h3 {
        font-size: 1.3em;
        padding: 5px 0;
        justify-content: center;
        margin-left: 0;
        flex: 1;
    }

    .employee-columns {
        gap: 15px;
        padding: 0 10px 10px;
    }

    .employee-list-container {
        padding: 5px 5px 0 0;
    }

    /* Knoppen onder elkaar voor schermen tot 768px breed (iPad, iPhone Landschap, iPhone Portret) */
    .employee .button-wrapper {
        gap: 8px; /* Verticale afstand tussen de knoppen */
    }
}

/* ========================= */
/* SPECIEMIEKE STIJLEN VOOR TELEFOON PORTRET (Max-width 600px) */
/* ========================= */
@media (max-width: 600px) {
    .logo svg {
        height: 35px;
    }
    .title-text {
        font-size: 0.9em;
    }
    .clock-display {
        font-size: 1.8em;
    }

    .column-titles-row h3 {
        font-size: 1.1em;
    }

    .employee-columns {
        flex-direction: column; /* Kolommen onder elkaar op zeer kleine schermen */
        gap: 10px;
    }
    /* De knoppen blijven hier ook onder elkaar door de @media (max-width: 768px) regel */
}

/* Stijlen voor de profielfoto en de statusrand */
.profile-picture-container { /* Container voor afbeelding/placeholder */
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    margin-right: 10px;
    border-radius: 50%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Default randkleur (nu rood) */
    border: 2px solid #f44336; /* Rood als standaard */
}

.profile-picture-container.status-in {
    border-color: #4CAF50; /* Groen voor ingelogd */
}

.profile-picture-container.status-break {
    border-color: #FFC107; /* Oranje voor op pauze */
}

.employee .profile-picture {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.employee .profile-picture.placeholder {
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-size: 1.6em;
    font-weight: bold;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.employee .info {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.employee .name-time-location-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.employee .name {
    font-weight: bold;
    font-size: 1.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.employee .clock-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
}

.clock-btn.clock-in {
    background-color: #4CAF50;
    color: white;
}

.clock-btn.clock-out {
    background-color: #f44336;
    color: white;
}

.clock-btn.break {
    background-color: #FFC107;
    color: #333;
}

.unlock-page {
    min-height: 100vh;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 24px;
    box-sizing: border-box;
}

.unlock-panel {
    width: min(100%, 420px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.14);
    padding: 28px;
    box-sizing: border-box;
}

.unlock-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.unlock-logo img {
    width: 72px;
    height: 72px;
}

.unlock-panel h1 {
    color: #24256d;
    font-size: 1.8em;
    margin: 0 0 10px;
    text-align: center;
}

.unlock-panel p {
    color: #555;
    font-size: 1em;
    line-height: 1.4;
    margin: 0 0 20px;
    text-align: center;
}

.unlock-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.unlock-form label {
    color: #24256d;
    font-weight: bold;
}

.unlock-form select,
.unlock-form input {
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1em;
    padding: 11px 12px;
    width: 100%;
}

.unlock-form button {
    background: #24256d;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    margin-top: 8px;
    padding: 12px;
}

.unlock-error {
    background: #fdecec;
    border: 1px solid #f4b4b4;
    border-radius: 5px;
    color: #9b1c1c;
    margin-bottom: 16px;
    padding: 10px 12px;
    text-align: center;
}
