/*.book-card {
      border: 1px solid #ccc;
      border-radius: 10px;
      padding: 15px;
      margin: 10px;
      width: 250px;
      display: inline-block;
      background: #f9f9f9;
    }
    .book-card h3 { margin: 0; font-size: 18px; }
    .book-card p { margin: 5px 0; }
    #add-book-form { margin: 12px 0; }
    #add-book-form input, #add-book-form select, #add-book-form button 
    { margin: 6px 6px 6px 0; }*/
     :root{
  --bg1: #0ea5e9;     /* sky */
  --bg2: #8b5cf6;     /* violet */
  --card-bg: rgba(255,255,255,0.85);
  --text: #0f172a;    /* slate-900 */
  --muted: #475569;   /* slate-600 */
  --ring: #6366f1;    /* indigo */
  --ok: #16a34a;      /* green */
  --warn: #dc2626;    /* red */
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.15);
  --radius: 16px;
  --space: 14px;
}

/* Gradient page background */
html, body{
  height: 100%;
}
body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  padding: clamp(14px, 2vw, 28px);
}

/* Title */
h1{
  color: #fff;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
  margin: 0 0 16px 0;
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
}

/* Form (glass card) */
#add-book-form{
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(12px, 2vw, 18px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px 0;
}

#add-book-form input,
#add-book-form select{
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.98rem;
  outline: none;
  background: #fff;
  transition: box-shadow .2s ease, border-color .2s ease, transform .06s ease;
}
#add-book-form input:focus,
#add-book-form select:focus{
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
}

#handleAddBook{
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  transition: transform .06s ease, box-shadow .2s ease, filter .2s ease;
}
#handleAddBook:hover{ filter: brightness(1.03); }
#handleAddBook:active{ transform: translateY(1px) scale(.99); }

/* Make the form responsive: on narrow screens, stack fields */
@media (max-width: 900px){
  #add-book-form{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px){
  #add-book-form{ grid-template-columns: 1fr; }
}

/* Responsive grid for book cards */
.grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

/* Book card (glass) */
.book-card{
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--card-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .2s ease;
}
.book-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(2, 6, 23, 0.18);
}

.book-card h3{
  margin: 0 0 6px 0;
  font-size: 1.05rem;
}
.book-card p{
  margin: 4px 0;
  color: var(--muted);
}

/* Buttons inside cards */
.book-card button{
  border: 1px solid rgba(15,23,42,0.12);
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  margin-right: 8px;
  margin-top: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .06s ease, box-shadow .2s ease;
}
.book-card button:hover{
  box-shadow: 0 6px 16px rgba(2,6,23,0.12);
}
.book-card button:active{
  transform: translateY(1px) scale(.99);
}
.book-card button.toggle{
  border-color: rgba(22,163,74,0.35);
}
.book-card button.remove{
  border-color: rgba(220,38,38,0.35);
  color: var(--warn);
}

/* Read/Unread badges (optional inline style alternative) */
.read-badge{
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: white;
  background: var(--ok);
}
.unread-badge{
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: white;
  background: var(--warn);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; }
}
