/* Dark base */
:root{
  --bg:#0f0f10;
  --panel:#1b1b1d;
  --muted:#bdbdbd;
  --accent:#6b5dd6;
  --accent-2:#0a9cff;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background:var(--bg);
  color:#f5f5f5;
}

/* Top bar: left (buttons) - center (filters) - right (isbn add) */
.top-bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 18px;
  background:var(--panel);
  border-bottom:1px solid rgba(255,255,255,0.03);
  flex-wrap:wrap;
}

/* three sections */
.left-section, .center-section, .right-section{
  display:flex;
  gap:8px;
  align-items:center;
}

/* counter display */
.counter-display {
  color:#ccc;
  font-size:0.95rem;
  font-weight:500;
  min-width:100px;
  text-align:center;
}

/* center expands */
.center-section{flex:1; justify-content:center;}

/* filtri centrali */
.center-section label {
  font-size:0.85rem;
  color:#aaa;
  margin-right:4px;
}

.center-section select {
  margin-right:10px;
}

/* inputs / selects */
input[type="text"], select{
  background:#151516;
  color:#eee;
  border:1px solid rgba(255,255,255,0.03);
  padding:8px 10px;
  border-radius:8px;
  font-size:0.95rem;
  max-width:200px;
  text-overflow:ellipsis;
  white-space:nowrap;
  overflow:hidden;
}

/* buttons */
button{
  background:#2a2a2b;
  color:#fff;
  border: none;
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
  transition:transform .08s ease, background .12s ease;
}
button:hover{ transform:translateY(-2px); background:#3a3a3b;}
button.active{ background:var(--accent); box-shadow:0 6px 18px rgba(107,93,214,0.14); }

/* grid */
.book-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:20px;
  padding:20px;
  align-items:start;
}

/* card */
.book-card{
  width:100%;
  max-width:220px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:12px;
  overflow:hidden;
  box-shadow: 0 6px 22px rgba(0,0,0,0.5);
  padding-bottom:10px;
  text-align:center;
  margin:0 auto;
  position:relative;
}

.book-card img{
  width:100%;
  height:260px;
  object-fit:cover;
  display:block;
}

/* small cover fallback styling */
.book-card .no-cover{
  height:260px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  background:#111;
}

/* info */
.book-info{ padding:10px; display:flex; flex-direction:column; gap:6px; align-items:center;}
.book-title{ font-weight:700; color:#fff; font-size:1rem; line-height:1.1; }
.book-author{ color:var(--muted); font-size:0.9rem; }
.book-meta{ color:#9ea0a6; font-size:0.85rem; }
.book-genre{ color:#a9a6d9; font-size:0.85rem; max-width:180px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.book-isbn{ color:#8e8e8e; font-size:0.8rem; }

/* wishlist + button */
.add-btn{
  position:absolute;
  top:10px;
  right:10px;
  width:32px;
  height:32px;
  border-radius:50%;
  border:none;
  background:var(--accent-2);
  color:#fff;
  font-weight:700;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(10,156,255,0.12);
  z-index:20;
}
.add-btn:hover{ transform:translateY(-2px); }

/* mark-read & remove buttons */
.mark-read-btn, .remove-btn {
  position:absolute;
  width:32px;
  height:32px;
  border-radius:50%;
  border:none;
  color:#fff;
  font-weight:700;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:1rem;
  z-index:30;
}

.mark-read-btn {
  top:10px;
  left:10px;
  background:#28a745;
  box-shadow:0 4px 12px rgba(40,167,69,0.2);
}

.remove-btn {
  top:10px;
  right:10px;
  background:#d9534f;
  box-shadow:0 4px 12px rgba(217,83,79,0.2);
}

.mark-read-btn:hover { transform:translateY(-2px); }
.remove-btn:hover { transform:translateY(-2px); }

/* badge classes for Letto/Rimossi view */
.badge {
  position:absolute;
  top:8px;
  left:8px;
  padding:4px 8px;
  border-radius:8px;
  font-size:0.8rem;
  font-weight:600;
  color:#fff;
  z-index:25;
}
.badge-read { background:#28a745; box-shadow:0 2px 8px rgba(40,167,69,0.25); }
.badge-removed { background:#d9534f; box-shadow:0 2px 8px rgba(217,83,79,0.25); }

/* responsive */
@media (max-width:820px){
  .center-section{ order:3; width:100%; justify-content:center; margin-top:10px; margin-bottom:4px;}
  .left-section{ order:1; }
  .right-section{ order:2; margin-left:auto; }
  .book-grid{ grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .book-card img{ height:220px; }
}

