/* ===============================
   Magazijn Uitleen - Vista College Style
   =============================== */

/* Kleuren */
:root {
  --primary: #E65335;        /* Vista oranje-rood */
  --primary-dark: #cc462a;   /* Donkerder oranje */
  --secondary: #00585C;      /* Vista donkergroen/blauw */
  --secondary-dark: #004244; /* Donkerder groen */
  --background: #f4f7fb;     /* lichtgrijs */
  --text-dark: #222;
  --text-light: #fff;
}

/* Algemene reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Basis */
body {
  font-family: "Segoe UI", Roboto, sans-serif;
  background: var(--background);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

html {
  height: 100%;
}

.container {
  width: 95%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

main.container {
  flex: 1;
}

/* Header */
.site-header {
  background: var(--primary);
  color: var(--text-light);
  padding: 15px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header h1 a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 22px;
  font-weight: 600;
}

.site-header nav a {
  color: var(--text-light);
  text-decoration: none;
  margin-left: 18px;
  font-weight: 500;
  transition: color .2s;
}
.site-header nav a:hover {
  color: var(--secondary);
}

/* Footer */
.site-footer {
  background: var(--secondary);
  color: var(--text-light);
  text-align: center;
  padding: 12px 0;
  margin-top: auto;
}

/* Cards */
.card {
  background: var(--text-light);
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  margin-bottom: 20px;
  transition: transform .2s, box-shadow .2s;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.12);
  }
}

/* Grids */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

/* Bij kleinere schermen: minimum kolombreedte verkleinen */
@media (max-width: 600px) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 450px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Buttons */
button,
input[type="submit"],
a.button {
  display: inline-block;
  background: var(--secondary);
  color: var(--text-light) !important;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: background .2s, transform .1s;
  top: 6px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:hover,
input[type="submit"]:hover,
a.button:hover {
  background: var(--secondary-dark);
  transform: scale(1.03);
}

button:active,
input[type="submit"]:active,
a.button:active {
  transform: scale(0.98);
}

/* Forms */
.form-row {
  margin-bottom: 14px;
}
.form-row label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}
input, textarea, select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccd5e0;
  border-radius: 8px;
  font-size: 14px;
  transition: border .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230,83,53,0.3);
  outline: none;
}

/* Notices */
.notice {
  padding: 12px;
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 8px;
  margin-bottom: 16px;
  color: #856404;
  font-size: 14px;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
}
table th, table td {
  padding: 10px;
  text-align: left;
  white-space: nowrap;
}
table th {
  background: var(--secondary);
  color: var(--text-light);
}
table tr:nth-child(even) {
  background: #f9fbfd;
}
table tr:hover {
  background: #f1f7fb;
}

/* Details */
details summary {
  cursor: pointer;
  font-weight: 600;
  margin-top: 8px;
}
#Be {
  position: relative;
  top: 5px;
}

/* Rood verwijder-knopje */
.button-delete {
  position: relative;
  top: 13px;
  background: #d9534f;
  color: var(--text-light) !important;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  transition: background .2s, transform .1s;
}
.button-delete:hover {
  background: #c9302c;
  transform: scale(1.03);
}

