/* Compendium Container */
.compendium-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
}

.compendium-header {
  text-align: center;
  margin-bottom: 40px;
}

.compendium-header h2 {
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 32px;
  margin-bottom: 10px;
  color: #333;
}

.compendium-header p {
  font-size: 16px;
  color: #666;
}

/* Date Range Display */
.compendium-date-range-display {
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

.compendium-date-range-label {
  font-weight: 600;
  margin-right: 8px;
}

.compendium-date-range-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.compendium-date-range-date {
  font-weight: 500;
  color: #333;
}

.compendium-date-range-separator {
  color: #999;
}

.compendium-date-range-clear {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  background: #f0f0f0;
  color: #666;
  border-radius: 50%;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.compendium-date-range-clear:hover {
  background: #e74c3c;
  color: white;
}

/* Pagination Controls */
.compendium-pagination-controls {
  position: fixed;
  top: 120px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 100;
}

.compendium-extend-button {
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #007bff;
  border-radius: 8px;
  color: #007bff;
  font-family: 'Cinzel', 'Georgia', serif;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  white-space: nowrap;
}

.compendium-extend-button:hover {
  background: #007bff;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.3);
}

.compendium-extend-button:active {
  transform: translateY(0);
}

/* Smooth scroll animation for new cards */
.compendium-cards-grid turbo-frame {
  display: contents;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.compendium-card-item {
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

/* Stagger animation for cards */
.compendium-card-item:nth-child(1) { animation-delay: 0.05s; }
.compendium-card-item:nth-child(2) { animation-delay: 0.1s; }
.compendium-card-item:nth-child(3) { animation-delay: 0.15s; }
.compendium-card-item:nth-child(4) { animation-delay: 0.2s; }
.compendium-card-item:nth-child(5) { animation-delay: 0.25s; }
.compendium-card-item:nth-child(6) { animation-delay: 0.3s; }
.compendium-card-item:nth-child(7) { animation-delay: 0.35s; }

/* Compendium Grid */
.compendium-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

/* Card Items */
.compendium-card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compendium-card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Reading Type Specific Sizes */
.compendium-card--yearly {
  grid-column: span 2;
}

.compendium-card--yearly .compendium-card-image {
  width: 200px;
}

.compendium-card--weekly .compendium-card-image,
.compendium-card--planetary .compendium-card-image,
.compendium-card--daily .compendium-card-image {
  width: 120px;
}

/* Season Color Backgrounds */
.season-winter {
  background: linear-gradient(135deg, rgba(176, 224, 230, 0.15), rgba(135, 206, 235, 0.15));
}

.season-spring {
  background: linear-gradient(135deg, rgba(152, 251, 152, 0.15), rgba(144, 238, 144, 0.15));
}

.season-summer {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.15));
}

.season-autumn {
  background: linear-gradient(135deg, rgba(210, 105, 30, 0.15), rgba(255, 140, 0, 0.15));
}

/* Card Number Label */
.compendium-card-number {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  text-align: center;
  font-family: 'Cinzel', 'Georgia', serif;
}

/* Card Container */
.compendium-card-container {
  position: relative;
}

.compendium-card-image {
  display: block;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
  background: #f5f5f5;
  border-radius: 4px;
}

/* Wheel Card Backing (reuse from wheel styles) */
.compendium-card-item .wheel-card-backing {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 6px;
}

.compendium-card-item .wheel-card-reading-type {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.compendium-card-item .wheel-card-date {
  font-size: 12px;
  color: #888;
}

.compendium-card-item .wheel-rim-card-planet {
  font-size: 13px;
  color: #555;
  margin-top: 4px;
}

.compendium-card-item .wheel-card-spread-link {
  font-size: 16px;
  margin-top: 4px;
}

/* Transiting (Current) Card Highlight */
.compendium-card-item[data-transiting="true"] {
  box-shadow: 0 0 15px 5px rgba(255, 255, 255, 0.8),
              0 0 25px 10px rgba(255, 0, 255, 0.3),
              0 0 35px 15px rgba(0, 255, 255, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .compendium-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
  }

  .compendium-card--yearly {
    grid-column: span 1;
  }

  .compendium-card--yearly .compendium-card-image {
    width: 140px;
  }

  .compendium-card--weekly .compendium-card-image,
  .compendium-card--planetary .compendium-card-image,
  .compendium-card--daily .compendium-card-image {
    width: 100px;
  }
}
