/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #374151;
  background-color: #f9fafb;
}

/* Utility Classes */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.bg-gray-50 {
  background-color: #f9fafb;
}

/* Text Utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Animation Classes */
.animate-fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

.animate-bounce-slow {
  animation: bounce 2s infinite;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%,
  20%,
  53%,
  80%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  40%,
  43% {
    transform: translate3d(0, -30px, 0);
  }
  70% {
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

/* Header Styles */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header .container {
  padding: 1.5rem 1rem;
}

.logo-link {
  display: block;
  text-align: center;
  text-decoration: none;
}

.logo {
  font-size: 1.875rem;
  font-weight: 700;
  background: linear-gradient(to right, #9333ea, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Main Content */
.main-content {
  animation: fadeIn 0.6s ease-in-out;
}

/* Loading Spinner */
.loading-spinner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

.spinner {
  width: 3rem;
  height: 3rem;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #9333ea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #9333ea;
  color: white;
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: 50;
  animation: bounce 2s infinite;
}

.back-to-top:hover {
  background: #7c3aed;
  transform: scale(1.1);
}

.back-to-top svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 0.75rem;
  }

  .logo {
    font-size: 1.5rem;
  }

  .header .container {
    padding: 1rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.25rem;
  }
}

/* Hero Section */
.hero-section {
  padding: 2rem 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #111827;
}

/* Latest Post Card */
.latest-post-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.5s ease;
  cursor: pointer;
  group: hover;
}

.latest-post-card:hover {
  box-shadow: 0 25px 25px -5px rgba(0, 0, 0, 0.1);
  transform: translateY(-0.5rem);
}

.latest-post-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.latest-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.latest-post-card:hover .latest-post-image img {
  transform: scale(1.1);
}

.latest-post-content {
  padding: 1.5rem;
}

.latest-post-badge {
  text-align: center;
  margin-bottom: 1rem;
}

.badge {
  background: #f3e8ff;
  color: #7c3aed;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.latest-post-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #111827;
}

.latest-post-excerpt {
  color: #6b7280;
  margin-bottom: 1rem;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.meta-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.meta-item svg {
  width: 1rem;
  height: 1rem;
}

.read-more-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #9333ea;
  color: white;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.read-more-button:hover {
  background: #7c3aed;
}

/* Featured Posts */
.featured-posts-list {
  display: flex;
  flex-direction: column;
  gap: 2.3rem;
}

.featured-post-card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.featured-post-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-0.25rem);
}

.featured-post-content {
  display: flex;
}

.featured-post-image {
  width: 6rem;
  height: 6rem;
  flex-shrink: 0;
  overflow: hidden;
}

.featured-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-post-card:hover .featured-post-image img {
  transform: scale(1.1);
}

.featured-post-info {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.featured-post-title {
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  color: #111827;
}

.featured-post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.featured-post-link {
  color: #9333ea;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.5rem;
  text-decoration: none;
}

.featured-post-link:hover {
  color: #7c3aed;
}

/* Newsletter Section */
.newsletter-section {
  padding: 4rem 0;
  background: linear-gradient(135deg, #111827 0%, #7c3aed 50%, #111827 100%);
}

.newsletter-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 25px -5px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.6s ease-in-out;
}

@media (min-width: 768px) {
  .newsletter-card {
    padding: 3rem;
  }
}

.newsletter-content {
  margin-bottom: 1.5rem;
}

.newsletter-icon {
  margin-bottom: 1rem;
}

.mail-icon {
  width: 4rem;
  height: 4rem;
  color: white;
  margin: 0 auto;
  animation: bounce 2s infinite;
}

.newsletter-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .newsletter-title {
    font-size: 2.25rem;
  }
}

.newsletter-description {
  color: #d1d5db;
  font-size: 1.125rem;
  max-width: 46rem;
  margin: 0 auto;
  line-height: 1.75;
}

.newsletter-form {
  max-width: 28rem;
  margin: 0 auto;
}

.newsletter-form-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .newsletter-form-group {
    flex-direction: row;
  }
}

.newsletter-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  color: #111827;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: none;
  outline: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.newsletter-input:focus {
  box-shadow: 0 0 0 4px rgba(147, 51, 234, 0.5);
}

.newsletter-input::placeholder {
  color: #6b7280;
}

.newsletter-button {
  background: #9333ea;
  color: white;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.newsletter-button:hover {
  background: #7c3aed;
  transform: scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.newsletter-button:disabled {
  background: #a855f7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.newsletter-disclaimer {
  color: #d1d5db;
  font-size: 0.875rem;
  margin-top: 1rem;
}

.newsletter-success {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #dcfce7;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  animation: fadeIn 0.6s ease-in-out;
}

.success-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Blog Section */
.blog-section {
  padding: 3rem 0;
}

/* Filters Card */
.filters-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 2rem;
  animation: fadeIn 0.6s ease-in-out;
}

.filters-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .filters-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.filters-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.filter-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #6b7280;
}

.filters-label {
  font-weight: 600;
  color: #111827;
}

.category-select {
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  background: white;
  min-width: 10rem;
  outline: none;
  transition: all 0.3s ease;
}

.category-select:focus {
  border-color: #9333ea;
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.5);
}

.search-group {
  position: relative;
  flex: 1;
  max-width: 28rem;
}

.search-input-container {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: #9ca3af;
}

.search-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  outline: none;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: #9333ea;
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.5);
}

.search-button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: #9333ea;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.search-button:hover {
  background: #7c3aed;
}

/* Results Info */
.results-info {
  margin-bottom: 1.5rem;
  color: #6b7280;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.blog-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.5s ease;
  cursor: pointer;
  animation: fadeIn 0.6s ease-in-out;
}

.blog-card:hover {
  box-shadow: 0 25px 25px -5px rgba(0, 0, 0, 0.1);
  transform: translateY(-0.5rem);
}

.blog-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.blog-card:hover .blog-card-image img {
  transform: scale(1.1);
}

.blog-card-content {
  padding: 1.5rem;
}

.blog-card-badge {
  text-align: center;
  margin-bottom: 1rem;
}

.blog-card-badge .badge {
  text-transform: capitalize;
}

.blog-card-title {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  color: #111827;
  transition: color 0.3s ease;
}

.blog-card:hover .blog-card-title {
  color: #9333ea;
}

.blog-card-excerpt {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.blog-card-meta-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.blog-card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.blog-card-meta-item svg {
  width: 0.75rem;
  height: 0.75rem;
}

.blog-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #9333ea;
  color: white;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.blog-card-button:hover {
  background: #7c3aed;
  transform: scale(1.05);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 3rem 0;
  animation: fadeIn 0.6s ease-in-out;
}

.no-results-icon {
  color: #9ca3af;
  margin-bottom: 1rem;
}

.no-results-icon svg {
  width: 4rem;
  height: 4rem;
  margin: 0 auto;
}

.no-results-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.no-results-text {
  color: #6b7280;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  animation: fadeIn 0.6s ease-in-out;
}

.pagination-button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-button.active {
  background: #9333ea;
  color: white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: scale(1.1);
}

.pagination-button:not(.active) {
  background: white;
  color: #9333ea;
  border: 1px solid #e5e7eb;
}

.pagination-button:not(.active):hover:not(:disabled) {
  background: #f3f4f6;
  transform: scale(1.05);
}