/* Modal overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
  justify-content: center;
  align-items: center;
}

/* Modal box */
.modal {
  background: var(--text-light);
  padding: 20px;
  border-radius: 10px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.modal h3 {
  margin-bottom: 15px;
}
.modal-buttons {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.modal-buttons button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}
.modal-buttons .confirm {
  background: #d9534f;
  color: var(--text-light);
}
.modal-buttons .cancel {
  background: #ccc;
}
.modal-buttons .confirm:hover { background: #c9302c; }
.modal-buttons .cancel:hover { background: #999; }

/* Hamburger menu */
.header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-toggle {
  font-size: 26px;
  cursor: pointer;
  display: inline-block;
  color: var(--text-light);
  margin-left: 10px;
  transition: transform 0.2s;
}
.menu-toggle:hover {
  transform: scale(1.1);
}

/* User info */
.user-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.user-info a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
}
.user-info a:hover {
  text-decoration: underline;
}

/* Zijmenu */
.side-menu {
  position: fixed;
  top: 0;
  left: -260px;
  width: 260px;
  height: 100vh;
  background: #e9ecef;
  box-shadow: 2px 0 8px rgba(0,0,0,0.2);
  padding-top: 70px;
  transition: left 0.3s ease;
  z-index: 1001;
}
.side-menu nav {
  display: flex;
  flex-direction: column;
}
.side-menu nav a {
  padding: 14px 20px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: background 0.2s;
}
.side-menu nav a:hover {
  background: #d0d6dc;
}

/* Overlay */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
}

.side-menu.active {
  left: 0;
  width: 300px;
}
.menu-overlay.active {
  display: block;
}
.left-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Language Toggle Button */
.lang-toggle {
  background: rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  border: 2px solid rgba(255,255,255,0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lang-toggle:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-1px);
  text-decoration: none;
}

.lang-toggle:active {
  transform: translateY(0);
}

/* Logout button styling */
.logout {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* ===============================
   RESPONSIVE DESIGN
   =============================== */

/* Tablet en kleine laptops (max 1024px) */
@media (max-width: 1024px) {
  .container {
    width: 95%;
    padding: 15px;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
  }

  .site-header h1 a {
    font-size: 20px;
  }

  table {
    font-size: 14px;
  }

  table th, table td {
    padding: 8px;
  }
}

/* Tablets (max 768px) */
@media (max-width: 768px) {
  .container {
    padding: 12px;
  }

  .site-header h1 a {
    font-size: 18px;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
  }

  .card {
    padding: 14px;
  }

  /* Responsive tabel - scrollbaar maken */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: 13px;
    min-width: 600px;
  }

  table th, table td {
    padding: 6px;
  }

  /* User info meer compact */
  .user-info {
    gap: 10px;
  }

  .user-info a {
    font-size: 14px;
  }

  .logout {
    max-width: 150px;
  }

  /* Buttons meer compact */
  button,
  input[type="submit"],
  a.button {
    padding: 8px 12px;
    font-size: 14px;
  }

  /* Modal */
  .modal {
    max-width: 350px;
    padding: 16px;
  }
}

/* Mobiele telefoons (max 480px) */
@media (max-width: 480px) {
  .container {
    width: 100%;
    padding: 10px;
  }

  .site-header {
    padding: 10px 0;
  }

  .site-header h1 a {
    font-size: 16px;
  }

  .menu-toggle {
    font-size: 24px;
    margin-left: 5px;
  }

  .left-header {
    gap: 8px;
  }

  /* User info verticaal stapelen voor zeer kleine schermen */
  .user-info {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

  .user-info a {
    font-size: 12px;
  }

  .logout {
    max-width: 120px;
    font-size: 11px;
  }

  /* Grid voor één kolom op mobiel */
  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .card {
    padding: 12px;
  }

  .card h2,
  .card h3 {
    font-size: 18px;
  }

  .card h4 {
    font-size: 16px;
  }

  /* Formulieren */
  input, textarea, select {
    font-size: 16px; /* Voorkomt zoom op iOS */
    padding: 12px;
  }

  .form-row {
    margin-bottom: 12px;
  }

  button,
  input[type="submit"],
  a.button {
    padding: 10px 14px;
    font-size: 14px;
    width: 100%;
    text-align: center;
  }

  /* Tabel volledig responsive - stapelen */
  table {
    font-size: 12px;
    min-width: 100%;
  }

  table th {
    font-size: 11px;
  }

  table th, table td {
    padding: 4px;
  }

  /* Alternatief: stack table op zeer kleine schermen */
  .stack-table {
    display: block;
  }

  .stack-table thead {
    display: none;
  }

  .stack-table tr {
    display: block;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: white;
  }

  .stack-table td {
    display: block;
    text-align: right;
    padding: 8px;
    border-bottom: 1px solid #eee;
  }

  .stack-table td:last-child {
    border-bottom: none;
  }

  .stack-table td::before {
    content: attr(data-label);
    float: left;
    font-weight: bold;
    color: var(--secondary);
  }

  /* Modal */
  .modal {
    max-width: 90%;
    width: 90%;
    padding: 14px;
  }

  .modal h3 {
    font-size: 16px;
  }

  .modal-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .modal-buttons button {
    width: 100%;
    padding: 10px;
  }

  /* Side menu breder op mobiel */
  .side-menu {
    width: 240px;
    left: -240px;
  }

  .side-menu.active {
    width: 240px;
  }

  .side-menu nav a {
    padding: 12px 16px;
    font-size: 14px;
  }

  /* Footer */
  .site-footer {
    padding: 10px 0;
    font-size: 12px;
  }

  /* Details/Summary */
  details summary {
    font-size: 14px;
  }

  /* Notice */
  .notice {
    padding: 10px;
    font-size: 13px;
  }
}

/* Extra kleine schermen (max 360px) */
@media (max-width: 360px) {
  .site-header h1 a {
    font-size: 14px;
  }

  .menu-toggle {
    font-size: 22px;
  }

  .card h2 {
    font-size: 16px;
  }

  .card h3 {
    font-size: 15px;
  }

  button,
  input[type="submit"],
  a.button {
    font-size: 13px;
    padding: 8px 10px;
  }

  .side-menu {
    width: 200px;
    left: -200px;
  }

  .side-menu.active {
    width: 200px;
  }
}

/* Landscape mode voor mobiel */
@media (max-height: 500px) and (orientation: landscape) {
  .site-header {
    padding: 8px 0;
  }

  .side-menu {
    padding-top: 50px;
  }

  .side-menu nav a {
    padding: 10px 16px;
  }
}

/* Print styling */
@media print {
  .site-header,
  .site-footer,
  .menu-toggle,
  .side-menu,
  .menu-overlay,
  button,
  .button,
  .button-delete {
    display: none !important;
  }

  body {
    background: white;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
}
