/* Blog Page Styles */

/* Variables */
:root {
  --primary-color: #0055b8; /* สีฟ้าเข้มจากโลโก้ */
  --secondary-color: #004494; /* สีฟ้าเข้มเข้มขึ้นเล็กน้อย */
  --accent-color: #60b5ff; /* สีฟ้าอ่อนจากโลโก้ */
  --accent-light: #a8d5ff; /* สีฟ้าอ่อนที่อ่อนลงอีก */
  --dark-color: #003166; /* สีฟ้าเข้มมาก */
  --light-color: #f8f9fa;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --danger-color: #f44336;
  --gray-color: #6c757d;
  --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  --gradient-secondary: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

/* Hero Section */
.blog-hero-section {
  background: linear-gradient(135deg, rgba(0, 85, 184, 0.05) 0%, rgba(96, 181, 255, 0.05) 100%);
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

.hero-image-container {
  position: relative;
  z-index: 2;
}

.hero-image {
  position: relative;
  z-index: 2;
  animation: float 6s ease-in-out infinite;
  transform: perspective(1000px) rotateY(-5deg);
  transition: all 0.5s ease;
}

.hero-image-container:hover .hero-image {
  transform: perspective(1000px) rotateY(0deg);
}

.hero-image-shape {
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--accent-color);
  opacity: 0.1;
  top: 20px;
  left: 20px;
  transform: skew(-20deg);
  z-index: 1;
}

@keyframes float {
  0% {
    transform: perspective(1000px) rotateY(-5deg) translateY(0px);
  }
  50% {
    transform: perspective(1000px) rotateY(-5deg) translateY(-15px);
  }
  100% {
    transform: perspective(1000px) rotateY(-5deg) translateY(0px);
  }
}

/* Text Gradient */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Section Title */
.section-title {
  position: relative;
  padding-bottom: 15px;
  margin-bottom: 30px;
  color: var(--dark-color);
}

.section-title:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
}

.section-title.text-center:after {
  left: 50%;
  transform: translateX(-50%);
}

/* Diagonal Shapes */
.diagonal-shape {
  position: absolute;
  z-index: 0;
  opacity: 0.1;
  transform: skew(-20deg);
}

.shape-1 {
  width: 300px;
  height: 600px;
  background: var(--accent-color);
  top: -100px;
  right: -150px;
}

.shape-2 {
  width: 200px;
  height: 400px;
  background: var(--primary-color);
  bottom: -100px;
  left: -100px;
}

.shape-3 {
  width: 250px;
  height: 500px;
  background: var(--primary-color);
  top: -50px;
  left: -125px;
}

.shape-4 {
  width: 200px;
  height: 400px;
  background: var(--accent-color);
  bottom: -50px;
  right: -100px;
}

.shape-5 {
  width: 300px;
  height: 600px;
  background: var(--primary-color);
  top: -100px;
  right: -150px;
}

.shape-6 {
  width: 250px;
  height: 500px;
  background: var(--accent-color);
  bottom: -50px;
  left: -125px;
}

.shape-7 {
  width: 200px;
  height: 400px;
  background: var(--primary-color);
  top: -50px;
  left: -100px;
}

/* Article Cards */
.article-card {
  transition: all 0.3s ease;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
}

.article-card::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 0;
  background: var(--gradient-primary);
  top: 0;
  left: 0;
  transition: all 0.3s ease;
}

.article-card:hover::before {
  height: 100%;
}

.article-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 85, 184, 0.1) !important;
}

.article-card .card-img-top {
  transition: transform 0.5s ease;
}

.article-card:hover .card-img-top {
  transform: scale(1.05);
}

.article-card .card-title {
  font-weight: 600;
  transition: color 0.3s ease;
}

.article-card:hover .card-title {
  color: var(--primary-color);
}

/* Category Badge */
.category-badge {
  background: var(--gradient-primary);
  color: white;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  box-shadow: 0 4px 10px rgba(0, 85, 184, 0.2);
  transition: all 0.3s ease;
  transform: skew(-5deg);
}

.category-badge:hover {
  transform: skew(-5deg) translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 85, 184, 0.3);
}

/* Popular Badge */
.popular-badge {
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  color: white;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  box-shadow: 0 4px 10px rgba(255, 107, 107, 0.2);
  transition: all 0.3s ease;
  transform: skew(-5deg);
}

.popular-badge:hover {
  transform: skew(-5deg) translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 107, 107, 0.3);
}

/* Read More Button */
.read-more-btn {
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: all 0.3s ease;
}

.read-more-btn::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  transform: skew(-20deg) translateX(-100%);
  transition: all 0.4s ease;
  z-index: -1;
}

.read-more-btn:hover::after {
  transform: skew(-20deg) translateX(0);
}

