
/* 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 */
.shahadah-section {
  margin: 0 auto;
  padding: 15px; /* Reduced for mobile */
  line-height: 1.6; /* Slightly reduced for mobile */
  color: #333;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 12px; /* Reduced for mobile */
  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; /* Increased gap for mobile */
  margin-bottom: 2rem; /* Reduced for mobile */
  text-align: center;
}

.hero-content {
  order: 2;
  padding: 0 10px; /* Added padding for mobile */
}

.main-title {
  color: #0F7B96;
  font-size: clamp(1.5rem, 6vw, 3rem); /* Better mobile scaling */
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3; /* Better for mobile */
  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); /* Better mobile scaling */
  color: #666;
  margin: 0;
  font-weight: 400;
  padding: 0 10px; /* Added padding for mobile */
}

.hero-image {
  order: 1;
  margin-bottom: 1rem; /* Added margin for mobile */
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: 12px; /* Reduced for mobile */
  box-shadow: 0 4px 16px rgba(15, 123, 150, 0.15);
  transition: transform 0.3s ease;
}

/* Content Wrapper - Mobile spacing */
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* Reduced gap for mobile */
}

/* 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 - Mobile optimized */
.content-section {
  background: white;
  padding: 1.5rem; /* Consistent mobile padding */
  border-radius: 12px; /* Reduced for mobile */
  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); /* Better mobile scaling */
  font-weight: 600;
  margin-bottom: 1rem; /* Reduced for mobile */
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(15, 123, 150, 0.2);
  position: relative;
  line-height: 1.3; /* Better for mobile */
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 50px; /* Reduced for mobile */
  height: 2px;
  background: linear-gradient(90deg, #0F7B96, #1a8aa3);
  border-radius: 2px;
}

.content-text {
  font-size: clamp(0.95rem, 3.5vw, 1.1rem); /* Better mobile scaling */
  margin-bottom: 1.2rem; /* Reduced for mobile */
  color: #444;
  text-align: left; /* Changed from justify for better mobile readability */
  line-height: 1.7; /* Better spacing for mobile */
}

/* Shahada Card - Mobile optimized */
.shahada-card {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 1.5rem; /* Reduced for mobile */
  border-radius: 10px;
  border-left: 4px solid #0F7B96;
  margin: 1.5rem 0; /* Reduced for mobile */
  text-align: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.arabic-text {
  font-size: clamp(1.1rem, 5vw, 2rem); /* Better mobile scaling */
  font-weight: 700;
  margin-bottom: 1rem;
  color: #0F7B96;
  direction: rtl;
  font-family: 'Amiri', 'Times New Roman', serif;
  line-height: 1.8;
  word-break: break-word; /* Prevent overflow on mobile */
}

.translation {
  font-style: italic;
  font-size: clamp(0.9rem, 3.5vw, 1.2rem); /* Better mobile scaling */
  color: #555;
  line-height: 1.6;
  padding: 0 5px; /* Added padding for mobile */
}

/* Belief Types - Mobile stacked */
.belief-types {
  display: flex;
  flex-direction: column; /* Stack on mobile */
  gap: 1.2rem; /* Reduced gap for mobile */
  margin: 1.5rem 0; /* Reduced for mobile */
}

.belief-card {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border: 2px solid rgba(15, 123, 150, 0.1);
  border-radius: 10px; /* Reduced for mobile */
  padding: 1.2rem; /* Reduced for mobile */
  transition: all 0.3s ease;
}

.belief-title {
  color: #0F7B96;
  font-size: clamp(1rem, 4vw, 1.3rem); /* Better mobile scaling */
  font-weight: 600;
  margin-bottom: 0.8rem; /* Reduced for mobile */
  line-height: 1.3;
}

.belief-content {
  background: white;
  padding: 1.2rem; /* Reduced for mobile */
  border-radius: 8px;
  border-left: 3px solid #0F7B96; /* Reduced for mobile */
}

.belief-content p {
  margin: 0;
  font-size: clamp(0.9rem, 3.2vw, 1.05rem); /* Better mobile scaling */
  line-height: 1.6;
  text-align: left; /* Changed from center for better mobile readability */
  font-weight: 400; /* Reduced weight for mobile */
}

/* Books Grid - Mobile optimized */
.books-grid {
  display: flex;
  flex-direction: column; /* Stack on mobile */
  gap: 1rem;
  margin: 1.5rem 0; /* Reduced for mobile */
}

.book-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.2rem; /* Reduced for mobile */
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-radius: 8px; /* Reduced for mobile */
  border: 1px solid rgba(15, 123, 150, 0.1);
  transition: all 0.3s ease;
}

