:root {
  /* Brand colors */
  --primary: #8f0d12;          /* LAB DE LINES deep red */
  --primary-dark: #6f0a0e;
  --primary-soft: #f3d6d7;

  /* --bg: #7d0b10;               main background */
  --bg: url("/assets/labdelines_xl.png");
  --bg-soft: #f7f4f4;          /* light interior background */
  --surface: #ffffff;

  /* Text */
  --text-main: #1f1f1f;
  --text-invert: #ffffff;
  --text-muted: #6b6b6b;

  /* UI */
  --border: #e6e6e6;
  --radius: 5px;

  /* Shadows (soft, architectural) */
  --shadow-sm: 0 4px 12px rgba(0,0,0,.08);
  --shadow-md: 0 10px 28px rgba(0,0,0,.15);

  /* Status */
  --danger: #b91c1c;
  --success: #15803d;
}

body {
  background-color: #8f0d12; /* your brand red */
  background-image: url("/assets/labdelines_xl.png");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;

  font-family: "Inter", Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text-main);
  min-height: 100vh;
}

/* Layout */
.container {
  height: 100%;
  max-width: 920px;
  margin: auto;
  background: var(--bg-soft);
  padding: 48px;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  overflow: hidden; /* 👈 THIS FIXES IT */
}

/* sm layout */
@media (max-width: 640px) {
.container {
  height: 100%;
  margin: auto;
  background: var(--bg-soft);
  padding: 10px;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  overflow: hidden; /* 👈 THIS FIXES IT */
}
}


/* Typography */
h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  margin-bottom: 24px;
}

/* Buttons */
.primary-btn {
  background: var(--primary);
  color: var(--text-invert);
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: all .2s ease;
}

.primary-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Form */

.form-card,
.book-card,
.admin-book-card,
.auth-container,
.admin-container {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
    overflow: hidden;

}

.form-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

input,
textarea {
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 14px;
  background: #fff;
  transition: border .15s ease, box-shadow .15s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Book grid */
.grid {
  display: grid;
  gap: 20px;
  margin-top: 28px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

/* Enhanced Book Card Styles */
.book-card {
  padding: 0;
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
  overflow: hidden;
  position: relative;
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(143, 13, 18, 0.2);
}

.book-card img {
  width: 100%;
  height: 280px;
  border-radius: 4px;
  object-fit: cover;
  transition: transform .3s ease;
}

.book-card:hover img {
  transform: scale(1.05);
}

.book-card h3 {
  padding: 14px 14px 8px 14px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.book-card p {
  padding: 0 14px 14px 14px;
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Enhanced Detail View */
.book-detail-img {
  width: 100%;
  max-width: 400px;
  height: auto;
  aspect-ratio: 3/4;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: transform .3s ease, box-shadow .3s ease;
}

.book-detail-img:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 40px rgba(143, 13, 18, 0.3);
}

.book-detail h1 {
  font-size: 36px;
  font-weight: 700;
  margin: 24px 0 20px 0;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.book-detail-info {
  display: flex;
  gap: 24px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.book-detail-info p {
  background: var(--surface);
  padding: 12px 18px;
  border-radius: 8px;
  margin: 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  font-size: 14px;
}

.book-detail-info strong {
  color: var(--primary);
  font-weight: 600;
  margin-right: 6px;
}

.book-detail-info span {
  color: var(--text-main);
  font-weight: 500;
}

.book-detail #description {
  line-height: 1.7;
  font-size: 15px;
  color: var(--text-main);
  margin-top: 24px;
  padding: 20px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

/* Admin Book Card */
.admin-book-card {
  padding: 0;
  transition: transform .3s ease, box-shadow .3s ease;
  overflow: hidden;
}

.admin-book-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(143, 13, 18, 0.15);
}

.admin-book-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px 4px 0 0;
}

.admin-book-card > div {
  padding: 14px;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .book-card img {
    height: 240px;
  }
  
  .book-detail h1 {
    font-size: 28px;
  }
  
  .book-detail-img {
    max-width: 100%;
  }
}


/* -------------------------------------------------- */
/* LOGIN + ADMIN PAGES                                */
/* -------------------------------------------------- */

.auth-container,
.admin-container {
  max-width: 460px;
  margin: 70px auto;
  padding: 34px;
}

.auth-container h1,
.admin-container h1 {
  text-align: center;
  margin-bottom: 28px;
}

/* center elements */
.auth-container form,
.admin-container form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-container input,
.admin-container input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
}

.auth-container button,
.admin-container button {
  width: 100%;
  margin-top: 10px;
  margin:5px;
}


/* Buttons inside admin */
.admin-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.logout-btn {
  background: var(--danger);
}

.logout-btn:hover {
  opacity: .85;
}

/* GLOBAL LOADER */
.loader {
  position: fixed;
  inset: 0;
  background: rgba(125,11,16,.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.hidden {
  display: none;
}

.loader-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255,255,255,.3);
  border-top: 4px solid #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.loader-text {
  margin-top: 12px;
  color: #fff;
  font-size: 14px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 14px 20px;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: slideIn .3s ease;
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--primary); }


.hidden {
  display: none;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* CONFIRM MODAL */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
}

.confirm-box {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  width: 320px;
  text-align: center;
}

.confirm-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.hidden {
  display: none;
}

/* Navigation */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#pageInfo {
  font-size: 14px;
  color: var(--text-muted);
}


/* Search bar */
.search-box {
  margin-top: 16px;
  margin-bottom: 10px;
}

.search-box input {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 14px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}


