/* WNF 2.0 - Template Library Styles */

.template-library {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
}

.template-library-header {
  text-align: center;
  margin-bottom: 50px;
}

.template-library-header h2 {
  font-size: 42px;
  font-weight: 700;
  color: #00d4ff;
  margin-bottom: 15px;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.template-library-header p {
  font-size: 18px;
  color: #aaa;
  margin-bottom: 35px;
  line-height: 1.6;
}

.template-filters {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.filter-btn {
  padding: 12px 28px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 25px;
  color: #00d4ff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.filter-btn:hover::before {
  width: 300px;
  height: 300px;
}

.filter-btn:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: rgba(0, 212, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.filter-btn.active {
  background: #00d4ff;
  color: #0a0a0a;
  border-color: #00d4ff;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.5);
}

.filter-btn.active::before {
  display: none;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.template-card {
  background: rgba(26, 26, 46, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 16px;
  padding: 28px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.template-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #00d4ff, #7b2cbf, #ff006e);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.template-card:hover {
  border-color: #00d4ff;
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 40px rgba(0, 212, 255, 0.4);
}

.template-card:hover::before {
  opacity: 1;
}

.template-card.highlighted {
  border-color: #7b2cbf;
  box-shadow: 0 15px 40px rgba(123, 44, 191, 0.4);
}

.template-card.highlighted::before {
  background: linear-gradient(90deg, #7b2cbf, #ff006e);
  opacity: 1;
}

.template-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.template-icon {
  font-size: 56px;
  line-height: 1;
  transition: transform 0.3s ease;
}

.template-card:hover .template-icon {
  transform: scale(1.1) rotate(5deg);
}

.template-category {
  padding: 5px 14px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: all 0.3s ease;
}

.template-category.demo {
  background: rgba(123, 44, 191, 0.25);
  color: #c77dff;
  border: 1px solid rgba(123, 44, 191, 0.5);
}

.template-category.live {
  background: rgba(0, 212, 255, 0.25);
  color: #00d4ff;
  border: 1px solid rgba(0, 212, 255, 0.5);
}

.template-card:hover .template-category.demo {
  background: rgba(123, 44, 191, 0.4);
  box-shadow: 0 0 15px rgba(123, 44, 191, 0.5);
}

.template-card:hover .template-category.live {
  background: rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.template-card-body {
  flex: 1;
  margin-bottom: 24px;
}

.template-name {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.3;
}

.template-description {
  font-size: 14px;
  color: #bbb;
  line-height: 1.7;
  margin-bottom: 18px;
}

.template-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.meta-item {
  font-size: 12px;
  color: #888;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.template-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.feature-tag {
  padding: 5px 12px;
  background: rgba(0, 212, 255, 0.12);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  color: #00d4ff;
  transition: all 0.3s ease;
}

.template-card:hover .feature-tag {
  background: rgba(0, 212, 255, 0.2);
  border-color: rgba(0, 212, 255, 0.4);
}

.template-card-footer {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.select-template-btn {
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  transition: all 0.3s ease;
}

.select-template-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5);
}

.no-templates {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #888;
  font-size: 18px;
}

/* Responsive design */
@media (max-width: 1200px) {
  .template-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

@media (max-width: 768px) {
  .template-library {
    padding: 30px 15px;
  }

  .template-library-header h2 {
    font-size: 32px;
  }

  .template-library-header p {
    font-size: 16px;
  }

  .template-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .template-card {
    padding: 22px;
  }

  .template-icon {
    font-size: 48px;
  }

  .template-name {
    font-size: 22px;
  }

  .filter-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}

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

.template-card {
  animation: fadeInUp 0.5s ease forwards;
}

.template-card:nth-child(1) { animation-delay: 0.05s; }
.template-card:nth-child(2) { animation-delay: 0.1s; }
.template-card:nth-child(3) { animation-delay: 0.15s; }
.template-card:nth-child(4) { animation-delay: 0.2s; }
.template-card:nth-child(5) { animation-delay: 0.25s; }
.template-card:nth-child(6) { animation-delay: 0.3s; }
.template-card:nth-child(7) { animation-delay: 0.35s; }
.template-card:nth-child(8) { animation-delay: 0.4s; }
