/* ==========================================================
   Digital Bookstore - Booktopia-inspired theme
   INT1059 Advanced Web - Final Project
   ========================================================== */

/* ---------- Reset + base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bt-blue: #0a3a82;            /* primary (Booktopia navy) */
  --bt-blue-dark: #072760;
  --bt-orange: #f26722;          /* CTA accent */
  --bt-orange-dark: #d9551a;
  --bt-yellow: #f5b301;          /* star rating */
  --bt-bg: #f4f6fa;
  --bt-card: #ffffff;
  --bt-border: #e2e8f0;
  --bt-text: #1e2a44;
  --bt-muted: #64748b;
  --shadow-sm: 0 2px 6px rgba(10,58,130,0.08);
  --shadow-md: 0 10px 24px rgba(10,58,130,0.12);
}

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bt-bg);
  color: var(--bt-text);
  line-height: 1.5;
}

a { color: var(--bt-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Top header / navbar ---------- */
.bt-header {
  background: var(--bt-blue);
  color: #fff;
  padding: 14px 0;
  box-shadow: var(--shadow-sm);
}

.bt-header .bar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.bt-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}
.bt-logo:hover { text-decoration: none; color: #fff; }
.bt-logo span { color: var(--bt-orange); }

.bt-search {
  flex: 1 1 420px;
  display: flex;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  min-width: 280px;
}
.bt-search select,
.bt-search input {
  border: 0;
  padding: 10px 12px;
  font-size: 0.95rem;
  color: var(--bt-text);
  outline: none;
}
.bt-search select {
  background: #f1f5f9;
  border-right: 1px solid var(--bt-border);
  cursor: pointer;
}
.bt-search input { flex: 1; }
.bt-search button {
  background: var(--bt-orange);
  color: #fff;
  border: 0;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.bt-search button:hover { background: var(--bt-orange-dark); }

.bt-account {
  display: flex;
  gap: 10px;
  align-items: center;
}
.bt-account a {
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 4px;
}
.bt-account a:hover { background: rgba(255,255,255,0.12); text-decoration: none; }
.bt-account .cta {
  background: var(--bt-orange);
  padding: 8px 14px;
}
.bt-account .cta:hover { background: var(--bt-orange-dark); }

/* ---------- Secondary nav (genres) ---------- */
.bt-subnav {
  background: var(--bt-blue-dark);
  color: #fff;
}
.bt-subnav .menu {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.bt-subnav a {
  color: #fff;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.bt-subnav a:hover {
  background: var(--bt-blue);
  text-decoration: none;
}
.bt-subnav a.active {
  background: var(--bt-blue);
  border-bottom: 3px solid var(--bt-orange);
}
.bt-subnav .dropdown { position: relative; }
.bt-subnav .dropdown:hover .dropdown-menu { display: block; }
.bt-subnav .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  box-shadow: var(--shadow-md);
  border-radius: 0 0 6px 6px;
  z-index: 1000;
}
.bt-subnav .dropdown-menu a {
  display: block;
  color: var(--bt-text);
  padding: 10px 16px;
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
  font-size: 0.92rem;
}
.bt-subnav .dropdown-menu a:hover { background: #f1f5f9; color: var(--bt-blue); }

/* ---------- Hero banner ---------- */
.bt-hero {
  background: linear-gradient(135deg, var(--bt-blue) 0%, var(--bt-blue-dark) 100%);
  color: #fff;
  padding: 60px 0;
  text-align: center;
}
.bt-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 14px;
}
.bt-hero p {
  font-size: 1.15rem;
  max-width: 720px;
  margin: 0 auto 22px;
  opacity: 0.92;
}
.bt-hero .cta {
  display: inline-block;
  background: var(--bt-orange);
  color: #fff;
  padding: 12px 32px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: background 0.15s;
}
.bt-hero .cta:hover { background: var(--bt-orange-dark); text-decoration: none; }

/* ---------- Section titles ---------- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 40px 0 18px;
}
.section-title h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--bt-text);
  border-left: 5px solid var(--bt-orange);
  padding-left: 12px;
}
.section-title .sub { color: var(--bt-muted); font-size: 0.92rem; }

/* ---------- Book grid + card ---------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 22px;
  padding-bottom: 40px;
}
.book-card {
  background: var(--bt-card);
  border: 1px solid var(--bt-border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s;
}
.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.book-card .cover {
  position: relative;
  background: #f8fafc;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 14px;
  aspect-ratio: 3 / 4;
}
.book-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  transition: transform 0.3s;
}
.book-card:hover .cover img { transform: scale(1.04); }

.book-card .genre-tag {
  display: inline-block;
  background: #e0edff;
  color: var(--bt-blue);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
  align-self: flex-start;
}
.book-card .title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bt-text);
  margin-bottom: 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.book-card .author {
  color: var(--bt-muted);
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.book-card .rating {
  color: var(--bt-yellow);
  font-size: 0.95rem;
  margin-bottom: 12px;
}
.book-card .rating .count { color: var(--bt-muted); font-size: 0.8rem; margin-left: 4px; }

.book-card .actions { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.book-card .btn {
  display: block;
  text-align: center;
  padding: 9px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: 0;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.book-card .btn-primary { background: var(--bt-blue); color: #fff; }
.book-card .btn-primary:hover { background: var(--bt-blue-dark); text-decoration: none; }
.book-card .btn-outline { background: #fff; color: var(--bt-blue); border: 1px solid var(--bt-blue); }
.book-card .btn-outline:hover { background: #e0edff; }

/* ---------- Empty / message state ---------- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--bt-muted);
}
.empty-state h2 { font-size: 1.4rem; color: var(--bt-text); margin-bottom: 8px; }

/* ---------- Forms (login / register) ---------- */
.form-card {
  max-width: 420px;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.form-card h2 {
  color: var(--bt-blue);
  margin-bottom: 20px;
}
.form-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 0.9rem;
}
.form-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--bt-border);
  border-radius: 5px;
  font-size: 0.95rem;
  margin-bottom: 14px;
}
.form-card input:focus {
  outline: none;
  border-color: var(--bt-blue);
  box-shadow: 0 0 0 3px rgba(10,58,130,0.1);
}
.form-card button {
  width: 100%;
  padding: 12px;
  background: var(--bt-orange);
  color: #fff;
  border: 0;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.form-card button:hover { background: var(--bt-orange-dark); }
.form-card .alt { text-align: center; margin-top: 16px; font-size: 0.9rem; color: var(--bt-muted); }

/* ---------- Footer ---------- */
.bt-footer {
  background: var(--bt-blue-dark);
  color: #cbd5e1;
  padding: 30px 0;
  text-align: center;
  margin-top: 50px;
  font-size: 0.88rem;
}
.bt-footer a { color: #fff; margin: 0 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .bt-header .bar { flex-direction: column; align-items: stretch; }
  .bt-search { order: 3; width: 100%; }
  .bt-account { justify-content: flex-end; }
  .bt-hero h1 { font-size: 1.7rem; }
  .bt-hero p { font-size: 1rem; }
  .book-card .title { font-size: 0.92rem; }
}
