/* TY47 Yearbook Gallery Styles */

.ty47-yearbook-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  font-family: system-ui, -apple-system, sans-serif;
}

/* Header */
.ty47-yearbook-header {
  text-align: center;
  margin-bottom: 2rem;
}

.header-content h1 {
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
  color: #1e293b;
}

.subtitle {
  font-size: 1.1rem;
  color: #64748b;
}

#ty47-total-count {
  font-weight: 700;
  color: #2563eb;
}

/* Controls */
.ty47-yearbook-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.search-box {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

#ty47-search {
  width: 100%;
  max-width: 400px;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
}

#ty47-search:focus {
  outline: none;
  border-color: #2563eb;
}

.filter-buttons, .view-toggle {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.ty47-filter-btn, .ty47-view-btn, .ty47-btn {
  padding: 0.6rem 1.2rem;
  border: 2px solid #e2e8f0;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.ty47-filter-btn:hover, .ty47-view-btn:hover, .ty47-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.ty47-filter-btn.active, .ty47-view-btn.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* Stats Bar */
.ty47-stats-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e293b;
}

.stat-patriot { color: #6b7280; }
.stat-official { color: #22c55e; }
.stat-premium { color: #f59e0b; }

/* Loading */
.ty47-loading {
  text-align: center;
  padding: 4rem 2rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

/* Gallery */
.ty47-gallery {
  margin-top: 2rem;
}

.gallery-section {
  margin-bottom: 3rem;
}

.section-header {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: white;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.section-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.8rem;
}

.section-header p {
  margin: 0;
  opacity: 0.9;
}

/* Signature Grid (Yearbook Style) */
.signature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
}

.signature-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.signature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  border-color: #2563eb;
}

.sig-image-container {
  width: 100%;
  height: 150px;
  background: #f8fafc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  overflow: hidden;
}

.sig-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.sig-text {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  font-family: 'Brush Script MT', cursive;
}

.sig-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.sig-meta {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tier-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.tier-patriot {
  background: #6b7280;
  color: white;
}

.tier-official {
  background: #22c55e;
  color: white;
}

.tier-premium {
  background: #f59e0b;
  color: white;
}

.side-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #e2e8f0;
  border-radius: 20px;
  font-size: 0.75rem;
  color: #64748b;
}

/* List View */
.ty47-list {
  margin-top: 2rem;
  overflow-x: auto;
}

.signatures-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-radius: 12px;
  overflow: hidden;
}

.signatures-table th {
  background: #1e3a8a;
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
}

.signatures-table td {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.signatures-table tr:hover {
  background: #f8fafc;
}

.list-sig-preview {
  max-width: 80px;
  max-height: 40px;
}

/* No Results */
.ty47-no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: #64748b;
}

.ty47-no-results p {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .ty47-yearbook-wrap {
    padding: 1rem;
  }
  
  .header-content h1 {
    font-size: 1.8rem;
  }
  
  .ty47-stats-bar {
    gap: 1rem;
  }
  
  .signature-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
  
  .ty47-yearbook-controls {
    padding: 0 1rem;
  }
  
  .search-box {
    flex-direction: column;
  }
  
  #ty47-search {
    max-width: 100%;
  }

  /* Card Layout Mobile */
  .card-layout-container {
    flex-direction: column;
  }

  .card-side {
    width: 100%;
  }

  .thank-you-message {
    height: 150px;
  }

  .message-box h1 {
    font-size: 1.5rem;
  }

  .message-box h2 {
    font-size: 1.2rem;
  }

  .card-compact-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* Card Layout View */
.ty47-card-layout {
  margin-top: 2rem;
}

.card-layout-container {
  display: flex;
  gap: 2rem;
  min-height: 600px;
}

.card-side {
  flex: 1;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 80vh;
}

.card-left {
  border-left: 4px solid #6b7280;
}

.card-right {
  border-left: 4px solid #f59e0b;
}

.card-side-header {
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.card-side-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.4rem;
  color: #1e293b;
}

.card-side-header p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
}

/* Thank You Message */
.thank-you-message {
  margin-bottom: 2rem;
  padding: 1rem;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  border-radius: 12px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.message-box {
  text-align: center;
  color: white;
}

.message-box h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  opacity: 0.95;
}

.message-box h1 {
  margin: 0.5rem 0 0 0;
  font-size: 2.5rem;
  font-weight: 700;
}

/* Compact Grid for Card Layout */
.card-compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.card-compact-grid .signature-card {
  padding: 0.75rem;
}

.card-compact-grid .sig-image-container {
  height: 100px;
  margin-bottom: 0.5rem;
}

.card-compact-grid .sig-name {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.card-compact-grid .sig-meta {
  gap: 0.25rem;
}

.card-compact-grid .tier-badge {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
}