/* Maan Driebergen — Boekenbieb huisstijl */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700&display=swap');

:root {
  --bordeaux: #591528;
  --pink: #f0aeb0;
  --beige: #fcf5ed;
  --blue: #aab8c4;
  --green: #d2c791;
  --light-pink: #f9bbbd;
  --text: #333;
  --white: #fff;
  --red: #c0392b;
  --orange: #e67e22;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Bricolage Grotesque', sans-serif;
  background-color: var(--beige);
  background-image: url('assets/background-illustration.svg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--bordeaux);
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--bordeaux);
}

h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bordeaux);
}

a {
  color: var(--bordeaux);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  max-width: 922px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--pink);
  padding: 1.25rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bordeaux);
}

.logo:hover {
  text-decoration: none;
}

.logo:hover .logo-img {
  opacity: 0.85;
}

.logo-sub:hover {
  color: var(--pink);
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.logo-sub {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--bordeaux);
  letter-spacing: 0.02em;
  padding-left: 0.75rem;
  border-left: 1px solid var(--pink);
}

nav a {
  margin-left: 1.5rem;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6rem;
  color: var(--bordeaux);
  transition: color 0.2s;
}

nav a:hover {
  color: var(--pink);
  text-decoration: none;
}

nav a.active {
  border-bottom: 2px solid var(--pink);
  padding-bottom: 2px;
}

/* Hero / Intro */
.intro {
  text-align: center;
  padding: 4rem 0 3rem;
}

.intro p {
  margin-top: 0.75rem;
  font-size: 1.125rem;
  color: var(--text);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Search */
.search-bar {
  margin: 0 auto 2rem;
  max-width: 480px;
}

.search-bar input {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 2px solid var(--pink);
  border-radius: 8.1875rem;
  font-family: inherit;
  font-size: 1rem;
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input:focus {
  border-color: var(--bordeaux);
}

/* Book grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  padding-bottom: 3rem;
}

.book-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.2s;
}

.book-card:hover {
  box-shadow: 0 4px 20px rgba(89, 21, 40, 0.08);
}

.book-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--bordeaux);
}

.book-author {
  font-size: 0.9rem;
  color: #777;
}

.book-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.25rem;
}

.tag {
  background: var(--beige);
  color: var(--bordeaux);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 8.1875rem;
}

.book-status {
  margin-top: auto;
  padding-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 8.1875rem;
}

.badge-available {
  background: #d4edda;
  color: #155724;
}

.badge-borrowed {
  background: #fff3cd;
  color: #856404;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  padding: 0 1.5rem;
  border-radius: 8.1875rem;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--bordeaux);
  color: var(--beige);
  letter-spacing: 0.02em;
}

.btn-primary:hover {
  background: #3f0e1c;
}

/* Leen-knop in de boek-card: extra prominent */
.book-card .btn-primary {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 0 1.25rem;
  box-shadow: 0 2px 0 rgba(89, 21, 40, 0.15);
}

.book-card .btn-primary::after {
  content: " →";
  margin-left: 0.15rem;
}

.btn-secondary {
  background: var(--white);
  color: var(--bordeaux);
  border: 2px solid var(--pink);
}

.btn-secondary:hover {
  background: var(--beige);
}

.btn-small {
  height: 2.25rem;
  padding: 0 1rem;
  font-size: 0.85rem;
}

.btn-danger {
  background: var(--white);
  color: var(--red);
  border: 2px solid var(--red);
}

.btn-danger:hover {
  background: #fdf0ef;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(89, 21, 40, 0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 16px;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  position: relative;
}

.modal h2 {
  margin-bottom: 0.25rem;
}

.modal .book-author {
  margin-bottom: 1.25rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--bordeaux);
  line-height: 1;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--bordeaux);
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #ddd;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--pink);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Success message */
.success-message {
  display: none;
  text-align: center;
  padding: 1rem 0;
}

.success-message.active {
  display: block;
}

.success-message .checkmark {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.success-message p {
  color: var(--text);
}

/* Admin table */
.admin-section {
  padding: 2rem 0 3rem;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 120px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--bordeaux);
}

.stat-label {
  font-size: 0.8rem;
  color: #777;
  font-weight: 600;
}

.table-wrapper {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
}

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

thead {
  background: var(--bordeaux);
  color: var(--white);
}

th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}

td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

tr:last-child td {
  border-bottom: none;
}

tr.overdue {
  background: #fff5f5;
}

tr.overdue td {
  color: var(--red);
}

.overdue-badge {
  background: var(--red);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 8.1875rem;
  margin-left: 0.5rem;
}

/* Footer */
.site-footer {
  background: var(--blue);
  color: var(--white);
  text-align: center;
  padding: 2rem 0;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--white);
  font-weight: 600;
}

/* Wachtwoord-gate (admin) */
body.is-locked {
  overflow: hidden;
}

.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(252, 245, 237, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.auth-overlay.is-visible {
  display: flex;
}

.auth-overlay.is-hidden {
  display: none;
}

.auth-card {
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(89, 21, 40, 0.15);
  text-align: center;
}

.auth-card h2 {
  margin-bottom: 0.5rem;
}

.auth-card p {
  color: #777;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.auth-card .form-group {
  text-align: left;
}

.auth-card .form-actions {
  justify-content: center;
}

.auth-error {
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: -0.25rem;
  margin-bottom: 0.5rem;
  text-align: left;
}

/* Responsive */
@media (max-width: 640px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .book-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    gap: 0.75rem;
  }

  nav a {
    margin-left: 0.75rem;
  }

  nav a:first-child {
    margin-left: 0;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-wrapper {
    overflow-x: auto;
  }

  table {
    min-width: 560px;
  }

  .modal {
    padding: 1.5rem;
  }

  .stats {
    width: 100%;
  }

  .stat-card {
    flex: 1;
  }
}
