/* ===== Basis Layout ===== */
html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #111;
    color: #f5f5f5;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: hidden; /* voorkomt horizontale scrollbar */
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit; /* padding telt mee in breedte */
}

/* ===== Typografie ===== */
h1 {
    margin: 15px 0;
    text-align: center;
    color: #fff;
}

h2, h3 {
    margin: 0 0 15px;
    text-align: center;
    color: #fff;
}

p, label {
    color: #ccc;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== Containers ===== */
.container-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    overflow-x: hidden;
}

/* ===== Dashboard & Grid ===== */
.host-container,
.user-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    width: 100%;
    padding: 20px;
    overflow-y: auto;
}

/* ===== Blokken ===== */
a.blok,
a.host,
.user-block {
    background-color: #1c1c1c;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    transition: transform 0.2s ease, background-color 0.2s ease;
    color: #f5f5f5;
    min-height: 180px;
    box-sizing: border-box;
}

a.blok:hover,
a.host:hover,
.user-block:hover {
    background-color: #2a2a2a;
    transform: translateY(-3px);
    cursor: pointer;
}

/* Stale hosts */
.host.stale,
.blok.stale {
    background-color: orange;
    color: black;
}
.host.stale .ip,
.host.stale .last-checked,
.host.stale .last-changed {
    color: black;
}

/* ===== User Info ===== */
.user-info {
    background-color: #1c1c1c;
    padding: 12px 20px;
    margin: 0 auto 20px auto;
    max-width: 1200px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    font-size: 16px;
    color: #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.user-info strong {
    color: #fff;
    font-weight: 600;
}

/* ===== Login Scherm ===== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px;
}
.login-box {
    background-color: #1c1c1c;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.7);
    width: 100%;
    max-width: 400px;
}
.login-box h2 {
    text-align: center;
    margin-bottom: 20px;
}
.login-box form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.login-box input {
    padding: 14px;
    border-radius: 8px;
    border: none;
    background-color: #333;
    color: #fff;
    font-size: 16px;
}
.login-box button {
    padding: 14px;
    border: none;
    border-radius: 8px;
    background-color: #444;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 16px;
}
.login-box button:hover {
    background-color: #666;
}

/* ===== Create User Pagina ===== */
body.create-user-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #111;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

.create-user-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    background-color: #1c1c1c;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.7);
}

.create-user-container h3 {
    text-align: center;
    color: #fff;
}

.create-user-container form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.create-user-container input[type="text"],
.create-user-container input[type="password"] {
    padding: 14px;
    border-radius: 8px;
    border: none;
    background-color: #333;
    color: #fff;
    font-size: 16px;
    width: 100%;
}

.create-user-container .btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    background-color: #444;
    color: #fff;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.create-user-container .btn:hover {
    background-color: #666;
    transform: translateY(-2px);
}

/* Knoppen naast elkaar (Create + Cancel) */
.create-user-container .btn-group {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.create-user-container .btn-group .btn {
    flex: 1; /* beide knoppen even breed */
}

/* ===== Edit User / Project ===== */
.edit-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    padding: 0 10px;
}
.form-blok {
    background-color: #1c1c1c;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.form-blok input[type="text"] {
    padding: 12px;
    border-radius: 8px;
    border: none;
    background-color: #333;
    color: #fff;
    font-size: 16px;
}
.form-blok input[type="checkbox"] {
    transform: scale(1.3);
    margin-right: 8px;
}
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.form-row label {
    width: 150px; /* vaste breedte voor nette uitlijning */
    font-weight: bold;
}

