/**
 * ===== CSS GALERIA MELHORADA - KUROGAMI PORTFOLIO =====
 * 
 * Galeria com thumbnails organizadas e lightbox funcional
 * Design limpo e profissional
 * 
 * @author Kurogami Portfolio
 * @version 3.0
 */

/* ===== 1. HEADER DA GALERIA ===== */
.gallery-header {
  padding: 3rem 0 2rem;
  text-align: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  position: relative;
  overflow: hidden;
}

.gallery-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 25% 25%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
}

.gallery-header-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.gallery-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #ef4444 0%, #8b5cf6 100%);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.gallery-icon i {
  font-size: 1.5rem;
  color: white;
}

.gallery-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ef4444 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.gallery-subtitle {
  font-size: 1.125rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.gallery-description {
  font-size: 0.875rem;
  color: #64748b;
  max-width: 500px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.gallery-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.gallery-stat {
  text-align: center;
}

.gallery-stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ef4444;
  margin-bottom: 0.25rem;
}

.gallery-stat-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== 2. FILTROS E BUSCA ===== */
.gallery-filters {
  padding: 1.5rem 0;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}

.gallery-filters-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.gallery-search {
  margin-bottom: 1.5rem;
}

.gallery-search-form {
  position: relative;
  max-width: 350px;
  margin: 0 auto;
}

.gallery-search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: #334155;
  border: 2px solid #475569;
  border-radius: 10px;
  color: white;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.gallery-search-input:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.gallery-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1rem;
}

.gallery-categories {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.gallery-category-btn {
  padding: 0.5rem 1rem;
  background: #334155;
  color: #94a3b8;
  border: 2px solid #475569;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.gallery-category-btn:hover,
.gallery-category-btn.active {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ===== 3. GRID DE ARTWORKS (THUMBNAILS) ===== */
.gallery-content {
  padding: 2rem 0;
  background: #0f172a;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.artwork-card {
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid #334155;
  cursor: pointer;
}

.artwork-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  border-color: #ef4444;
}

.artwork-image {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #334155;
}

.artwork-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.artwork-card:hover .artwork-image img {
  transform: scale(1.05);
}

.artwork-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

.artwork-category {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(10px);
}

.artwork-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.8) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.artwork-card:hover .artwork-overlay {
  opacity: 1;
}

.artwork-view-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

.artwork-view-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(239, 68, 68, 0.4);
}

.artwork-info {
  padding: 1rem;
}

.artwork-title {
  font-size: 1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.artwork-description {
  color: #94a3b8;
  font-size: 0.75rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.artwork-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #334155;
}

.artwork-date {
  color: #64748b;
  font-size: 0.625rem;
  font-weight: 500;
}

.artwork-stats {
  display: flex;
  gap: 0.75rem;
}

.artwork-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #94a3b8;
  font-size: 0.625rem;
}

.artwork-stat-icon {
  width: 12px;
  height: 12px;
}

.artwork-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.artwork-tag {
  background: #334155;
  color: #94a3b8;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.artwork-tag:hover {
  background: #ef4444;
  color: white;
}

/* ===== 4. LIGHTBOX ===== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  border: 1px solid #334155;
}

.lightbox-image {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.lightbox-info {
  padding: 1.5rem;
  background: #1e293b;
}

.lightbox-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
}

.lightbox-description {
  color: #94a3b8;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.lightbox-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.lightbox-stats {
  display: flex;
  gap: 1rem;
}

.lightbox-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #94a3b8;
  font-size: 0.75rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(15, 23, 42, 0.8);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.lightbox-close:hover {
  background: #ef4444;
  transform: scale(1.1);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(15, 23, 42, 0.8);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
  background: #ef4444;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

/* ===== 5. RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .gallery-title {
    font-size: 2rem;
  }
  
  .gallery-stats {
    gap: 1rem;
  }
  
  .gallery-stat-number {
    font-size: 1.25rem;
  }
  
  .gallery-categories {
    gap: 0.5rem;
  }
  
  .gallery-category-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.625rem;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 0 1rem;
  }
  
  .artwork-info {
    padding: 0.75rem;
  }
  
  .lightbox-content {
    max-width: 95vw;
    max-height: 95vh;
  }
  
  .lightbox-info {
    padding: 1rem;
  }
  
  .lightbox-title {
    font-size: 1.25rem;
  }
  
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .gallery-header {
    padding: 2rem 0 1.5rem;
  }
  
  .gallery-title {
    font-size: 1.75rem;
  }
  
  .gallery-stats {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .gallery-categories {
    flex-direction: column;
    align-items: center;
  }
  
  .gallery-category-btn {
    width: 100%;
    max-width: 200px;
    justify-content: center;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .lightbox-nav {
    display: none;
  }
}

/* ===== 6. ANIMAÇÕES ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.artwork-card {
  animation: fadeInUp 0.5s ease forwards;
}

.artwork-card:nth-child(1) { animation-delay: 0.05s; }
.artwork-card:nth-child(2) { animation-delay: 0.1s; }
.artwork-card:nth-child(3) { animation-delay: 0.15s; }
.artwork-card:nth-child(4) { animation-delay: 0.2s; }
.artwork-card:nth-child(5) { animation-delay: 0.25s; }
.artwork-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes lightboxFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox.active .lightbox-content {
  animation: lightboxFadeIn 0.3s ease forwards;
}

/* ===== 7. LOADING E EMPTY STATES ===== */
.gallery-loading {
  text-align: center;
  padding: 2rem 0;
  color: #94a3b8;
}

.gallery-loading-spinner {
  width: 30px;
  height: 30px;
  border: 2px solid #334155;
  border-top: 2px solid #ef4444;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.gallery-empty {
  text-align: center;
  padding: 3rem 0;
  color: #94a3b8;
}

.gallery-empty-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  background: #334155;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.gallery-empty-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
}

.gallery-empty-description {
  font-size: 0.875rem;
  max-width: 350px;
  margin: 0 auto;
  line-height: 1.6;
}

