/* ===================================
   Top of the Stacks - Global Styles
   =================================== */

/* Base */
body {
  font-family: Arial, Tahoma, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
}

/* Banner */
.banner {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}

/* Navigation */
.nav {
  background-color: rgba(25, 140, 160, 0.9);
  padding: 0;
  margin: 0;
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
}

.nav li {
  margin: 0;
}

.nav a {
  display: block;
  color: white;
  text-decoration: none;
  padding: 12px 25px;
  font-weight: bold;
  transition: background-color 0.2s;
}

.nav a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.nav a.active {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Dropdown Navigation */
.nav .dropdown {
  position: relative;
}

.nav .dropdown-toggle {
  cursor: pointer;
}

.nav .dropdown-toggle::after {
  content: ' \u25BC';
  font-size: 0.7em;
}

.nav .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: rgba(25, 140, 160, 0.95);
  min-width: 180px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav .dropdown:hover .dropdown-menu {
  display: block;
}

.nav .dropdown-menu li {
  margin: 0;
}

.nav .dropdown-menu a {
  padding: 10px 20px;
  font-size: 0.9em;
  white-space: nowrap;
}

.nav .dropdown-menu a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  color: #333;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 30px;
  color: rgba(25, 140, 160, 0.85);
}

.header h2 {
  color: rgba(25, 140, 160, 0.85);
  margin-bottom: 10px;
}

.header p {
  color: #666;
}

.header a {
  color: rgba(25, 140, 160, 1);
  text-decoration: none;
  font-weight: bold;
}

.header a:hover {
  text-decoration: underline;
}

/* Buttons */
.btn {
  display: inline-block;
  background-color: rgba(25, 140, 160, 0.85);
  color: white;
  padding: 12px 28px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  border: none;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.2s;
}

.btn:hover {
  background-color: rgba(25, 140, 160, 1);
}

.btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: #6c757d;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

/* Cards (shared by quiz, lists index) */
.card {
  background: white;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.card h3 {
  color: rgba(25, 140, 160, 0.85);
  margin: 0 0 10px 0;
}

.card p {
  color: #666;
  margin: 0 0 15px 0;
  line-height: 1.5;
}

.card .btn {
  padding: 10px 20px;
  font-size: 0.9em;
}

.card:hover .btn {
  background-color: rgba(25, 140, 160, 1);
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

/* Content Box */
.content {
  background: white;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  line-height: 1.8;
}

.content p {
  margin: 0 0 20px 0;
}

.content p:last-child {
  margin-bottom: 0;
}

/* Book Table (shared by fiction/nonfiction lists) */
.book-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.book-table th {
  background-color: rgba(25, 140, 160, 0.85);
  color: white;
  padding: 15px;
  text-align: left;
  font-weight: bold;
}

.book-table th:first-child {
  text-align: center;
  width: 60px;
}

.book-table td {
  padding: 12px 15px;
  vertical-align: middle;
}

.book-title {
  font-weight: bold;
  color: #333;
}

.book-author {
  color: #666;
}

.book-date {
  color: #888;
  font-size: 0.9em;
}

/* Rank Badges */
.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 0.95em;
}

.rank-1 { background: linear-gradient(135deg, #D4AF37, #B8860B); color: #fff; }
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #808080); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #A0522D); color: #fff; }
.rank-top10 { background: rgba(25, 140, 160, 0.85); color: white; }
.rank-other { background: rgba(25, 140, 160, 0.25); color: rgba(25, 140, 160, 1); }

/* Genre Key */
.genre-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.genre-key-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9em;
}

.genre-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
