/* Global Styles */
body {
  font-family: "Inter", sans-serif;
  background-color: #f4f7f9;
  color: #333;
}

/* Enhanced template section styles */
.template-section-enhanced {
  background-color: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid #f0f0f0;
  position: relative;
  height: 100%;
}

.template-section-enhanced:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  border-color: #0808EE;
}

.template-section-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0808EE, #4299e1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.template-section-enhanced:hover::before {
  opacity: 1;
}

.template-card-enhanced {
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.template-header {
  padding: 25px 25px 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.template-icon {
  font-size: 28px;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
}

.template-title-content {
  flex-grow: 1;
}

.template-title-enhanced {
  font-size: 18px;
  font-weight: 700;
  color: #0808EE;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.template-badge {
  background: #0808EE;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}

.template-description {
  padding: 0 25px 20px;
}

.template-description p {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.template-content-enhanced {
  padding: 0 25px;
  flex-grow: 1;
}

.template-link-enhanced {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin: 3px 0;
  color: #4a5568;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  background: #f8f9fa;
  font-size: 14px;
}

.template-link-enhanced:hover {
  color: #0808EE;
  background: rgba(8, 8, 238, 0.05);
  transform: translateX(5px);
}

.template-name-enhanced {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-arrow-enhanced {
  color: #0808EE;
  transition: transform 0.2s ease;
  font-size: 14px;
}

.template-link-enhanced:hover .template-arrow-enhanced {
  transform: translateX(3px);
}

.view-all-templates {
  text-align: center;
  padding: 10px 0;
  margin-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.view-all-templates a {
  color: #0808EE;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.view-all-templates a:hover {
  color: #1a365d;
}

.coming-soon {
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 20px 0;
  font-size: 14px;
}

.template-footer {
  padding: 20px 25px 25px;
  border-top: 1px solid #f0f0f0;
  background: #fff;
  margin-top: auto;
}

.browse-templates-btn {
  display: block;
  width: 100%;
  padding: 10px 20px;
  background: #0808EE;
  color: white;
  text-decoration: none;
  text-align: center;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.browse-templates-btn:hover {
  background: #0606cc;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(8, 8, 238, 0.3);
}

/* Container Styles */
.templates-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Header Styles */
.templates-main-title {
  font-size: 48px;
  font-weight: 800;
  color: #1a365d;
  margin-bottom: 20px;
  letter-spacing: -1px;
  text-align: center; /* Center the main title */
}

.templates-description {
  font-size: 18px;
  color: #4a5568;
  max-width: 800px;
  margin: 0 auto 60px; /* Add bottom margin for spacing */
  line-height: 1.6;
  text-align: center; /* Center the description text */
}

/* Grid Layout */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  padding: 0 20px;
}

/* Legacy Template Section Styles - keeping for backward compatibility */
.template-section {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.template-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.template-card {
  padding: 30px;
}

.template-title {
  font-size: 24px;
  font-weight: 700;
  color: #0808EE;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.template-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: #4299e1;
}

.template-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  color: #4a5568;
  text-decoration: none;
  transition: color 0.2s ease;
}

.template-link:hover {
  color: #2b6cb0;
}

.template-name {
  font-size: 16px;
  font-weight: 500;
}

.template-arrow {
  font-size: 20px;
  transition: transform 0.2s ease;
}

.template-link:hover .template-arrow {
  transform: translateX(5px);
}

/* Loading animations for better UX */
.template-section-enhanced {
  animation: templateFadeIn 0.6s ease-out forwards;
}

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

/* Improved accessibility */
.template-link-enhanced:focus {
  outline: 2px solid #0808EE;
  outline-offset: 2px;
}

.browse-templates-btn:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Performance optimizations */
.template-section-enhanced {
  will-change: transform;
  backface-visibility: hidden;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .templates-main-title {
    font-size: 36px;
  }

  .templates-description {
    font-size: 16px;
  }

  .templates-grid {
    grid-template-columns: 1fr;
    padding: 0 10px;
  }

  .template-header {
    padding: 20px 20px 15px;
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .template-icon {
    align-self: center;
  }

  .template-description {
    padding: 0 20px 15px;
  }

  .template-content-enhanced {
    padding: 0 20px;
  }

  .template-footer {
    padding: 15px 20px 20px;
  }

  .templates-container {
    padding: 20px 10px;
  }

  .hero-trust-badges {
    margin-bottom: 20px !important;
  }

  .hero-trust-badges > div {
    flex-direction: column;
    gap: 15px !important;
  }
}

/* Animation Styles */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.template-section {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Add this to your CSS file */
.new-tag-animated {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #0020ff;
  color: white;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  animation: pulse 2s infinite;
  z-index: 1;
}
