/* ===== HOMEPAGE STYLES ===== */

.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 2rem;
  border-radius: 12px;
  text-align: center;
}

.hero-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.1rem;
  opacity: 0.95;
}

.serie-section {
  animation: fadeIn 0.6s ease-in;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.serie-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 8px;
  border-left: 5px solid #667eea;
}

.serie-info {
  flex: 1;
}

.serie-title {
  font-weight: 700;
  color: #2d3748;
  font-size: 1.8rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.serie-date {
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.serie-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 2rem;
}

.serie-icon {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
}

.sets-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2rem;
  padding: 0;
}

.set-wrapper {
  display: flex;
  flex-direction: column;
}

.set-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  height: 100%;
}

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

.set-image-container {
  position: relative;
  width: 100%;
  height: 150px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.set-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e2e8f0;
  color: #a0aec0;
  font-size: 2rem;
}

.set-info {
  padding: 0.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.set-name {
  font-weight: 700;
  color: #2d3748;
  font-size: 0.9rem;
}

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

.set-meta .badge {
  font-size: 0.8rem;
}

.set-progress {
  margin: 1rem 0;
  padding: 0.75rem;
  background-color: #f7fafc;
  border-radius: 6px;
}

.completion-text {
  display: block;
  margin-top: 0.5rem;
  color: #2d3748;
  font-weight: 600;
}

.set-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.btn-view {
  color: #667eea;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.set-card:hover .btn-view {
  gap: 0.75rem;
}

.set-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(102, 126, 234, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.set-card:hover .set-overlay {
  opacity: 1;
}

.overlay-content {
  color: white;
  text-align: center;
}

.overlay-content i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.overlay-content p {
  margin: 0;
  font-weight: 600;
}

/* ===== USER SETS (CUSTOM COLLECTIONS) ===== */
.user-sets-section {
  border-top: 2px solid #e2e8f0;
  padding-top: 2rem;
}

.user-sets-header h4 {
  color: #2d3748;
  font-weight: 700;
  font-size: 1.3rem;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-sets-header p {
  margin: 0;
  color: #718096;
  font-size: 0.95rem;
}

.user-sets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.user-set-card {
  background: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #667eea;
  padding: 1.25rem;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-set-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-left-color: #764ba2;
  transform: translateY(-3px);
  color: inherit;
  text-decoration: none;
}

.user-set-header-info {
  flex: 1;
}

.user-set-title {
  margin: 0;
  font-weight: 700;
  color: #2d3748;
  font-size: 1.05rem;
  word-break: break-word;
}

.user-set-description {
  margin: 0.5rem 0 0 0;
  font-size: 0.85rem;
  color: #718096;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.user-set-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #4a5568;
  font-weight: 500;
}

.meta-item i {
  color: #667eea;
  font-size: 0.95rem;
}

.meta-item.admin-favorite {
  background: #fef3c7;
  color: #b45309;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.meta-item.admin-favorite i {
  color: #f59e0b;
}

.user-set-date {
  color: #a0aec0;
  font-size: 0.8rem;
}

/* ===== CHILD USERSETS (Under CardSet) ===== */
.set-child-usersets {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  background: white;
  border-radius: 0 0 10px 10px;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
  flex-direction: column;
}

.set-wrapper:hover .set-child-usersets {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.set-child-card {
  flex: 0 1 calc(50% - 0.375rem);
  background: linear-gradient(135deg, #f0f4ff 0%, #fff4f0 100%);
  border: 2px solid #e2e8f0;
  border-left: 4px solid #667eea;
  border-radius: 6px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.0rem;
  min-height: 100px;
}

.set-child-card:hover {
  border-left-color: #764ba2;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
  color: inherit;
  text-decoration: none;
}

.child-card-header {
  flex: 1;
}

.child-card-title {
  margin: 0;
  font-weight: 600;
  color: #2d3748;
  font-size: 0.95rem;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.child-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #4a5568;
  background: white;
  padding: 0.1rem 0.1rem;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}

.meta-badge i {
  color: #667eea;
  font-size: 0.9rem;
}

.meta-badge.admin-fav {
  background: #fef3c7;
  color: #b45309;
}

.meta-badge.admin-fav i {
  color: #f59e0b;
}

.set-date {
  font-size: 0.675em;
}

.set-details-btn {
  font-size: 0.8rem;
}

/* ===== LANGUAGE FILTER BUTTON GROUP ===== */
.language-filter-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.language-filter-group .btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.language-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border: 2px solid currentColor;
  white-space: nowrap;
}

.language-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary.language-btn {
  background-color: white;
  color: #667eea;
  border-color: white;
}

.btn-primary.language-btn:hover {
  background-color: white;
  color: #5568d3;
  text-decoration: none;
}

.btn-outline-primary.language-btn {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.9);
  background-color: transparent;
}

.btn-outline-primary.language-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: white;
  text-decoration: none;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet (768px - 1024px): 4 columns */
@media (max-width: 1024px) {
  .sets-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

/* Tablet to Mobile transition (up to 768px): 2 columns */
@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 1rem;
  }

  .hero-content h1 {
    font-size: 1.8rem;
  }

  .serie-header {
    flex-direction: column;
    text-align: center;
  }

  .serie-badge {
    margin-left: 0;
    margin-top: 1rem;
  }

  .sets-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0;
    margin: 0;
  }

  .set-meta .badge {
    font-size: 0.75rem;
  }

  .set-footer {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .serie-section {
    padding: 0;
    margin: 0 0 1.5rem 0;
  }

  .serie-header {
    padding: 1rem;
    margin-bottom: 1rem;
  }
}

/* ===== Lazy Loading Styles for Home Index ===== */
.serie-icon[loading="lazy"] {
  transition: opacity 0.4s ease-in-out;
}

.serie-icon[loading="lazy"]:not(.lazy-loaded) {
  opacity: 0.6;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.serie-icon.lazy-loaded {
  opacity: 1;
}

.set-image[loading="lazy"] {
  transition: opacity 0.4s ease-in-out;
}

.set-image[loading="lazy"]:not(.lazy-loaded) {
  opacity: 0.6;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.set-image.lazy-loaded {
  opacity: 1;
  animation: fadeIn 0.4s ease-in;
}

/* Shimmer animation */
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
