* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f8f9fa;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  padding: 3rem 0;
  background: linear-gradient(135deg, #04aa60 0%, #038a4d 100%);
  color: white;
  margin-bottom: 3rem;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

.search-filter-section {
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 300px;
}

.search-box input {
  width: 100%;
  padding: 12px 20px;
  border: 2px solid #ddd;
  border-radius: 30px;
  font-size: 1rem;
  transition: all 0.3s;
}

.search-box input:focus {
  outline: none;
  border-color: #04aa60;
  box-shadow: 0 0 0 3px rgba(4, 170, 96, 0.1);
}

.filter-box select {
  padding: 12px 20px;
  border: 2px solid #ddd;
  border-radius: 30px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
}

#loading {
  text-align: center;
  padding: 3rem;
}

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

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

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.template-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

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

.template-preview {
  position: relative;
  padding-top: 60%;
  background: #f0f0f0;
  overflow: hidden;
}

.template-preview img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.template-card:hover .template-preview img {
  transform: scale(1.05);
}

.template-info {
  padding: 1.5rem;
}

.template-info h3 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  color: #282a35;
}

.template-info p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: #e8f5f0;
  color: #04aa60;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

.template-meta {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.template-actions {
  display: flex;
  gap: 0.8rem;
}

.btn {
  flex: 1;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-demo {
  background: #04aa60;
  color: white;
}

.btn-demo:hover {
  background: #038a4d;
  transform: translateY(-2px);
}

.btn-source {
  background: #282a35;
  color: white;
}

.btn-source:hover {
  background: #1a1c24;
  transform: translateY(-2px);
}
.home-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.1);
  z-index: 10;
}

.home-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
}

.home-btn i {
  transition: transform 0.3s;
}

.home-btn:hover i {
  transform: translateX(-3px);
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

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

  .search-filter-section {
    flex-direction: column;
  }

  .search-box {
    min-width: 100%;
  }

  .home-btn {
    top: 10px;
    left: 10px;
    font-size: 14px;
    padding: 6px 12px;
  }
}
