/* ================= ISLAMIC ARTICLE STYLING ================= */

.islamic-article-page .container {
  max-width: 1280px;
  margin: auto;
  padding: 40px 20px;
  font-family: "Outfit", sans-serif;
}

.islamic-article-page .grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

@media (max-width: 1200px) {
  .islamic-article-page .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .islamic-article-page .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .islamic-article-page .grid {
    grid-template-columns: 1fr;
  }
}

/* ================= ISLAMIC ARTICLE BANNER ================= */

.islamic-article-banner-section {
  width: 100%;
  height: 70vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(
    135deg,
    rgba(41, 110, 86, 0.95),
    rgba(22, 60, 48, 0.95)
  );
}

.islamic-article-banner-section::before,
.islamic-article-banner-section::after {
  content: "";
  position: absolute;
  width: 550px;
  height: 550px;
  background: url("img/islamic-pattern2.png") center/contain no-repeat;
  opacity: 0.06;
  animation: islamic-articleRotate 60s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.islamic-article-banner-section::before {
  top: -200px;
  left: -200px;
}

.islamic-article-banner-section::after {
  bottom: -200px;
  right: -200px;
  animation-direction: reverse;
}

@keyframes islamic-articleRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.islamic-article-banner-section::after {
  mix-blend-mode: screen;
}

.islamic-article-banner-content {
  position: relative;
  z-index: 5;
  color: #ffffff;
  max-width: 800px;
  padding: 0 20px;
}

.islamic-article-banner-title {
  font-size: clamp(32px, 5vw, 58px);
  font-family: "Playfair Display", serif;
  font-weight: 600;
  margin-top: 30px;
  letter-spacing: 1px;
}

.islamic-article-banner-subtext {
  font-size: clamp(16px, 2vw, 22px);
  margin-top: 20px;
  opacity: 0.95;
}

.islamic-article-cta-btn {
  display: inline-block;
  padding: 14px 32px;
  background: linear-gradient(135deg, #ffffff, #f2f2f2);
  color: #1f4d3b;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.35s ease;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  margin-top: 20px;
}

.islamic-article-cta-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.islamic-article-page .article-card {
  border-radius: 20px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.islamic-article-page .article-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.islamic-article-page .article-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.islamic-article-page .article-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.islamic-article-page .article-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.islamic-article-page .article-content h2 {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.4;
  color: #1b5e20;
}

.islamic-article-page .article-content p {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 15px;
}

.islamic-article-page .article-content small {
  margin-top: auto;
  font-size: 12px;
  color: #888;
  font-weight: 500;
}

.islamic-article-page .pagination {
  text-align: center;
  margin-top: 50px;
}

.islamic-article-page .pagination a {
  display: inline-block;
  margin: 5px;
  padding: 10px 16px;
  border-radius: 8px;
  background: #2e7d32;
  color: #fff;
  font-weight: 500;
  transition: 0.3s ease;
}

.islamic-article-page .pagination a:hover {
  background: #1b5e20;
}

.islamic-article-page .pagination a.active {
  background: #1b5e20;
}

/* ================= AI SECTION ================= */

.ai-section {
  padding: 15px 20px 20px 20px;
}

.ai-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  color: #fff;
  font-family: "Outfit", sans-serif;
  background: linear-gradient(270deg, #2e7d32, #43a047, #66bb6a, #2e7d32);
  background-size: 300% 300%;

  animation: aiGradient 4s ease infinite;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.ai-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 20px rgba(46, 125, 50, 0.35);
}

@keyframes aiGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.ai-summary {
  display: none;
  margin-top: 10px;
  padding: 12px;
  background: #f1f8f4;
  border-left: 4px solid #2e7d32;
  border-radius: 20px;
  font-size: 14px;
  color: black;
}

.fade-in {
  opacity: 0;
  transform: translateY(60px);
  transition: all 0.9s ease;
}

.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}

/* ================= AI MODAL ================= */

.ai-modal {
  display: none;
  position: fixed;
  z-index: 9999;

  left: 0;
  top: 0;

  width: 100%;
  height: 100%;

  background: rgba(0, 0, 0, 0.65);

  backdrop-filter: blur(5px);

  align-items: center;
  justify-content: center;
}

.ai-modal-box {
  background: #fff;

  width: 90%;
  max-width: 650px;

  border-radius: 20px;

  overflow: hidden;

  animation: modalFade 0.35s ease;

  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

/* ================= HEADER ================= */

.ai-modal-header {
  background: linear-gradient(270deg, #2e7d32, #43a047, #66bb6a, #2e7d32);
  background-size: 400% 400%;

  color: white;

  padding: 16px 20px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  font-weight: 600;

  animation: aiGradientMove 6s ease infinite;
}

@keyframes aiGradientMove {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.ai-close {
  font-size: 22px;
  cursor: pointer;
}

.ai-modal-body {
  padding: 25px;

  font-size: 15px;
  line-height: 1.7;
  color: #444;
}

/* ================= LOADING STYLING ================= */

.ai-loading {
  text-align: center;
}

.ai-spinner {
  border: 4px solid #eee;
  border-top: 4px solid #1f5e3b;

  border-radius: 50%;

  width: 35px;
  height: 35px;

  margin: auto;
  margin-bottom: 10px;

  animation: spin 1s linear infinite;
}

/* ================= AI RESULT ================= */

.ai-result {
  display: none;
  white-space: pre-line;
}

/* ================= ANIMATION ================= */

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes modalFade {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ================= AI ACTIONS ================= */

.ai-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.ai-actions button {
  background: #1f5e3b;
  color: white;
  border: none;

  padding: 8px 14px;
  border-radius: 20px;

  cursor: pointer;
  font-size: 14px;
}

.ai-actions button:hover {
  background: #16472c;
}

/* ================= MOBILE RESPONSIVE ================= */

@media (max-width: 768px) {
  .ai-modal-box {
    width: 92%;
    max-width: 92%;

    border-radius: 20px;
  }

  .ai-modal-header {
    padding: 14px 16px;
    font-size: 15px;
  }

  .ai-modal-body {
    padding: 18px;
    font-size: 14px;

    max-height: 60vh;
    overflow-y: auto;
  }

  .ai-result {
    font-size: 14px;
    line-height: 1.6;
  }

  .ai-actions {
    flex-direction: column;
    gap: 8px;
  }

  .ai-actions button {
    width: 100%;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .ai-modal-box {
    width: 95%;
    border-radius: 20px;
  }

  .ai-modal-body {
    padding: 16px;
  }

  .ai-spinner {
    width: 28px;
    height: 28px;
  }
}
