/**
 * Shared Collection Page Styles
 * Used by: critter-collection, tree-collection, fish-collection, music/collection, bike-collection
 * FRONTEND_PATTERNS.md - Discovery/Collection pages
 */

/* Stats Container */
.collection-stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.collection-stat-card {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.12), rgba(34, 139, 34, 0.12));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.collection-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.collection-stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.collection-stat-label {
  color: #666;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Collection Header */
.collection-header {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.12), rgba(144, 238, 144, 0.12));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 30px;
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Map Container */
.collection-map-container {
  position: relative;
  margin-bottom: 30px;
}

.collection-map {
  height: 500px;
  width: 100%;
  border-radius: 16px;
  border: 2px solid rgba(76, 175, 80, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.collection-map-toggle-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 2px solid #228B22;
  cursor: pointer;
  font-weight: 600;
}

.collection-map-toggle-btn:hover {
  background: rgba(248, 249, 250, 0.95);
}

/* Search/Filter Bar */
.collection-search-bar {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Empty State */
.collection-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(76, 175, 80, 0.08));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 3px dashed rgba(76, 175, 80, 0.5);
}

.collection-empty-state i {
  font-size: 4rem;
  color: #228B22;
  margin-bottom: 20px;
}

/* Loading State */
.collection-loading-state {
  text-align: center;
  padding: 40px;
}

.collection-loading-spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 4px solid rgba(76, 175, 80, 0.3);
  border-top-color: #228B22;
  border-radius: 50%;
  animation: collection-spin 1s linear infinite;
}

@keyframes collection-spin {
  to { transform: rotate(360deg); }
}

/* Toast Container */
.collection-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
}

.collection-toast {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
  padding: 16px;
  border-left: 4px solid #228B22;
  animation: collection-slideIn 0.3s ease-out;
}

.collection-toast.error { border-left-color: #dc3545; }
.collection-toast.success { border-left-color: #28a745; }
.collection-toast.info { border-left-color: #17a2b8; }
.collection-toast.warning { border-left-color: #ffc107; }

@keyframes collection-slideIn {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Simple Header (domain nav) */
.collection-simple-header {
  background: linear-gradient(135deg, #228B22, #1B5E20);
  color: white;
  padding: 18px 0;
  margin-bottom: 30px;
  box-shadow: 0 4px 16px rgba(27, 94, 32, 0.4);
  border-bottom: 4px solid rgba(139, 195, 74, 0.6);
}

.collection-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.collection-brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: white !important;
  text-decoration: none;
}

.collection-nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.collection-nav-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
}

.collection-nav-links a:hover,
.collection-nav-links a.active {
  color: white;
  text-decoration: underline;
}

/* Flip Card Base (critters, trees, albums) */
.collection-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.collection-flip-card {
  background: transparent;
  border-radius: 16px;
  height: 450px;
  perspective: 1000px;
  cursor: pointer;
}

.collection-flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.collection-flip-card.flipped .collection-flip-card-inner {
  transform: rotateY(180deg);
}

.collection-flip-card-front,
.collection-flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.4);
  overflow: hidden;
}

.collection-flip-card-back {
  transform: rotateY(180deg);
  overflow-y: auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Metadata items on card back */
.collection-metadata-item {
  text-align: left;
  padding: 10px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
  margin-bottom: 8px;
  border-left: 4px solid rgba(76, 175, 80, 0.5);
}

/* Badges */
.collection-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.collection-badge-high { background: #d4edda; color: #155724; }
.collection-badge-medium { background: #fff3cd; color: #856404; }
.collection-badge-low { background: #f8d7da; color: #721c24; }

/* Responsive */
@media (max-width: 768px) {
  .collection-card-grid {
    grid-template-columns: 1fr;
  }
  .collection-map {
    height: 300px;
  }
}
