/**
 * ==========================================
 * Library Page Styles - Sample Gallery
 * ==========================================
 *
 * Explore-style gallery with 4:3 cards,
 * multi-angle hover, and core filters
 */

/* ==========================================
   Library Hero Section
   ========================================== */

.library-hero {
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
  padding: 6rem 0 4rem;
  text-align: center;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.library-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-text-primary, #ffffff);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.library-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.7));
  margin-bottom: 3rem;
  line-height: 1.6;
}

/* Search Bar */
.search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  font-size: 1rem;
  color: var(--color-text-primary, #ffffff);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 8px;
  outline: none;
  transition: all 0.3s ease;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-primary, #00D4FF);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

/* ==========================================
   Main Content Area
   ========================================== */

.library-main {
  padding: 3rem 0 5rem;
  min-height: 60vh;
}

/* ==========================================
   Filter & Sort Bar
   ========================================== */

.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.15);
  flex-wrap: wrap;
}

.filter-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

.filter-select {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-primary, #ffffff);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.filter-select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-primary, #00D4FF);
}

.filter-select:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-primary, #00D4FF);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.btn-clear {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear:hover {
  color: var(--color-text-primary, #ffffff);
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.results-count {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

.sort-select {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-primary, #ffffff);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
}

.sort-select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-primary, #00D4FF);
}

/* ==========================================
   Model Grid
   ========================================== */

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* ==========================================
   Model Card (4:3 Aspect Ratio)
   ========================================== */

.model-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.model-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.2);
  border-color: var(--color-primary, #00D4FF);
}

/* Thumbnail Container (4:3 aspect ratio) */
.model-thumbnail {
  position: relative;
  width: 100%;
  padding-bottom: 75%; /* 4:3 aspect ratio */
  overflow: hidden;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 150, 255, 0.1));
}

.model-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

/* Multi-angle hover effect */
.model-thumbnail img.angle-1 {
  opacity: 1;
  z-index: 1;
}

.model-thumbnail img.angle-2,
.model-thumbnail img.angle-3 {
  opacity: 0;
  z-index: 2;
}

.model-card:hover .model-thumbnail img.angle-1 {
  opacity: 0;
}

.model-card:hover .model-thumbnail img.angle-2 {
  opacity: 1;
  animation: angleSwitch 2s ease-in-out infinite;
}

.model-card:hover .model-thumbnail img.angle-3 {
  opacity: 0;
  animation: angleSwitch 2s ease-in-out infinite 1s;
}

@keyframes angleSwitch {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Status Badge */
.model-status {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.model-status.ready {
  background: rgba(34, 197, 94, 0.9);
  color: #ffffff;
}

.model-status.processing {
  background: rgba(251, 191, 36, 0.9);
  color: #000000;
}

/* Card Content */
.model-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.model-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary, #ffffff);
  margin-bottom: 0.375rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-project {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Metadata Icons */
.model-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.model-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.model-meta-row svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-primary, #00D4FF);
}

/* Metrics */
.model-metrics {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* CTA Button */
.model-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-bg-primary, #0a0a0a);
  background: var(--color-primary, #00D4FF);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.model-cta:hover {
  background: #00B8E6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.model-cta svg {
  width: 16px;
  height: 16px;
}

/* ==========================================
   Pagination
   ========================================== */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding-top: 2rem;
}

.pagination-btn {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary, #ffffff);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--color-primary, #00D4FF);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  min-width: 60px;
  text-align: center;
}

/* ==========================================
   Responsive Design
   ========================================== */

/* 5 columns for very wide screens */
@media (min-width: 1600px) {
  .model-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* 4 columns for desktop (default) */
@media (min-width: 1200px) and (max-width: 1599px) {
  .model-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 3 columns for tablet landscape */
@media (min-width: 900px) and (max-width: 1199px) {
  .model-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* 2 columns for tablet portrait */
@media (min-width: 600px) and (max-width: 899px) {
  .model-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .library-hero {
    padding: 4rem 0 3rem;
  }

  .library-title {
    font-size: 2.5rem;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .sort-controls {
    justify-content: space-between;
  }
}

/* 1 column for mobile */
@media (max-width: 599px) {
  .model-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .library-hero {
    padding: 3rem 0 2rem;
  }

  .library-title {
    font-size: 2rem;
  }

  .library-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .filter-controls {
    flex-direction: column;
    gap: 0.75rem;
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.375rem;
  }

  .filter-select,
  .sort-select {
    width: 100%;
  }

  .sort-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .sort-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.375rem;
  }

  .results-count {
    text-align: center;
  }
}

/* ==========================================
   Empty State
   ========================================== */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: rgba(255, 255, 255, 0.6);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
}

.empty-state p {
  font-size: 0.875rem;
}
