/* Reset عام */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.7;
}

a { color: #2563eb; text-decoration: none; transition: color 0.22s; }
a:hover { color: #1e40af; text-decoration: underline; }

header, .header-unificato {
  background: linear-gradient(100deg, #1e3a8a 0%, #3b82f6 90%);
  color: #fff;
  padding: 32px 16px 20px 16px;
  text-align: center;
}

.header-unificato nav { margin-bottom: 10px; font-size: 1.08rem; }
.header-unificato h1 { font-size: 2.3rem; margin-bottom: 8px;}
.sottotitolo { font-size:1.10rem; color: #c7d2fe; margin-bottom: 12px; opacity: 0.93; }

main, .contenuto-articolo {
  max-width: 45rem;
  margin: 2rem auto 2.5rem auto;
  padding: 0 1rem;
}

h2 { color: #3b82f6; font-size: 1.26rem; margin: 2rem 0 1rem 0; }
h3 { color: #6366f1; font-size: 1.08rem; margin-bottom: 0.6rem; }

.elenco-articoli { list-style: none; padding: 0; }
.elenco-articoli li {
  background: #fff;
  border-left: 4px solid #3b82f6;
  margin-bottom: 1.32rem;
  padding: 1rem 1rem 0.4rem 1rem;
  border-radius: 7px;
  box-shadow:0 1px 6px rgba(60,120,200,0.03);
  transition: box-shadow 0.2s;
}
.elenco-articoli a { font-weight: 600; }
.elenco-articoli li:hover { box-shadow:0 5px 18px -8px #3b82f688; }
.excerpt {display:block; font-size: 0.97rem; color: #64748b; margin-top: 2.5px;}

.footer-unificato {
  background: #1e293b;
  color: #94a3b8;
  padding: 1.7rem 0;
  margin-top: 2rem;
  text-align: center;
  font-size: 0.95rem;
}
.footer-unificato a { color: #cbd5e1; text-decoration: none; margin:0 6px;}
.footer-unificato a:hover { text-decoration: underline; }

/* المقالات */
.titolo-articolo { font-size: 1.6rem; margin-top: 12px; margin-bottom:10px; color: #3b82f6; text-align:center;}
section { margin-bottom: 2.2rem; }
main section, .contenuto-articolo section { margin-bottom:2rem; }

.svg-area { margin: 1.1rem 0; text-align:center; }
img, svg { max-width:96%; height:auto; display: inline-block; vertical-align: middle; }

/* الجداول المتحركة */
.scroll-table { overflow-x: auto; width: 100%; }
table {
  width: 100%;
  min-width: 400px;
  border-collapse: collapse;
  background: #fff;
  margin: 1.7rem 0;
}
th, td {
  padding: 0.6rem 0.85rem;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}
th { background: #f1f5f9; font-weight: 600; }
tr:nth-child(even) { background: #f9fafb; }
@media (max-width:720px) {
  .header-unificato h1, .titolo-articolo { font-size: 1.4rem;}
  main, .contenuto-articolo { padding: 0 0.2rem; }
  .elenco-articoli li, section { padding-left: 2px; padding-right: 2px;}
  table { font-size: 0.98em; }
}

/* زر العودة للمقال */
.back-btn {
  display:inline-block;
  margin-top: 16px;
  margin-bottom:12px;
  background: #2563eb;
  color: #fff;
  padding: 8px 16px;
  border-radius:8px;
  text-decoration:none;
  font-size:1.01rem;
  transition: background 0.22s;
}
.back-btn:hover {
  background: #1e40af;
}

/* CSS للهيدر والفوتر: مناسب للضوء والوضوح */
.header-unificato {
  background: #f3f4f6;    /* خلفية فاتحة أنيقة */
  color: #1e293b;         /* نص داكن */
  padding: 32px 16px 20px 16px;
  text-align: center;
  box-shadow: 0 4px 18px -12px #3b82f6;
}
.header-unificato nav {
  margin-bottom: 10px; 
  font-size: 1.08rem;
}
.header-unificato nav a {
  color: #2563eb;
  background: #e0e7ff;
  padding: 7px 14px;
  border-radius: 7px;
  margin:0 6px;
  text-decoration:none;
  font-weight:500;
  transition: background 0.16s, color 0.16s;
}
.header-unificato nav a:hover {
  background: #2563eb;
  color: #fff;
}
.header-unificato h1 {
  font-size: 2.2rem;
  margin-bottom: 7px;
  margin-top: 0;
  color: #2563eb;
}
.sottotitolo {
  font-size:1.08rem; 
  color: #64748b;
  margin-bottom: 13px; 
  opacity: 0.96; 
}

.footer-unificato {
  background: #f3f4f6;
  color: #64748b;
  padding: 2rem 0 1.2rem 0;
  text-align: center;
  font-size: 0.97rem;
  border-top: 1px solid #dbeafe;
}
.footer-unificato a {
  color: #2563eb;
  margin: 0 7px;
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 6px;
  background: #e0e7ff;
  font-weight: 500;
  transition: background 0.16s, color 0.16s;
}
.footer-unificato a:hover {
  background: #2563eb;
  color: #fff;
}

/* تنسيق احترافي للجداول لتفادي تداخل الألوان */
table {
  border: 1px solid #e2e8f0;
  border-radius: 8px; /* حواف ناعمة للجدول */
  overflow: hidden; /* لضمان قص الحواف المستديرة */
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin: 2rem 0;
}

th {
  background-color: #1e3a8a; /* أزرق غامق متناسق مع الهيدر */
  color: #ffffff; /* نص أبيض واضح تماماً */
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  border-bottom: 2px solid #3b82f6;
}

td {
  color: #334155; /* رمادي داكن للقراءة المريحة */
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  background-color: #ffffff; /* خلفية بيضاء للنص */
}

/* تلوين الصفوف الزوجية لسهولة القراءة */
tr:nth-child(even) td {
  background-color: #f8fafc; /* رمادي فاتح جداً للصفوف الزوجية */
}

/* تأثير عند مرور الماوس على الصف */
tr:hover td {
  background-color: #eff6ff; /* أزرق فاتح جداً عند التمرير */
}

/* --- تنسيقات قسم الأدوات والآلات الحاسبة --- */
.section-title {
  text-align: center;
  font-size: 1.8rem;
  color: #1e3a8a;
  margin: 3rem 0 1.5rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.tool-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.2rem;
  transition: transform 0.2s, box-shadow 0.2s;
  border-top: 4px solid #3b82f6;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* لضمان تناسق الأزرار في الأسفل */
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.2);
}

.tool-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: #1e3a8a;
  margin-bottom: 0.5rem;
  display: block;
  text-decoration: none;
}

.tool-desc {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 1rem;
  line-height: 1.5;
  flex-grow: 1; /* لجعل الوصف يأخذ المساحة المتاحة ويدفع الزر للأسفل */
}

.btn-tool {
  display: inline-block;
  background-color: #eff6ff;
  color: #2563eb;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.2s, color 0.2s;
}

.btn-tool:hover {
  background-color: #2563eb;
  color: #fff;
}

/* --- تنسيقات قسم المنتج المميز (Featured Product) --- */
.featured-product {
  background: linear-gradient(to right, #f0f9ff, #e0f2fe);
  border: 2px solid #bae6fd;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  text-align: center;
  margin: 3rem 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.featured-product h3 {
  color: #ea580c;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.featured-product h2 {
  font-size: 1.6rem;
  color: #0f172a;
  margin-bottom: 1rem;
  margin-top: 0;
}

.featured-product p {
  color: #475569;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  font-size: 1.05rem;
}

.btn-cta {
  background: #ea580c;
  color: white;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1rem;
  text-decoration: none;
  display: inline-block;
  margin-top: 0.5rem;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 4px 6px -1px rgba(234, 88, 12, 0.3);
}

.btn-cta:hover {
  background: #c2410c;
  transform: translateY(-1px);
}

.rating-text {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 1rem;
  font-weight: 500;
}

/* زر التمرير السريع في الهيدر */
.btn-scroll-down {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background-color: #ffffff;
  color: #2563eb;
  border: 1px solid #e0e7ff;
  border-radius: 25px; /* حواف دائرية كاملة */
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.btn-scroll-down:hover {
  background-color: #eff6ff;
  transform: translateY(2px); /* حركة بسيطة عند النقر */
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* تفعيل التمرير الناعم للصفحة بالكامل */
html {
  scroll-behavior: smooth;
}


body {
  background: #f8fafc; /* sfondo chiaro generale */
  padding: 10px; /* padding generale per evitare che il body tocchi i bordi del viewport */
}

.contenuto-articolo {
  max-width: 720px;  /* larghezza di lettura ottimale */
  margin: 1rem auto; /* centratura verticale e orizzontale */
  padding: 1rem 1.2rem; /* padding orizzontale contenuto */
  background: #ffffff; /* sfondo bianco per distintività */
  border-radius: 12px; /* angoli morbidi */
  box-shadow: 0 4px 24px rgba(59, 130, 246, 0.08); /* ombra delicata azzurra per effetto "finestra" */
  box-sizing: border-box;
}

/* Riduzione margini e padding su mobile per massimizzare area contenuto */
@media (max-width: 480px) {
  .contenuto-articolo {
    margin: 0.6rem 12px; /* margini piccoli, ma padding costante */
    padding: 1rem 0.8rem;
    border-radius: 8px; /* leggermente più piccoli */
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.12);
  }
}