:root {
  /* Brand */
  --color-primary: #007bff;
  --color-primary-hover: #0069d9;
  --color-primary-dark: #0056b3;

  /* Neutrals */
  --color-body-bg: #f4f4f4;
  --color-surface: #ffffff;
  --color-text: #333333;
  --color-text-strong: #222222;
  --color-text-muted: #666666;

  /* Secondary */
  --color-secondary: #e9ecef;
  --color-secondary-hover: #d6d8db;

  /* Borders */
  --color-border: #cccccc;
  --color-border-light: #eaeaea;
  --color-border-lighter: #e0e0e0;

  /* Accents for meta text */
  --color-author: #444444;
  --color-year: #777777;
  --color-isbn: #999999;

  /* Danger */
  --color-danger: #dc3545;
  --color-danger-hover: #c82333;
  --color-danger-light-bg: #f4f1ec;
  --color-danger-light-hover: #e8e3dd;
  --color-danger-light-text: #a12c2c;
  --color-danger-border: #dc3545;

  /* Subjects (tags) */
  --color-subject-bg: #e2ecf9;
  --color-subject-text: #24496d;

  /* Banners */
  --color-warm-bg: #e6f4ea;
  --color-warm-text: #276749;
  --color-warm-border: #c6e2d5;

  --color-cold-bg: #fff3cd;
  --color-cold-text: #856404;
  --color-cold-border: #ffeeba;

  /* Alerts */
  --alert-radius: 8px;
  --alert-padding: 12px 14px;
  --alert-border: 1px solid;

  /* Success */
  --alert-success-bg: var(--color-warm-bg);
  --alert-success-text: var(--color-warm-text);
  --alert-success-border: var(--color-warm-border);

  /* Error */
  --alert-error-bg: #fdecec;
  --alert-error-text: #8a1f1f;
  --alert-error-border: #f5c2c7;

  /* Info */
  --alert-info-bg: #e9f2ff;
  --alert-info-text: #0b4a8b;
  --alert-info-border: #c9defa;

  /* Warning */
  --alert-warning-bg: var(--color-cold-bg);
  --alert-warning-text: var(--color-cold-text);
  --alert-warning-border: var(--color-cold-border);
}

/* General Reset */
* {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Page Layout */
body {
    background-color: var(--color-body-bg);
    color: var(--color-text);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Containers */
.container {
    background: var(--color-surface);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    text-align: left;
    margin-bottom: 20px;
}

.layout {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.login-container {
    background: var(--color-surface);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    text-align: left;
    margin-bottom: 20px;
}

.login-layout {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}


/* Headings */
h1 {
    font-size: 2.5rem;
    color: var(--color-primary);
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
}

h2 {
    font-size: 2rem;
    color: var(--color-primary-dark);
    margin-top: 20px;
    margin-bottom: 8px;
}

h3 {
    font-size: 1.5rem;
    color: #004080;
    margin-top: 20px;
    margin-bottom: 8px;
}

body.index-page h2 {
	margin-top: 0px;
	margin-bottom: 30px;
}

/* Forms */
form {
    background: transparent;
    padding: 20px;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    gap: 10px;
    margin: auto;
}

form label {
    font-weight: bold;
    margin-bottom: 5px;
}

form input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    font-size: 1rem;
    margin-bottom: 15px;
}

form select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    font-size: 1rem;
    margin-bottom: 15px;
    background-color: var(--color-surface);
    appearance: none;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

/* Primary */
.btn--primary {
  background-color: var(--color-primary);
  color: #fff;
}
.btn--primary:hover {
  background-color: var(--color-primary-hover);
}

/* Secondary */
.btn--secondary {
  background-color: var(--color-secondary);
  color: #212529;
}
.btn--secondary:hover {
  background-color: var(--color-secondary-hover);
}

/* Danger / Cancel */
.btn--danger {
  background-color: var(--color-danger);
  color: #fff;
}
.btn--danger:hover {
  background-color: var(--color-danger-hover);
}

/* Light Danger */
.btn--danger-light {
  background-color: var(--color-danger-light-bg);
  color: var(--color-danger-light-text);
  border: 1px solid var(--color-danger-border);
}
.btn--danger-light:hover {
  background-color: var(--color-danger-light-hover);
}

/* Small */
.btn--sm {
  padding: 5px 10px;
  font-size: 0.85rem;
}

/* Block (full width) */
.btn--block {
  display: block;
  width: 100%;
}

/* Sizes */
.btn--lg { padding: 12px 18px; font-size: 1.05rem; }

/* Center a single CTA with breathing room */
.section-cta { display: flex; justify-content: center; margin: 18px 0; }

/* Pagination spacing */
.pagination-buttons { margin-top: 0; margin-bottom: 0; gap: 12px; display: flex; justify-content: center; }

.pagination-buttons:has(button:not([style*="display: none"])) {
  margin-top: 16px;
}

.pagination-buttons button { margin: 0; }

#recommendButton { margin-bottom: 0; }

/* Links */
.links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.links a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.links a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* =========================
   BOOK CARDS (uniform, responsive)
   ========================= */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 20px;
  align-items: stretch;
}

.book-grid > a {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.book-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 12px 12px 20px;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 100%;

  transition: box-shadow 0.25s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  transform: translateY(-4px);
}

/* Cover */
.book-card img.book-cover-img {
  width: 150px;
  height: 220px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 6px;
  flex: 0 0 auto;
}

/* Title block */
.book-card .book-title {
  line-height: 1.2;
  height: calc(1.2em * 1.5);
  margin: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}

.book-card .book-title-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  line-height: 1.2;
  max-width: 100%;

  font-size: 1.1rem;
  color: var(--color-primary);
}

