:root {
  --primary-color: #198754;
  --primary-dark: #146c43;
  --secondary-color: #ffc107;
  --text-color: #333;
  --light-bg: #f8f9fa;
  --navbar-bg-gradient: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

/* General Styles */
body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--light-bg);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  display: flex;
  /* Aktifkan Flexbox untuk layout */
  flex-direction: column;
  /* Susun elemen secara vertikal */
  min-height: 100vh;
  /* Pastikan body setidaknya tinggi layar */
}

/* Navbar Styles */
.navbar {
  background: var(--navbar-bg-gradient);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 0.75rem 1rem;
  transition: background 0.3s ease;
}

/* Navbar Brand */
.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #FFFFFF !important;
  transition: color 0.3s ease;
}

.navbar-brand:hover {
  color: var(--secondary-color) !important;
}

/* Navbar Links */
.nav-link {
  color: #FFFFFF !important;
  margin: 0 1rem;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  background-color: var(--secondary-color);
  bottom: -4px;
  left: 0;
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--secondary-color) !important;
}

.nav-link:hover::after {
  width: 100%;
}

/* Navbar Toggler (untuk tampilan mobile) */
.navbar-toggler {
  border: none;
  padding: 0.25rem 0.75rem;
  font-size: 1.25rem;
  color: #FFFFFF;
  transition: transform 0.3s ease;
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

/* Toggler Icon */
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml;charset=UTF8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255,255,255,0.8)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Responsif: Penyesuaian untuk tampilan mobile */
@media (max-width: 768px) {
  .navbar {
    padding: 0.5rem 1rem;
  }

  .nav-link {
    margin: 0.5rem 0;
  }
}

/* Header Section */
.header-section {
  background: var(--navbar-bg-gradient);
  padding: 100px 0 60px 0;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.header-section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  /* Overlay tipis untuk meningkatkan kontras */
  z-index: 1;
}

.header-content {
  position: relative;
  z-index: 2;
}

.header-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content p {
  font-size: 1.1rem;
  margin-bottom: 25px;
  line-height: 1.6;
}



/* Animasi */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Responsif */


/* Wrapper konten utama */
.main-content-section {
  flex: 1;
  /* Mengisi sisa ruang antara navbar dan footer */
  padding: 40px 0;
  background: #ffffff;
}