.book-number {
  background: #0F7B96;
  color: white;
  width: 28px; /* Slightly reduced for mobile */
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
  font-size: 0.85rem; /* Reduced for mobile */
}

.book-content {
  flex: 1;
}

.book-content p {
  margin: 0;
  font-size: clamp(0.9rem, 3.2vw, 1.05rem); /* Better mobile scaling */
  line-height: 1.5;
}

/* Prophets Grid - Mobile optimized */
.prophets-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile */
  gap: 0.8rem;
  margin: 1.5rem 0; /* Reduced for mobile */
}

.prophet-item {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  padding: 1rem 1.2rem; /* Better mobile padding */
  border-radius: 8px;
  border: 1px solid rgba(15, 123, 150, 0.1);
  font-size: clamp(0.85rem, 3.5vw, 1rem); /* Better mobile scaling */
  text-align: center;
  transition: all 0.3s ease;
  cursor: default;
  line-height: 1.4; /* Better for mobile */
}

.prophet-item.special {
  background: linear-gradient(135deg, #0F7B96, #1a8aa3);
  color: white;
  font-weight: 600;
  font-size: clamp(0.95rem, 3.8vw, 1.1rem); /* Better mobile scaling */
  padding: 1.2rem; /* Increased padding for special item */
}

/* Subsections - Mobile optimized */
.subsection {
  margin: 1.5rem 0; /* Reduced for mobile */
  padding: 1.2rem; /* Reduced for mobile */
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-radius: 10px; /* Reduced for mobile */
  border-left: 3px solid #0F7B96; /* Reduced for mobile */
}

.subsection-title {
  color: #0F7B96;
  font-size: clamp(1rem, 4vw, 1.3rem); /* Better mobile scaling */
  font-weight: 600;
  margin-bottom: 0.8rem; /* Reduced for mobile */
  line-height: 1.3;
}

/* Tablet breakpoint */
@media (min-width: 600px) {
  .shahadah-section {
    padding: 25px;
  }
  
  .content-wrapper {
    gap: 2rem;
  }
  
  /* Added for TOC */
  .toc-list {
    columns: 2;
    gap: 1.5rem;
  }
  
  .content-section {
    padding: 2rem;
  }
  
  .shahada-card {
    padding: 2rem;
  }
  
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .prophets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .belief-types {
    flex-direction: row;
    gap: 1.5rem;
  }
  
  .belief-card {
    flex: 1;
  }
}

/* Desktop breakpoint */
@media (min-width: 768px) {
  .shahadah-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;
  }
  
  .belief-content p {
    text-align: center;
    font-weight: 500;
  }
  
  .prophets-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .prophet-item.special {
    grid-column: 1 / -1;
  }
}

/* Large desktop breakpoint */
@media (min-width: 1024px) {
  .prophets-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 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);
  }
  
  .belief-card:hover {
    border-color: #0F7B96;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(15, 123, 150, 0.15);
  }
  
  .book-item:hover {
    border-color: #0F7B96;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(15, 123, 150, 0.1);
  }
  
  .prophet-item:hover {
    background: linear-gradient(135deg, #0F7B96, #1a8aa3);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(15, 123, 150, 0.2);
  }
  
  .prophet-item.special:hover {
    background: linear-gradient(135deg, #1a8aa3, #0F7B96);
    transform: scale(1.02);
  }
  
  .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,
.belief-card:focus-within,
.book-item:focus-within,
.prophet-item:focus {
  outline: 2px solid #0F7B96;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .toc-container { /* Added for TOC */
    border: 2px solid #000;
  }

  .toc-title { /* Added for TOC */
    border-bottom-color: #000;
  }
  
  .content-section {
    border: 2px solid #000;
  }
  
  .section-title {
    border-bottom-color: #000;
  }
  
  .belief-card,
  .book-item,
  .prophet-item {
    border: 2px solid #000;
  }
}

/* Print styles */
@media print {
  .toc-container { /* Hide TOC when printing */
    display: none;
  }
  
  .shahadah-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) {
  .shahadah-section {
    padding: 10px;
    margin: 5px;
    border-radius: 8px;
  }
  
  .toc-container, /* Added for TOC */
  .content-section {
    padding: 1rem;
  }
  
  .shahada-card {
    padding: 1rem;
    margin: 1rem 0;
  }
  
  .belief-card,
  .subsection {
    padding: 1rem;
  }
  
  .main-title {
    font-size: clamp(1.3rem, 7vw, 2.5rem);
  }
}
