/* =========================================================
   🎨 Colon Cancer Awareness Website - Enhanced CSS
   💡 RTL Support | Responsive | Accessibility | Animations
   ========================================================= */

/* 🌈 CSS Variables - Design Tokens */
:root {
  /* Colors */
  --primary-color:       #3b82f6;
  --secondary-color:     #3498db;
  --accent-color:        #004aad;
  --light-green:         #e8f8f5;
  --light-blue:          #ebf3ff;
  --text-dark:           #2c3e50;
  --text-light:          #7f8c8d;
  --white:               #ffffff;
  --gray-light:          #f8f9fa;
  --warning-yellow:      #ffc107;
  --warning-orange:      #ff9800;
  --warning-brown:       #5d4037;

  /* Theme Elements */
  --colon-cancer-ribbon: var(--secondary-color);

  /* Layout & UI */
  --border-radius:       16px;
  --shadow:              0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-hover:        0 20px 40px rgba(0, 0, 0, 0.15);
  --transition:          all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height:       80px;
  --mobile-nav-height:   70px;
  --card-padding:        2rem;
}

/* 🧼 Reset & Base Styles */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 100%;
}

body {
  font-family: 'Cairo', 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--light-blue) 0%, var(--gray-light) 100%);
  min-height: 100vh;
  direction: rtl;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 📝 Typography */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
}

/* 🔍 Accessibility Enhancements */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--accent-color);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
  transition: var(--transition);
}

.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

        header {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            padding: 1rem 2rem;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
            box-shadow: var(--shadow);
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: var(--transition);
        }

/* 🎯 Hero Section */
.hero-section {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), var(--light-blue));
  padding: 3rem 2rem;
  text-align: center;
  margin: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--colon-cancer-ribbon);
}

.ribbon-icon {
  position: absolute;
  top: 20px;
  left: 20px;
  color: var(--colon-cancer-ribbon);
  font-size: 2rem;
  opacity: 0.2;
  z-index: 0;
}

.hero-section h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--text-dark);
  margin-bottom: 1rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  animation: fadeInDown 1s ease-out;
  position: relative;
}

.hero-section h1::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--colon-cancer-ribbon);
  margin: 1rem auto;
  border-radius: 2px;
}

.hero-section p {
  font-size: clamp(0.95rem, 3vw, 1.2rem);
  color: var(--text-light);
  max-width: 800px;
  margin: 0 auto 2rem;
  line-height: 1.8;
  animation: fadeInUp 1s ease-out 0.3s both;
  position: relative;
}