/* Content Container */
.content {
  display: flex;
  flex-direction: column;
  gap: 50px;
  /* Jarak vertikal antar elemen menjadi lebih besar */
  padding-top: 100px;
  /* Menaikkan padding-top agar tidak terlalu rapat dengan navbar */
  padding-bottom: 50px;
  padding-left: 20px;
  padding-right: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Style Search Section */
.magazine-search-section {
  margin-bottom: 3rem;
}

.search-hero {
  padding: 3rem 2rem;
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}



.search-container {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.search-title {
  font-size: 3rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-subtitle {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2.5rem;
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.magazine-search-form {
  margin-bottom: 2rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  background: white;
  border-radius: 50px;
  padding: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 1.1rem;
  z-index: 2;
}

.magazine-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 1rem 1rem 1rem 3rem;
  font-size: 1rem;
  background: transparent;
  border-radius: 50px;
}

.magazine-search-input::placeholder {
  color: #999;
}

.magazine-search-btn {
  background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
  border: none;
  border-radius: 50px;
  padding: 1rem 2rem;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
  justify-content: center;
}

.magazine-search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.search-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.tag-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.tags-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tag:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Search Results Section */
.search-results-section {
  display: none;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-container {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 24px rgba(25, 135, 84, 0.08);
  border: 1px solid rgba(25, 135, 84, 0.1);
  margin-top: 2rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid rgba(25, 135, 84, 0.1);
}

.results-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #198754;
  margin: 0;
  letter-spacing: -0.5px;
}

.back-to-main {
  background: transparent;
  border: 2px solid #198754;
  color: #198754;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.back-to-main:hover {
  background: #198754;
  color: white;
  transform: translateY(-1px);
}

.magazine-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-item {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid rgba(25, 135, 84, 0.1);
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: auto;
}

.result-item::before {
  content: none;
}

.result-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(25, 135, 84, 0.1);
  border-color: rgba(25, 135, 84, 0.2);
}

/* Animasi untuk hasil pencarian */
.result-item {
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation untuk multiple items */
.result-item:nth-child(1) {
  animation-delay: 0.1s;
}

.result-item:nth-child(2) {
  animation-delay: 0.2s;
}

.result-item:nth-child(3) {
  animation-delay: 0.3s;
}

.result-item:nth-child(4) {
  animation-delay: 0.4s;
}

.result-item:nth-child(5) {
  animation-delay: 0.5s;
}

.result-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.result-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.result-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #198754;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.5px;
}

.result-meta {
  display: flex;
  gap: 1rem;
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.result-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(25, 135, 84, 0.05);
  padding: 0.3rem 0.7rem;
  border-radius: 12px;
  font-weight: 500;
}

.result-meta i {
  color: #198754;
  font-size: 1rem;
}

.result-excerpt {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.result-read-more {
  color: #198754;
  font-weight: 500;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
  padding-top: 0;
  border-top: none;
  padding: 0.4rem 0.8rem;
  background: rgba(25, 135, 84, 0.05);
  border-radius: 12px;
  align-self: flex-start;
}

.result-read-more:hover {
  color: #146c43;
  gap: 0.4rem;
  background: rgba(25, 135, 84, 0.1);
}

.magazine-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid rgba(25, 135, 84, 0.1);
}

.pagination-btn {
  background: white;
  border: 2px solid #198754;
  color: #198754;
  padding: 0.6rem 1.25rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
}

.pagination-btn:hover:not(:disabled) {
  background: #198754;
  color: white;
  transform: translateY(-1px);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  color: #666;
  font-weight: 500;
  font-size: 0.95rem;
}

.magazine-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(25, 135, 84, 0.2);
  border-top: 3px solid #198754;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-indicator {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  color: #198754;
}

.loading-indicator-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1rem;
}

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

  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-section {
    padding: 100px 0 60px 0;
  }

  .header-content h1 {
    font-size: 2.2rem;
  }

  .header-content p {
    font-size: 1rem;
  }

  .search-hero {
    padding: 2rem 1rem;
    margin-bottom: 2rem;
  }

  .magazine-results-list {
    gap: 0.8rem;
  }

  .result-item {
    padding: 1.25rem;
  }

  .result-title {
    font-size: 1rem;
  }

  .result-read-more {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .result-item {
    padding: 1rem;
  }

  .result-title {
    font-size: 0.95rem;
  }

  .result-read-more {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .search-title {
    font-size: 1.8rem;
  }

  .search-subtitle {
    font-size: 1rem;
  }

  .magazine-results-list {
    gap: 0.6rem;
  }

  .result-item {
    padding: 1rem;
  }

  .result-title {
    font-size: 0.9rem;
  }

  .result-meta {
    gap: 0.8rem;
  }

  .result-meta span {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  .result-excerpt {
    font-size: 0.9rem;
  }

  .search-input-wrapper {
    flex-direction: column;
    border-radius: 25px;
    padding: 0.3rem;
  }

  .search-icon {
    left: 15px;
    top: 35%;
  }

  .magazine-search-input {
    padding: 0.8rem 0.8rem 0.8rem 2.5rem;
    margin-bottom: 0.5rem;
  }

  .magazine-search-btn {
    width: 100%;
    border-radius: 25px;
    padding: 0.8rem;
  }

  .search-tags {
    flex-direction: column;
    gap: 0.5rem;
  }

  .results-container {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .results-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .results-title {
    font-size: 1.5rem;
  }

  .result-item {
    padding: 1rem;
  }

  .result-title {
    font-size: 1.1rem;
  }

  .result-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .magazine-pagination {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .search-hero {
    padding: 1.5rem 0.5rem;
  }

  .search-title {
    font-size: 1.7rem;
  }

  .search-subtitle {
    font-size: 0.9rem;
  }

  .results-container {
    padding: 1rem;
  }

  .magazine-results-list {
    gap: 0.5rem;
  }

  .result-item {
    padding: 0.8rem;
  }

  .result-title {
    font-size: 0.85rem;
  }

  .result-meta {
    gap: 0.5rem;
    flex-direction: column;
  }

  .result-meta span {
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
  }

  .result-excerpt {
    font-size: 0.85rem;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .search-box {
    padding: 1.5rem;
  }

  .search-box .d-flex {
    flex-direction: column;
    gap: 1rem;
  }

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

/* Loading Indicator */
.loading-indicator {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.loading-indicator-inner {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--primary-color);
  font-weight: 500;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Result List Styling */
.result-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.result-list li {
  background: #fff;
  padding: 20px;
  margin-bottom: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border-left: 4px solid var(--primary-color);
}

.result-list li:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.result-list li a {
  text-decoration: none;
  color: #333;
}

.result-list li a:hover {
  color: var(--primary-color);
}

.result-list h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.result-list p {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

/* Post Card Styling */
.post-card {
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--navbar-bg-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

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

.post-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.post-card .card-body {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card .card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.4;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card .meta-info {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 15px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.post-card .meta-info span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.post-card .meta-info i {
  color: var(--primary-color);
}

.post-card .card-footer {
  background: none;
  border: none;
  padding: 0;
  margin-top: auto;
}

.post-card .read-more-button {
  display: inline-block;
  padding: 12px 25px;
  background: var(--navbar-bg-gradient);
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(25, 135, 84, 0.2);
  text-align: center;
}

.post-card .read-more-button:hover {
  background: linear-gradient(45deg, var(--primary-dark), var(--primary-color));
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(25, 135, 84, 0.3);
  color: #fff;
}

/* Pagination Controls */
.pagination-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.pagination-controls button {
  padding: 10px 18px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  min-width: 45px;
}

.pagination-controls button:hover:not(:disabled) {
  background: var(--navbar-bg-gradient);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(25, 135, 84, 0.2);
}

.pagination-controls button:disabled {
  background: #e0e0e0;
  color: #999;
  border-color: #e0e0e0;
  cursor: not-allowed;
}

.pagination-controls button.active {
  background: var(--navbar-bg-gradient);
  color: #fff;
  border-color: transparent;
}

/* Popular Articles Section */
#popular-articles {
  padding: 60px 0;
  background: linear-gradient(to bottom, #ffffff, #f0f8f4);
}

#popular-articles h2 {
  position: relative;
  display: inline-block;
  margin-bottom: 40px;
}

#popular-articles h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--navbar-bg-gradient);
  border-radius: 2px;
}

/* Responsive Styles */
@media (max-width: 992px) {
  .post-card img {
    height: 180px;
  }
}

@media (max-width: 768px) {
  .main-content-section {
    padding: 20px 0;
  }

  .search-input-container {
    flex-direction: column;
  }

  .search-input-container input,
  .search-input-container button {
    width: 100%;
  }

  .search-input-container button {
    margin-top: 10px;
  }

  .post-card img {
    height: 180px;
  }

  .post-card .card-body {
    padding: 20px;
  }

  .post-card .card-title {
    font-size: 1.1rem;
  }

  .post-card .meta-info {
    font-size: 0.8rem;
    gap: 10px;
  }

  .pagination-controls {
    gap: 5px;
  }

  .pagination-controls button {
    padding: 8px 14px;
    font-size: 0.85rem;
    min-width: 40px;
  }

  #popular-articles {
    padding: 40px 0;
  }

  #popular-articles h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .post-card img {
    height: 160px;
  }

  .post-card .card-body {
    padding: 15px;
  }

  .post-card .card-title {
    font-size: 1rem;
  }

  .post-card .meta-info {
    font-size: 0.75rem;
    gap: 8px;
  }

  .post-card .read-more-button {
    padding: 10px 20px;
    font-size: 0.85rem;
  }

  .pagination-controls {
    gap: 4px;
  }

  .pagination-controls button {
    padding: 7px 12px;
    font-size: 0.8rem;
    min-width: 35px;
  }
}

@media (max-width: 480px) {
  .post-card img {
    height: 140px;
  }

  .post-card .card-body {
    padding: 12px;
  }

  .post-card .card-title {
    font-size: 0.95rem;
  }

  .post-card .meta-info {
    font-size: 0.7rem;
    gap: 6px;
  }

  .post-card .read-more-button {
    padding: 8px 16px;
    font-size: 0.8rem;
  }

  .search-input-container input {
    padding: 12px 15px;
    font-size: 0.9rem;
  }

  .search-input-container button {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .post-card .card-title {
    font-size: 0.9rem;
  }

  .post-card .read-more-button {
    padding: 8px 12px;
    font-size: 0.75rem;
  }
}

/* Footer */
footer {
  background-color: #212529;
  color: white;
  padding: 20px;
  min-height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

footer p {
  transform: translateY(10px);
}