/* Base styling */
body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  background: #f0f2f5;
  color: #222;
}

/* Header */
header {
  background-color: #247182;
  color: white;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.15);
  text-align: center;
  border-bottom: 1px solid #ccc;
}

header h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  color: white;
}

/* Navigation */
nav {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.3rem 0.2rem;
  opacity: 0.85;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

nav a:hover,
nav a.active {
  opacity: 1;
  border-bottom: 2px solid white;
}

/* Layout */
main {
  padding: 2rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}

/* Shared card styles */
.card,
.book-entry {
  background: white;
  border-radius: 16px;
  border: 2px solid #ddd;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover,
.book-entry:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* Summary bar */
#summary {
  background: white;
  border-radius: 16px;
  border: 2px solid #ddd;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.2rem;
}

/* Leaderboard */
#leaderboard {
  background: white;
  border-radius: 16px;
  border: 2px solid #ddd;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

#leaderboard h2 {
  font-size: 1.3rem;
  color: #247182;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1rem;
}

#leaderboard table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

#leaderboard th,
#leaderboard td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

#leaderboard th {
  background-color: #f7f9fb;
  color: #247182;
  font-weight: 600;
}

#leaderboard td:last-child {
  width: 5ch;
  text-align: right;
  font-weight: 500;
  color: #444;
}

/* Feed */
#feed {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#feed h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #247182;
  margin-bottom: 1rem;
}

/* Book cards */
.book-entry {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}

.book-entry img {
  width: auto;
  height: 120px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: #f0f0f0;
  border: 1px solid #ccc;
  transition: transform 0.2s ease;
}

.book-entry img:hover {
  transform: scale(1.05);
}

.book-details h3 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.book-details p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.4;
}

/* Submit form */
#submit-form h2 {
  color: #247182;
  margin-top: 0;
}

form label {
  display: block;
  margin-top: 1rem;
  font-weight: 500;
  color: #333;
}

form input,
form select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  margin-top: 0.4rem;
  font-size: 1rem;
  border: 2px solid #ccc;
  border-radius: 8px;
  background-color: white;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

form button[type="submit"] {
  margin-top: 1.5rem;
  background-color: #247182;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

form button[type="submit"]:hover {
  background-color: #1c5d6b;
}

/* Profile slide animation */
.profile-slide {
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform-origin: top center;
}

.profile-slide.hidden {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
}

.profile-slide.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Star and fraction styles */
.star-container span.filled {
  color: #247182 !important;
}

.fraction-buttons button {
  padding: 0.3rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  color: black;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.fraction-buttons button.active,
.fraction-buttons button.active:focus {
  background-color: #247182 !important;
  color: white !important;
  border-color: #247182 !important;
}

.fraction-buttons button:hover {
  background-color: #eee;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #247182 !important;
  outline: none;
  box-shadow: 0 0 0 1px #247182;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield; /* Firefox */
}
.star-container span {
  pointer-events: auto;
  z-index: 1;
}
input[type="date"] {
  font-family: 'Poppins', sans-serif;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
  background: white;
  color: black;
}
input[type="date"]:focus {
  outline: none;
  border-color: #247182;
  box-shadow: 0 0 0 2px rgba(36, 113, 130, 0.2);
}
