
/* Added for smooth scrolling */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Mobile-First Responsive CSS for Fasting Section */
.fasting-section {
  margin: 0 auto;
  padding: 15px;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  overflow: hidden;
}

/* Hero Section - Mobile First */
.hero-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.hero-content {
  order: 2;
  padding: 0 10px;
}

.main-title {
  color: #0F7B96;
  font-size: clamp(1.5rem, 6vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
  background: linear-gradient(135deg, #0F7B96, #1a8aa3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: clamp(1rem, 4vw, 1.3rem);
  color: #666;
  margin: 0;
  font-weight: 400;
  padding: 0 10px;
}

.hero-image {
  order: 1;
  margin-bottom: 1rem;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(15, 123, 150, 0.15);
  transition: transform 0.3s ease;
}

/* Content Wrapper */
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* START: TOC STYLES */
.toc-container {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid rgba(15, 123, 150, 0.1);
  margin-bottom: 1rem; /* Spacing after TOC */
}

.toc-title {
  color: #0F7B96;
  font-size: clamp(1.2rem, 4.5vw, 1.6rem);
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1.2rem;
  border-bottom: 2px solid rgba(15, 123, 150, 0.2);
  padding-bottom: 0.5rem;
}

.toc-list {
  list-style: decimal inside;
  padding-left: 0;
  margin: 0;
  columns: 1; /* Single column on mobile */
}

.toc-list li {
  margin-bottom: 0.8rem;
  font-size: clamp(0.9rem, 3.2vw, 1rem);
}

.toc-list li::marker {
  font-weight: 600;
  color: #0F7B96;
}

.toc-list li a {
  text-decoration: none;
  color: #0F7B96;
  font-weight: 500;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.toc-list li a:hover,
.toc-list li a:focus {
  color: #1a8aa3;
  text-decoration: underline;
  padding-left: 4px; /* Slight indent on hover */
}
/* END: TOC STYLES */

/* Content Sections */
.content-section {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid rgba(15, 123, 150, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section-title {
  color: #0F7B96;
  font-size: clamp(1.2rem, 4.5vw, 1.8rem);
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(15, 123, 150, 0.2);
  position: relative;
  line-height: 1.3;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, #0F7B96, #1a8aa3);
  border-radius: 2px;
}

.content-text {
  font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  margin-bottom: 1.2rem;
  color: #444;
  text-align: left;
  line-height: 1.7;
}

/* Quran Card */
.quran-card {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 1.5rem;
  border-radius: 10px;
  border-left: 4px solid #0F7B96;
  margin: 1.5rem 0;
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.quran-text {
  font-style: italic;
  font-size: clamp(0.95rem, 3.5vw, 1.1rem);
  line-height: 1.6;
  margin-bottom: 1rem;
  color: #333;
}

.quran-source {
  display: block;
  font-size: clamp(0.8rem, 2.8vw, 0.9rem);
  opacity: 0.8;
  font-weight: 500;
  color: #0F7B96;
}

/* Benefits Container */
.benefits-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin: 1.5rem 0;
}

.benefit-card {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-radius: 12px;
  border: 1px solid rgba(15, 123, 150, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.benefit-header {
  background: linear-gradient(135deg, #0F7B96, #1a8aa3);
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.benefit-number {
  background: rgba(255, 255, 255, 0.2);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.benefit-title {
  margin: 0;
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  font-weight: 600;
  line-height: 1.3;
  color:white;
}

.benefit-content {
  padding: 1.2rem;
}

.benefit-content p {
  margin-bottom: 1rem;
  font-size: clamp(0.9rem, 3.2vw, 1rem);
  line-height: 1.6;
  color: #444;
}

.benefit-content p:last-child {
  margin-bottom: 0;
}

/* Verses and Hadith Container */
.verses-hadith-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin: 1.5rem 0;
}

.verse-hadith-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.2rem;
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-radius: 10px;
  border: 1px solid rgba(15, 123, 150, 0.1);
  transition: all 0.3s ease;
}

.item-number {
  background: #0F7B96;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.item-content {
  flex: 1;
}

.item-intro, .item-outro {
  margin-bottom: 1rem;
  font-size: clamp(0.9rem, 3.2vw, 1rem);
  line-height: 1.5;
}

.item-outro {
  margin-top: 1rem;
  margin-bottom: 0;
}

.quote-card {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  border-left: 3px solid #0F7B96;
  margin: 1rem 0;
}

.quote-card p {
  margin: 0;
  font-style: italic;
  font-size: clamp(0.95rem, 3.5vw, 1.05rem);
  line-height: 1.6;
  color: #333;
  margin-bottom: 0.5rem;
}

.quote-source {
  display: block;
  font-size: clamp(0.8rem, 2.8vw, 0.9rem);
  opacity: 0.8;
  font-weight: 500;
  color: #0F7B96;
  margin-top: 0.5rem;
}

/* Levels Container */
.levels-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin: 1.5rem 0;
}

.level-card {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-radius: 12px;
  border: 1px solid rgba(15, 123, 150, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.level-header {
  background: linear-gradient(135deg, #0F7B96, #1a8aa3);
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.level-number {
  background: rgba(255, 255, 255, 0.2);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.level-title {
  margin: 0;
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  font-weight: 600;
  line-height: 1.3;
  color:white;
}

.level-content {
  padding: 1.2rem;
}

.level-content p {
  margin: 0;
  font-size: clamp(0.9rem, 3.2vw, 1rem);
  line-height: 1.6;
  color: #444;
}

/* Tablet breakpoint */
@media (min-width: 600px) {
  .fasting-section {
    padding: 25px;
  }
  
  .content-wrapper {
    gap: 2rem;
  }

  /* Added for TOC */
  .toc-list {
    columns: 2;
    gap: 1.5rem;
  }
  
  .content-section {
    padding: 2rem;
  }
  
  .quran-card {
    padding: 2rem;
  }
}

/* Desktop breakpoint */
@media (min-width: 768px) {
  .fasting-section {
    padding: clamp(25px, 5vw, 40px);
  }
  
  .hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    text-align: left;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
  }
  
  .hero-content {
    order: 1;
    padding: 0;
  }
  
  .hero-image {
    order: 2;
    margin-bottom: 0;
  }
  
  .content-wrapper {
    gap: 2.5rem;
  }
  
  .content-section {
    padding: 2.5rem;
  }
  
  .content-text {
    text-align: justify;
  }
}

/* Large desktop breakpoint */
@media (min-width: 1024px) {
  .benefits-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
  }
}

/* Hover effects for non-touch devices */
@media (hover: hover) {
  .content-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  }
  
  .benefit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(15, 123, 150, 0.15);
  }
  
  .verse-hadith-item:hover {
    border-color: #0F7B96;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(15, 123, 150, 0.1);
  }
  
  .level-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(15, 123, 150, 0.15);
  }
  
  .hero-image img:hover {
    transform: scale(1.02);
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  /* Added for smooth scrolling */
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* Focus states for accessibility */
.toc-list li a:focus, /* Added for TOC */
.content-section:focus-within,
.benefit-card:focus-within,
.verse-hadith-item:focus-within,
.level-card:focus-within {
  outline: 2px solid #0F7B96;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .toc-container, /* Added for TOC */
  .content-section,
  .benefit-card,
  .verse-hadith-item,
  .level-card {
    border: 2px solid #000;
  }
  
  .toc-title, /* Added for TOC */
  .section-title {
    border-bottom-color: #000;
  }
}

/* Print styles */
@media print {
  .toc-container { /* Hide TOC when printing */
    display: none;
  }
  
  .fasting-section {
    box-shadow: none;
    background: white;
    padding: 20px;
  }
  
  .content-section {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
    margin-bottom: 20px;
  }
  
  .hero-image img {
    max-height: 300px;
    object-fit: contain;
  }
}

/* Very small screens (phones in portrait) */
@media (max-width: 375px) {
  .fasting-section {
    padding: 10px;
    margin: 5px;
    border-radius: 8px;
  }
  
  .toc-container, /* Added for TOC */
  .content-section {
    padding: 1rem;
  }
  
  .quran-card {
    padding: 1rem;
    margin: 1rem 0;
  }
  
  .benefit-header,
  .level-header {
    padding: 0.8rem;
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .benefit-content,
  .level-content {
    padding: 1rem;
  }
  
  .main-title {
    font-size: clamp(1.3rem, 7vw, 2.5rem);
  }
}