/* Meta */
.book-card p {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin: 0;
  flex: 0 0 auto;
}
.book-card p.author { color: var(--color-author); }
.book-card p.author i { font-style: italic; }
.book-card p.year   { font-size: 0.85rem; color: var(--color-year); }
.book-card p.isbn   { font-size: 0.8rem;  color: var(--color-isbn); }

/* push meta block to bottom */
.book-card h3 + p { margin-top: auto; }

.subject-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 5px;
    margin-bottom: 15px;
    gap: 6px 10px;
}

.subject-pill {
    background: var(--color-primary);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    line-height: 1.3;
}

/* Scoped styling for book page subject block */
.book-subjects-wrapper {
    margin-top: 10px;
    position: relative;
}

.subject-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.book-subjects-wrapper strong {
    white-space: nowrap;
    flex-shrink: 0;
}

.book-subjects-wrapper .subject-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    flex: 1 1 auto;
    justify-content: flex-start;
}

.book-subjects-collapsed {
    max-height: 5.7em;
    overflow: hidden;
    position: relative;
}

.book-subjects-collapsed.fade-active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2.5em;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--color-surface) 85%);
    pointer-events: none;
}

.book-subjects-expanded {
    max-height: none;
}

.book-subjects-wrapper .subject-list.centered {
    justify-content: center;
}

/* Toggle Buttons for similarity options */
.toggle-group {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.toggle-option {
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    cursor: pointer;
    background-color: #f2f2f2;
    transition: background-color 0.3s ease, color 0.3s ease;
    user-select: none;
}

.toggle-option:hover {
    background-color: #e0e0e0;
}

.toggle-option.selected {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}


.toggle-link {
    display: inline-block;
    padding: 1px 2px;
    color: var(--color-primary);
    font-size: 0.85em;
    font-weight: normal;
    text-decoration: underline;
    cursor: pointer;
    user-select: none;
    line-height: 1.2;
}

.toggle-link:hover {
    color: var(--color-primary-dark);
    text-decoration: none;
}

.toggle-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.toggle-option.disabled::after {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.toggle-option.disabled:hover::after {
    opacity: 1;
}

/* Context-specific messages */
#simModeSelector .toggle-option.disabled::after {
    content: "Unavailable for this book (no ALS data)";
}

#modeSelector .toggle-option.disabled::after {
    content: "Unavailable until you’ve rated 10+ books";
}

button[disabled],
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Hybrid blend slider */
.blend-controls {
  display: block;
  margin: 20px 0 12px;
}

.blend-row {
  display: block;
}

/* Slider row with fixed side labels */
.blend-scale {
  display: grid;
  grid-template-columns: auto 1fr auto; /* left label | slider | right label */
  align-items: center;
  column-gap: 10px;
  width: 100%;
}

.blend-scale .side-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

input[type="range"].blend-slider {
  width: 100%;
  margin: 0;
}

/* Centered numeric value under the slider */
.blend-meta {
  margin-top: 6px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.blend-controls.disabled {
  opacity: 0.5;
  pointer-events: none;
}

#wMeta {
    text-align: center;
    margin-top: 6px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Error messages */
.form-error {
    color: var(--color-danger);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

/* Subject input suggestions + pills (interactive) */
#subject-input-container {
    position: relative;
    width: 100%;
}

#subject-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    font-size: 1rem;
    margin-bottom: 8px;
}

.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    max-height: 150px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.suggestion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    cursor: pointer;
}

.suggestion:hover {
    background-color: #f0f0f0;
}