/* Search and Filter Section */
.search-filter-section {
  background-color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.search-input-group {
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.search-input-group .form-control {
  border-radius: 0;
  height: 50px;
}

.search-input-group .input-group-text {
  border-radius: 30px 0 0 30px;
}

.search-btn {
  border-radius: 0 30px 30px 0;
  padding-left: 20px;
  padding-right: 20px;
}

.category-select {
  border-radius: 30px;
  height: 50px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.filter-btn {
  border-radius: 30px;
  height: 50px;
  padding-left: 20px;
  padding-right: 20px;
}

.search-result-alert {
  border-radius: 15px;
  background-color: rgba(0, 85, 184, 0.05);
  border: none;
  color: var(--dark-color);
}

.clear-search-btn {
  border-radius: 30px;
  transform: skew(-5deg);
  transition: all 0.3s ease;
}

.clear-search-btn:hover {
  transform: skew(-5deg) translateY(-2px);
}

/* No Results Alert */
.no-results-alert {
  border-radius: 15px;
  background-color: rgba(0, 85, 184, 0.05);
  border: none;
  color: var(--dark-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Pagination */
.pagination-custom {
  margin-top: 3rem;
}

.pagination-custom .page-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 5px;
  border-radius: 50%;
  color: var(--dark-color);
  border: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.pagination-custom .page-link:hover {
  background-color: rgba(0, 85, 184, 0.1);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.pagination-custom .page-item.active .page-link {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 10px rgba(0, 85, 184, 0.2);
}

.pagination-custom .page-item.disabled .page-link {
  color: #6c757d;
  background-color: #f8f9fa;
}

/* Newsletter Section */
.newsletter-section {
  background: linear-gradient(135deg, rgba(0, 85, 184, 0.05) 0%, rgba(96, 181, 255, 0.05) 100%);
}

.newsletter-input-group {
  border-radius: 30px 0 0 30px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.newsletter-input-group .form-control {
  border-radius: 30px 0 0 30px;
  height: 50px;
}

.newsletter-btn {
  border-radius: 0 30px 30px 0;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.newsletter-btn::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  transform: skew(-20deg) translateX(-100%);
  transition: all 0.4s ease;
  z-index: -1;
}

.newsletter-btn:hover::after {
  transform: skew(-20deg) translateX(0);
}

/* Category Cards */
.category-card {
  transition: all 0.3s ease;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
}

.category-card::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 5px;
  background: var(--gradient-primary);
  bottom: 0;
  left: 0;
  transition: all 0.3s ease;
  opacity: 0;
}

.category-card:hover::before {
  opacity: 1;
}

.category-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 85, 184, 0.1) !important;
}

.category-card .feature-icon {
  transition: all 0.3s ease;
  transform: skew(-10deg);
}

.category-card:hover .feature-icon {
  transform: skew(-10deg) scale(1.1);
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, rgba(0, 85, 184, 0.02) 0%, rgba(96, 181, 255, 0.02) 100%);
}

.cta-card {
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.cta-card::before {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  background: var(--accent-color);
  opacity: 0.05;
  top: -100px;
  right: -100px;
  border-radius: 50%;
  z-index: -1;
}

.cta-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  background: var(--primary-color);
  opacity: 0.05;
  bottom: -75px;
  left: -75px;
  border-radius: 50%;
  z-index: -1;
}

.cta-btn-primary {
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: all 0.3s ease;
}

.cta-btn-primary::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  transform: skew(-20deg) translateX(-100%);
  transition: all 0.4s ease;
  z-index: -1;
}

.cta-btn-primary:hover::after {
  transform: skew(-20deg) translateX(0);
}

.cta-btn-secondary {
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: all 0.3s ease;
}

.cta-btn-secondary::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.05);
  transform: skew(-20deg) translateX(-100%);
  transition: all 0.4s ease;
  z-index: -1;
}

.cta-btn-secondary:hover::after {
  transform: skew(-20deg) translateX(0);
}

/* Responsive Styles */
@media (max-width: 991.98px) {
  .blog-hero-section {
    padding: 3rem 0;
  }

  .hero-image-container {
    margin-top: 2rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .display-5 {
    font-size: 2.5rem;
  }
}

@media (max-width: 767.98px) {
  .blog-hero-section {
    padding: 2rem 0;
  }

  .hero-image-shape {
    display: none;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .display-5 {
    font-size: 2rem;
  }

  .diagonal-shape {
    display: none;
  }

  .pagination-custom .page-link {
    width: 35px;
    height: 35px;
    margin: 0 2px;
    font-size: 0.9rem;
  }
}

@media (max-width: 575.98px) {
  .blog-hero-section h1 {
    font-size: 2rem;
  }

  .lead {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .display-5 {
    font-size: 1.8rem;
  }

  .search-input-group,
  .category-select,
  .filter-btn {
    margin-bottom: 0.5rem;
  }

  .newsletter-input-group,
  .newsletter-btn {
    margin-bottom: 0.5rem;
  }
}