.form-row input[type="text"],
.form-row input[type="file"] {
    flex: 1;
    padding: 6px;
    border-radius: 5px;
    border: 1px solid #555;
    background: #111;
    color: #eee;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* ===== Buttons ===== */
.btn {
    padding: 12px 18px;
    margin-bottom: 5px;
    margin-top: 5px;
    background-color: #444;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    display: inline-block;
    text-align: center;
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
}

.btn:hover {
    background-color: #666;
    transform: translateY(-2px);
}

.btn-back {
    background-color: #333;
    margin: 15px auto;
    display: block;
    width: fit-content;
}
.btn-back:hover {
    background-color: #555;
}

/* ===== Status indicators ===== */
.status-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0;
}
.status {
    display: inline-block;
    width: 100%;
    height: 20px;
    border-radius: 8px;
    margin-bottom: 10px;
}
.online { background-color: green; }
.offline { background-color: red; }
.location { font-weight: bold; margin-bottom: 2px; }
.ip { font-size: 14px; color: #aaa; margin-bottom: 10px; }
.last-checked,
.last-changed {
    font-size: 12px;
    color: #ccc;
    margin: 3px 0;
    text-align: left;
}
.last-online {
    text-align: center;
    font-size: 14px;
    margin-bottom: 15px;
    color: #aaa;
}
.host.stale .last-online {
    color: black;
}

/* ===== Logs Table ===== */
.logs-wrapper {
    display: block;           /* geen flex */
    margin-top: 20px;
    width: 100%;
    overflow-x: auto;         /* horizontaal scrollen */
}

.logs-table {
    border-collapse: collapse;
    font-size: 14px;
    margin: 0;               /* verwijder auto margin */
    width: max-content;      /* laat tabel breder worden dan container */
    min-width: 100%;         /* maar minstens de breedte van container */
    table-layout: auto;
}


.logs-table th,
.logs-table td {
    border: 1px solid #555;
    padding: 10px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.logs-table thead { background-color: #333; }
.logs-table th {
    color: #fff;
    font-weight: 600;
}
.logs-table tbody tr:nth-child(even) { background-color: #222; }
.logs-table tbody tr:nth-child(odd) { background-color: #1a1a1a; }
.logs-table tbody tr:hover { background-color: #444; }

.no-logs {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #999;
}
.logs-table input[type="text"] {
    width: 95%;
    padding: 6px;
    box-sizing: border-box;
    font-size: 14px;
}
.logs-table button {
    padding: 4px 8px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
}

/* ===== Responsiveness ===== */
@media (max-width: 768px) {
    body { font-size: 15px; }
    .container-wrapper { padding: 10px; }
    .host-container,
    .user-container { grid-template-columns: 1fr; }
    .login-box { padding: 20px; }
    .user-block { padding: 20px; }
    .logs-table { font-size: 12px; }
}
@media (max-width: 480px) {
    .login-box { padding: 15px; }
    button,
    a.btn { width: 100%; }
}

/* ===== Stale Project Mode ===== */
body.stale {
    background-color: orange !important;
}
body.stale h1,
body.stale h2,
body.stale .last-online {
    color: black;
}
body.stale .host,
body.stale .logs-table {
    color: inherit;
}

/* ===== Formulieren (algemeen) ===== */
.form-blok form:not(:has(table)) {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

form label {
    font-size: 14px;
    color: #ccc;
    margin-bottom: 4px;
}

form input[type="text"],
form input[type="password"],
form input[type="email"] {
    padding: 12px;
    border-radius: 8px;
    border: none;
    background-color: #333;
    color: #fff;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.2s ease, border 0.2s ease;
}

form input[type="text"]:focus,
form input[type="password"]:focus,
form input[type="email"]:focus {
    background-color: #444;
    outline: none;
    border: 1px solid #666;
}

form button {
    align-self: flex-start;
}

/* ===== Custom Toggles ===== */
.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: 0.3s;
    border-radius: 34px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #28a745;
}

input:checked + .slider:before {
    transform: translateX(26px);
    background-color: #fff;
}

/* Label naast switch */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
}

/* ===== Header bar ===== */
.header-bar {
    display: flex;
    justify-content: flex-end; /* alles naar rechts behalve h1 */
    align-items: center;
    position: relative;
    margin: 15px 0;
    padding: 0 10px;
}

.header-bar h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%); /* altijd gecentreerd */
    margin: 0;
    text-align: center;
    white-space: nowrap;
}

.header-bar .toggles {
    display: flex;
    gap: 15px;
    margin-left: auto; /* duwt toggles helemaal naar rechts */
}

/* ===== Responsive fix ===== */
@media (max-width: 600px) {
    .header-bar h1 {
        font-size: 18px;
    }
    .header-bar .toggles {
        gap: 10px;
    }
}

/* ===== Project overzicht pagina ===== */
/* ===== Containers ===== */
.host-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    padding: 20px;
}


/* ===== Project blok ===== */
.host-link {
    text-decoration: none;
    color: inherit;
}

.host {
    background-color: #1c1c1c;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, background-color 0.2s ease;
    min-height: 180px;
}

.host:hover {
    background-color: #2a2a2a;
    transform: translateY(-3px);
    cursor: pointer;
}

/* Project titel */
.project-header {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    color: #fff;
}

/* ===== Locaties grid ===== */
.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    width: 100%;
}



/* Locatie blokje */
.location-block {
    background-color: #2a2a2a;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

/* Locatie naam */
.location-block .location {
    font-size: 14px;
    font-weight: 500;
    color: #ddd;
}

/* Status balk */
.location-block .status {
    width: 100%;
    height: 16px;
    border-radius: 6px;
}

.location-block .status.online {
    background-color: green;
}

.location-block .status.offline {
    background-color: red;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    h1 { font-size: 22px; }
} 
/* Verberg de standaard file input */
input[type="file"] {
    display: none;
}

/* Wrapper voor custom file upload */
.file-upload {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Label wordt de "knop" */
.file-upload label {
    background: #444;
    color: #fff;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.2s;
}

.file-upload label:hover {
    background: #666;
}

/* Tekstveldje voor gekozen bestand */
.file-upload span {
    font-size: 14px;
    color: #ccc;
}
  