/* ==========================================================================
   Reset & Box-Sizing
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f4f4;
  color: #333;
}

main {
  padding: 1em;
}

/* ==========================================================================
   Navbar (Responsive)
   ========================================================================== */
/* .navbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background: #E7E7E7;
  padding: 0.5em;
	text-decoration: none;
}

nav a {
  color: #8C8C8C;
  margin: 0 1em;
  text-decoration: none;
  padding: 0.5em 0;
  transition: background 0.2s;
  padding:10px;

}

.navbar ul {
	text-decoration: none;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

li:marker {
	text-decoration: none !important;
}


/* Stack nav links on small screens */
@media (max-width: 600px) {
  nav {
    flex-direction: column;
    align-items: stretch;
  }
  nav a {
    margin: 0.25em 0;
    text-align: center;
  }
} */

/* ==========================================================================
   Headings & Text
   ========================================================================== */
h2 {
  margin-top: 0;
  margin-bottom: 0.5em;
}

.error {
  color: red;
  margin-bottom: 1em;
}

/* ==========================================================================
   Grid Layout
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1em;
  margin-top: 1em;
}

/* Single-column grid on narrow viewports */
@media (max-width: 500px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Book Cards
   ========================================================================== */
.card {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.5em;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card img {
  max-width: 100%;
  height: auto;
  margin-bottom: 0.5em;
}

.card h3 {
  font-size: 1rem;
  margin: 0.5em 0;
}

.card p {
  font-size: 0.9rem;
  color: #555;
  margin: 0.25em 0;
}

.card a {
  text-decoration: none;
  color: inherit;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.card button {
  margin-top: 0.5em;
  padding: 0.5em 1em;
  border: none;
  border-radius: 4px;
  background: #0066cc;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.card button:hover {
  background: #005bb5;
}

.card button[disabled] {
  background: #ccc;
  cursor: default;
}

/* ==========================================================================
   Utility & Spacing
   ========================================================================== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1em;
}

/* Progress controls */
.progress-section {
  margin-top: 1em;
  text-align: left;
}

.progress-section label {
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.5em;
}

.pages-input {
  width: 4em;
  padding: 0.25em;
  font-size: 1rem;
}

/* Bar wrapper */
.progress-container {
  position: relative;
  background: #e0e0e0;
  border-radius: 4px;
  height: 1.2em;
  overflow: hidden;
}

/* The fill */
.progress-bar {
  background: #28a745;
  height: 100%;
  width: 0%;
  transition: width 0.3s ease;
}

/* Percentage text overlay */
.progress-text {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  line-height: 1.2em;
  color: #fff;
  text-shadow: 0 0 2px rgba(0,0,0,0.5);
}

.save-progress-btn {
  margin-left: 0.5em;
  padding: 0.3em 0.6em;
  font-size: 0.85rem;
  border: 1px solid #0066cc;
  background: #fff;
  color: #0066cc;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  position: relative;;
}

.save-progress-btn:hover {
  background: #0066cc;
  color: #fff;
}

.save-progress-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  background: #f0f4f8;
  transition: transform 0.3s ease;
}

.login-form {
  background: white;
  padding: 2rem 2.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-width: 400px;
  width: 100%;
  font-family: system-ui;
}

.login-form h2 {
  margin-top: 0;
  font-size: 1.6rem;
  color: #0078d4;
}

.subtitle {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 1.5rem;
}

.login-form label {
  display: block;
  margin: 0.5rem 0 0.2rem;
  font-weight: 500;
  color: #333;
}

.login-form input {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.login-form input:focus {
  border-color: #0078d4;
  outline: none;
}

.login-form button {
  width: 100%;
  padding: 0.7rem;
  background: #0078d4;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.login-form button:hover {
  background: #005fa3;
}

.footer-text {
  text-align: center;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.footer-text a {
  color: #0078d4;
  text-decoration: none;
}

.error-message {
  background: #ffe0e0;
  color: #b00020;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  text-align: center;
}

/* Shake animation */
@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.4s ease;
}
.star {
  color: #ccc;
}
.star.filled,
.star.hovered {
  color: #f5b301;
}

.remove-button {
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  margin-top: 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}
.remove-button:hover {
  background-color: #c0392b;
}

.back-button {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #0078d4;
  text-decoration: none;
  background: #e6f2ff;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.back-button:hover {
  background: #cce4ff;
}

.book-details {
  max-width: 900px;
  margin: auto;
  padding: 2rem;
  font-family: system-ui;
}

.book-header {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.book-cover {
  max-width: 180px;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.book-meta {
  flex: 1 1 300px;
}

.book-meta h1 {
  margin: 0 0 .3rem;
  font-size: 2rem;
}

.book-meta p {
  margin: .2rem 0;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.4;
}

.progress-container {
  margin-top: 1rem;
  height: 20px;
  background: #eee;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  background: #4caf50;
  height: 100%;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
  transition: width 0.3s ease;
}

.star-rating {
  margin-top: 1rem;
}

.star-rating .star {
  font-size: 1.4rem;
  cursor: pointer;
  color: #ccc;
}

.star-rating .star.filled {
  color: #f5b301;
}

.book-description {
  margin-top: 2rem;
  background: #fafafa;
  padding: 1.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.book-description h2 {
  margin-top: 0;
  border-bottom: 2px solid #eee;
  padding-bottom: .5rem;
}

.actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.actions button {
  background: #0078d4;
  color: white;
  padding: .5rem 1rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  flex: 1 1 140px;
  text-align: center;
}

.actions button.remove {
  background: #d9534f;
}

.actions button[disabled] {
  background: #ccc;
  cursor: not-allowed;
}

.about-content {
  display: none;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #444;
}

.toggle-about-btn {
  background: none;
  border: none;
  font-weight: bold;
  cursor: pointer;
  color: #0077cc;
}

.reading-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.reading-meta label {
  display: flex;
  flex-direction: column;
}