/* ============================================
   GALLERY PAGE STYLES
   ============================================ */

/* Header */
.gallery-header {
  padding: 120px 2rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-darkest) 0%, var(--bg-dark) 100%);
}

.gallery-header h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
}

.gallery-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Tab Navigation */
.gallery-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 2rem;
  background: var(--bg-dark);
  border-bottom: 1px solid rgba(255, 107, 53, 0.2);
  position: sticky;
  top: 60px;
  z-index: 100;
  flex-wrap: wrap;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-medium);
  border: 1px solid rgba(255, 107, 53, 0.2);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  background: var(--bg-light);
  color: var(--text-primary);
  border-color: rgba(255, 107, 53, 0.4);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.3), rgba(255, 107, 53, 0.1));
  border-color: var(--ember-orange);
  color: var(--ember-gold);
  box-shadow: 0 0 15px rgba(255, 107, 53, 0.3);
}

.tab-icon {
  font-size: 1.2rem;
}

.tab-label {
  font-weight: 500;
}

/* Tab Content */
.gallery-content {
  padding: 2rem;
  min-height: 60vh;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

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

.tab-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--ember-gold);
}

.tab-description {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state p {
  margin-bottom: 0.5rem;
}

.empty-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-grid.portraits {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.gallery-grid.items {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.gallery-grid.locations {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* Gallery Items */
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-medium);
  border: 1px solid rgba(255, 107, 53, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  aspect-ratio: 1;
}

.gallery-item.location {
  aspect-ratio: 16/9;
}

.gallery-item:hover {
  transform: translateY(-5px);
  border-color: var(--ember-orange);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 107, 53, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.gallery-item-type,
.gallery-item-level {
  font-size: 0.8rem;
  color: var(--ember-orange);
}

/* Item Rarity Borders */
.gallery-item.item {
  aspect-ratio: 1;
}

.gallery-item.rarity-common {
  border-color: var(--rarity-common);
}

.gallery-item.rarity-uncommon {
  border-color: var(--rarity-uncommon);
  box-shadow: 0 0 10px rgba(30, 255, 0, 0.2);
}

.gallery-item.rarity-rare {
  border-color: var(--rarity-rare);
  box-shadow: 0 0 10px rgba(0, 112, 221, 0.2);
}

.gallery-item.rarity-epic {
  border-color: var(--rarity-epic);
  box-shadow: 0 0 10px rgba(163, 53, 238, 0.2);
}

.gallery-item.rarity-legendary {
  border-color: var(--rarity-legendary);
  box-shadow: 0 0 15px rgba(255, 128, 0, 0.3);
}

.gallery-item-rarity {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gallery-item-rarity.common { color: var(--rarity-common); }
.gallery-item-rarity.uncommon { color: var(--rarity-uncommon); }
.gallery-item-rarity.rare { color: var(--rarity-rare); }
.gallery-item-rarity.epic { color: var(--rarity-epic); }
.gallery-item-rarity.legendary { color: var(--rarity-legendary); }

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.modal.active {
  display: flex;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 2001;
}

.modal-close:hover {
  color: var(--ember-orange);
}

.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 0 50px rgba(255, 107, 53, 0.3);
}

.modal-caption {
  margin-top: 1rem;
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--ember-gold);
}

/* Discord Link in Nav */
.discord-link {
  background: linear-gradient(135deg, #5865F2, #7289da) !important;
  color: white !important;
  border-color: #5865F2 !important;
}

.discord-link:hover {
  box-shadow: 0 0 15px rgba(88, 101, 242, 0.5) !important;
}

/* Active nav link */
.nav-links a.active {
  color: var(--ember-gold);
  border-color: var(--ember-gold);
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-header {
    padding-top: 100px;
  }

  .gallery-header h1 {
    font-size: 2rem;
  }

  .gallery-tabs {
    padding: 1rem;
    gap: 0.5rem;
    top: 50px;
  }

  .tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .tab-label {
    display: none;
  }

  .tab-icon {
    font-size: 1.4rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .gallery-grid.locations {
    grid-template-columns: 1fr;
  }

  .gallery-content {
    padding: 1rem;
  }

  .tab-title {
    font-size: 1.5rem;
  }
}