/* 📊 Stats Section */
.stats-container {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.stat-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  text-align: center;
  min-width: 200px;
  transition: var(--transition);
  border-top: 4px solid var(--colon-cancer-ribbon);
  will-change: transform;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.stat-number {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 700;
  color: var(--colon-cancer-ribbon);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1rem;
  color: var(--text-light);
}

/* 🧱 Layout & Grid */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* 🃏 Card Styles */
.card {
  background: var(--white);
  padding: var(--card-padding);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeInUp 1s ease-out;
  position: relative;
  will-change: transform;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  background: var(--colon-cancer-ribbon);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.card h2 {
  color: var(--text-dark);
  margin-bottom: 1rem;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.card h2 i {
  color: var(--colon-cancer-ribbon);
  font-size: 1.5rem;
}

.card p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.7;
}

.card ul {
  list-style: none;
  padding-right: 1rem;
}

.card li {
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
  color: var(--text-dark);
  font-size: 1.05rem;
  line-height: 1.6;
  transition: var(--transition);
}

.card li:hover {
  color: var(--primary-color);
  transform: translateX(-5px);
  background: var(--light-blue);
  border-radius: 8px;
  padding-right: 1rem;
}

.card li::before {
  content: '◀';
  position: absolute;
  right: -1rem;
  color: var(--colon-cancer-ribbon);
  font-weight: bold;
  opacity: 0.7;
}

.card li:last-child {
  border-bottom: none;
}

/* ⚠️ Emergency Warning Box */
.warning-box {
  background: #fff8e1;
  border-left: 5px solid var(--warning-yellow);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}

.warning-box i {
  color: var(--warning-orange);
  font-size: 2rem;
  flex-shrink: 0;
}

.warning-content h3 {
  color: #e65100;
  margin-bottom: 0.5rem;
}

.warning-content p {
  color: var(--warning-brown);
  margin-bottom: 0;
}

/* 🩺 Screening Section */
.screening-section {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin: 2rem 0;
}

.screening-section h2 {
  color: var(--colon-cancer-ribbon);
  margin-bottom: 1.5rem;
  text-align: center;
}

.screening-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.screening-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-number {
  background: var(--colon-cancer-ribbon);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: bold;
}

.step-content h3 {
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.step-content p {
  color: var(--text-light);
  line-height: 1.6;
}

/* 📚 Resources Section */
.resources-section {
  margin: 3rem 0;
}

.resources-section h2 {
  color: var(--colon-cancer-ribbon);
  text-align: center;
  margin-bottom: 2rem;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1.5rem;
}

.resource-card {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  will-change: transform;
}

.resource-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.resource-image {
  height: 150px;
  background: var(--light-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--colon-cancer-ribbon);
  font-size: 3rem;
}

.resource-content {
  padding: 1.5rem;
}

.resource-content h3 {
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.resource-content p {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.resource-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--colon-cancer-ribbon);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: var(--transition);
}

.resource-link:hover {
  background: var(--accent-color);
}

/* 📱 Mobile Navigation */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 1000;
  box-shadow: var(--shadow);
  height: var(--mobile-nav-height);
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  padding: 1rem 0;
  height: 100%;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-light);
  transition: var(--transition);
  padding: 0.5rem;
  border-radius: 12px;
  min-width: 60px;
  justify-content: center;
}

.mobile-nav-item i {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.mobile-nav-item span {
  font-size: 0.8rem;
  font-weight: 600;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--primary-color);
  background: var(--light-blue);
  transform: translateY(-2px);
}

/* 🎞️ Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 📐 Responsive Design */
@media (max-width: 768px) {
  :root {
    --card-padding: 1.5rem;
    --header-height: auto;
  }

  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .hero-section {
    margin: 1rem;
    padding: 2rem 1rem;
  }

  .stats-container {
    gap: 1rem;
  }

  .stat-card {
    min-width: 150px;
    padding: 1rem;
  }

  .main-nav {
    gap: 0.5rem;
  }

  .nav-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }

  .info-grid,
  .resources-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .container {
    padding: 1rem;
  }

  .card {
    padding: var(--card-padding);
    border-radius: 15px;
  }

  .mobile-nav {
    display: block;
  }

  body {
    padding-bottom: var(--mobile-nav-height);
  }
}

@media (max-width: 480px) {
  :root {
    --card-padding: 1.2rem;
  }

  .nav-btn {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
  }

  .container {
    padding: 0.5rem;
  }

  .stats-container {
    flex-direction: column;
  }

  .stat-card {
    width: 100%;
  }
}

/* 🖨️ Print Styles */
@media print {
  .mobile-nav,
  .main-nav,
  header nav,
  .nav-btn,
  .resource-link {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
    padding-bottom: 0;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
    margin-bottom: 1rem;
  }

  .hero-section {
    background: white !important;
    box-shadow: none;
  }

  a[href]:after {
    content: " [" attr(href) "]";
    font-size: 0.8em;
    color: #555;
  }

  a {
    text-decoration: underline;
  }
}

/* 🌓 High Contrast Mode */
@media (prefers-contrast: high) {
  .card {
    border: 2px solid var(--accent-color);
  }

  .nav-link:hover,
  .nav-link.active {
    background: var(--primary-color);
    color: var(--white);
  }

  .hero-section h1 {
    text-shadow: none;
  }

  .card li::before {
    opacity: 1;
  }

  .warning-box {
    border: 2px solid var(--warning-orange);
  }
}

/* 🐢 Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  :root {
    --transition: none;
  }
}
/* تنسيق صورة المرض */
.media-container {
  text-align: center;
  margin: 2rem 0;
}

.disease-image {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.media-caption {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
  font-style: italic;
}

/* تنسيق disclaimer الجملة */
.disclaimer-sentence {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  padding: 1rem;
  margin: 1.5rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: #856404;
}
.site-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  padding: 1.5rem 0;
  text-align: center;
  margin-top: 2rem;
  font-family: 'Cairo', sans-serif;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-text {
  color: #6c757d;
  margin: 0;
  font-size: 0.9rem;
}

.footer-link {
  color: #007bff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .site-footer {
      padding: 1rem 0;
  }
  
  .footer-text {
      font-size: 0.85rem;
  }
}