/* Import base styles */
@import url("styles.css");

/* Brands Section */
.brands-section {
  padding: 4rem 0;
  background: #f8f9fa;
  min-height: 100vh;
}

/* Filter Section */
.filter-section {
  margin-bottom: 3rem;
  text-align: center;
}

.filter-title {
  font-family: "Roboto", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
}

.filter-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.chip {
  background: white;
  border: 2px solid #e9ecef;
  color: #6c757d;
  padding: 0.5rem 1.25rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.chip:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chip.active {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Brands Grid */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Brand Card */
.brand-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid #f1f3f4;
}

.brand-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.brand-image-container {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.brand-image-container.light-bg {
  background: #f8f9fa;
}

.brand-image-container.dark-bg {
  background: #2c2c2c;
}

.brand-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.brand-card:hover .brand-image {
  transform: scale(1.05);
}

.brand-name-fallback {
  color: #666;
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
}

.brand-info {
  padding: 1.5rem;
}

.brand-name {
  font-family: "Roboto", sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
  text-transform: capitalize;
}

.brand-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.brand-typology {
  font-size: 0.85rem;
  color: #1a1a1a;
  background: #e8f4f8;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-weight: 500;
}

.brand-distribution {
  font-size: 0.85rem;
  color: #6c757d;
  background: #f1f3f4;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-weight: 500;
}

.brand-description {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.brand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.social-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Nasconde le icone social dalle cards */
.social-buttons.hidden {
  display: none;
}

.social-btn {
  padding: 0.4rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 1rem;
}

.social-btn:hover {
  transform: translateY(-1px);
}

.brand-btn {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  min-width: 100px;
}

/* Brand Website Link */
.brand-website-link {
  display: inline-block;
  color: #1e3a8a; /* Blu navy moderno (blue-800) */
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 4px 0;
  transition: all 0.25s ease;
  margin-bottom: 10px;
  position: relative;
}

.brand-website-link:hover {
  color: #1e40af; /* Blu navy più chiaro al hover (blue-700) */
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.brand-website-link:active {
  color: #1d4ed8; /* Blu navy ancora più chiaro al click (blue-600) */
}

/* Loading Animation */
.loading {
  text-align: center;
  padding: 4rem 0;
  color: #6c757d;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  grid-column: 1 / -1; /* Occupa tutte le colonne del grid */
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1a1a1a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Filter Animation */
.brand-card.hidden {
  display: none; /* Rimuove completamente l'elemento per evitare spazi vuoti */
}

.brand-card.visible {
  opacity: 1;
  transform: scale(1);
  animation: fadeInUp 0.6s ease forwards;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .brands-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .filter-chips {
    justify-content: center;
    gap: 0.5rem;
  }

  .chip {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }

  .brand-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .brands-section {
    padding: 2rem 0;
  }

  .brands-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .filter-chips {
    gap: 0.4rem;
  }

  .chip {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
  }
}

/* Smooth scroll when filtering */
html {
  scroll-behavior: smooth;
}

/* Add entrance animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}