.subject-name {
    flex: 1;
    font-size: 1rem;
}

.subject-count {
    font-size: 0.85rem;
    color: #888888;
    margin-left: 10px;
    white-space: nowrap;
}

/* Pills for selection (signup/search) */
.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.pill {
    background: var(--color-primary);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
}

.pill-remove {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    user-select: none;
}

/* Lists */
ul {
    padding-left: 20px;
    list-style-position: inside;
}

li {
    margin-bottom: 10px;
}

/* Navbar */
.navbar {
    width: 100%;
    background-color: var(--color-primary);
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    margin-bottom: 20px;
}

.navbar-inner {
    max-width: 1000px;
    margin: auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.navbar-center {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.navbar-right {
    position: absolute;
    right: 20px;
    display: flex;
    gap: 16px;
}

.navbar a {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    padding: 6px 14px;
    border-radius: 20px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.navbar a:hover {
    background-color: var(--color-primary-dark);
}

.navbar a.active {
    background-color: #ffffff;
    color: var(--color-primary);
    font-weight: bold;
    border-radius: 20px;
    padding: 6px 14px;
}

/* Comments Section */
.comments-section {
    margin-top: 30px;
    margin-bottom: 30px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 15px;
}

.comment-block {
    border: 1px solid var(--color-border-lighter);
    border-radius: 6px;
    background-color: var(--color-surface);
    padding: 14px 16px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 8px;
}

.comment-username {
    font-weight: bold;
    color: var(--color-text-strong);
}

.comment-rating {
    background-color: var(--color-primary);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.comment-body {
    font-size: 0.95rem;
    color: #444444;
    line-height: 1.4;
    white-space: pre-wrap;
}

.no-comments {
    color: var(--color-text-muted);
    text-align: center;
    font-style: italic;
    margin: 10px 0 0;
}

/* Interactions (vertical scroll list) */
.interactions-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 7px;
}

.interaction-card {
    border: 1px solid var(--color-border-lighter);
    border-radius: 6px;
    background-color: var(--color-surface);
    padding: 8px 12px;
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: stretch;
    text-decoration: none;
    color: inherit;
}

#ratingsContainer {
  padding-right: 5px;    
}

/* Cover defines the card height */
.interaction-cover {
    width: 64px;
    height: 96px;              /* controls overall card height */
    border-radius: 4px;
    object-fit: cover;
    background: var(--color-secondary);
    flex-shrink: 0;
}

/* Body is a strict 3-row grid: top (title+author), middle (comment), bottom (meta) */
.interaction-body {
    flex: 1;
    display: grid;
    grid-template-rows: auto 1fr auto;   /* top | middle | bottom */
    gap: 4px;
    overflow: hidden;
    max-height: 96px;                    /* match cover height */
}

/* Top: title + author */
.interaction-top {
    min-height: 0;
    display: grid;
    grid-auto-rows: min-content;
    gap: 2px;
}

.interaction-title {
    font-weight: 600;
    color: var(--color-text-strong);
    line-height: 1.25;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Clamp title differently when comment exists to keep card compact */
.interaction-body.has-comment .interaction-title { -webkit-line-clamp: 1; }
.interaction-body:not(.has-comment) .interaction-title { -webkit-line-clamp: 2; }

.interaction-author {
    color: var(--color-author);
    font-size: 0.85rem;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.interaction-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    font-size: 0.8rem;
    min-height: 0;
}

.interaction-date { color: var(--color-text-muted); font-size: 0.85rem; white-space: nowrap; }

.interaction-type {
    border: 1px solid var(--color-border-lighter);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    background: #fafafa;
}

/* Middle: comment excerpt (takes flexible space) */
.interaction-middle { min-height: 0; overflow: hidden; }
.interaction-comment {
    font-size: 0.85rem;
    color: #444444;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;              /* keep compact */
    margin-top: 2px;
}

/* Thin scrollbar */
.interactions-list::-webkit-scrollbar {
    width: 8px;
}
.interactions-list::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 8px;
    margin-left: 8px;
}

/* Book Page Book Card */
.book-header {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.book-cover img {
    width: 160px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.book-details {
    flex: 1;
    min-width: 220px;
}

.book-title {
    margin-bottom: 0.25em;
    font-size: 1.8rem;
}

.book-author {
    font-weight: bold;
    margin-bottom: 0.5em;
    font-size: 1.1rem;
}

.book-meta {
    margin-bottom: 0.4em;
    color: #555555;
    font-size: 0.95rem;
}

.rating-summary {
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    box-shadow: none;
    font-size: inherit;
    color: inherit;
}

.subject-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0.5em;
}

.subject-pill {
    background-color: var(--color-subject-bg);
    color: var(--color-subject-text);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.book-description-container {
    margin-bottom: 30px;
}

.book-description.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-description.expanded {
    max-height: none;
}

.toggle-link {
    color: var(--color-primary);
    cursor: pointer;
    font-size: 0.9em;
}

.profile-card {
    padding: 10px 20px 20px;
    background-color: #fdfdfd;
    border: 1px solid #dddddd;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    row-gap: 10px;
    column-gap: 20px;
    margin-top: 10px;
    margin-bottom: 20px;
}

.profile-status-row {
    margin-top: 10px;
}

.warm-user-banner, .cold-user-banner {
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-top: 0px;
    margin-bottom: 20px;
}

.no-subjects {
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 10px;
}

.warm-user-banner {
    background-color: var(--color-warm-bg);
    color: var(--color-warm-text);
    border: 1px solid var(--color-warm-border);
}

.cold-user-banner {
    background-color: var(--color-cold-bg);
    color: var(--color-cold-text);
    border: 1px solid var(--color-cold-border);
}

/* Alert/Success Banners */
.page-banner {
  margin: 0 0 20px 0;
}

.alert {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 10px;
  padding: var(--alert-padding);
  border-radius: var(--alert-radius);
  border: var(--alert-border);
  font-size: 0.95rem;
  line-height: 1.35;
  margin-bottom: 20px;
}

.alert strong {
  font-weight: 600;
}

.alert--success {
  background: var(--alert-success-bg);
  color: var(--alert-success-text);
  border-color: var(--alert-success-border);
}

.alert--error {
  background: var(--alert-error-bg);
  color: var(--alert-error-text);
  border-color: var(--alert-error-border);
}

.alert--info {
  background: var(--alert-info-bg);
  color: var(--alert-info-text);
  border-color: var(--alert-info-border);
}

.alert--warning {
  background: var(--alert-warning-bg);
  color: var(--alert-warning-text);
  border-color: var(--alert-warning-border);
}

/* Optional close button */
.alert__close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
}
.alert__close:hover { opacity: 0.75; }

/* Spacing if multiple banners stack */
.page-banner + .page-banner { margin-top: 10px; }

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-header h3 {
  margin: 0;
}

/* Footer */
.site-footer {
  background-color: var(--color-primary-dark);
  color: #fff;
  padding: 16px 20px;
  margin-top: 0px;
  border-radius: 8px 8px 0 0;
}

.footer-inner {
  max-width: 1000px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.footer-left p {
  margin: 0;
  font-size: 0.9rem;
}

.footer-right {
  display: flex;
  gap: 16px;
}

.footer-right a {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-right a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container, .login-container {
        width: 95%;
        padding: 20px;
    }

    form {
        width: 100%;
    }

    .links {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }
}

/* --- Hard mobile fixes --- */

/* ≤700px */
@media (max-width: 700px) {
  html, body {
    width: 100%;
    overflow-x: hidden;
  }

  .navbar-inner,
  .navbar-center,
  .navbar-right,
  .book-details,
  .container,
  .login-container {
    min-width: 0;
  }

  .navbar-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    max-width: 100%;
  }

  .navbar-center {
    flex: 1 1 auto;
    justify-content: center;
    gap: 6px;
  }

  .navbar-right {
    position: static;
    width: auto;
    flex: 0 1 auto;
    justify-content: center;
    gap: 6px;
    margin: 0;
  }

  .navbar-left {
    flex: 0 1 auto;
    justify-content: center;
  }

  .navbar a {
    padding: 6px 10px;
    white-space: nowrap;
  }
}

/* ≤600px */
@media (max-width: 600px) {
  .book-header {
    flex-direction: column;
    align-items: center;
  }

  .book-details {
    min-width: 0;
    width: 100%;
  }

  .book-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
  }

  .book-card img.book-cover-img {
    width: 130px;
    height: 190px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .container,
  .login-container {
    padding: 16px;
  }

  body {
    align-items: stretch;
    padding: 10px;
  }

  img,
  video {
    max-width: 100%;
    height: auto;
  }
}

/* ≤560px */
@media (max-width: 560px) {
  .book-header {
    flex-direction: column;
    align-items: center;
  }

  .book-details {
    min-width: 0;
    width: 100%;
  }

  .book-cover img.book-cover-img {
    width: 140px;
  }

  .book-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
  }

  .book-card img.book-cover-img {
    width: 130px;
    height: 190px;
  }

  html,
  body {
    overflow-x: hidden;
  }

  .container,
  .login-container {
    padding: 16px;
  }
}
