/* Extracted and optimized inline styles - تفسير.com */

/* ===== Top Navigation ===== */
.top-nav {
  width: 100% !important;
  background: linear-gradient(135deg, #2d0050 0%, #1a002d 50%, #0d0015 100%);
  padding: 14px 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important; /* Align to right for RTL */
  flex-wrap: nowrap !important; /* CRITICAL: Prevent menu wrapping */
  gap: 12px !important;
  position: sticky !important;
  top: 0;
  z-index: 9999 !important;
  box-shadow: 0 4px 20px rgba(120, 40, 200, 0.4), 0 1px 0 rgba(255,255,255,0.05) inset;
  border-bottom: 1px solid rgba(180, 100, 255, 0.15);
  min-height: 64px;
}

.top-nav .menu { 
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
  flex-wrap: nowrap !important; /* Menu items stay on one line */
  flex-shrink: 0 !important; /* Menu never shrinks */
  flex-direction: row !important;
}

.top-nav .menu a {
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 600; 
  padding: 10px 16px !important;
  border-radius: 8px;
  transition: all 0.25s ease;
  font-size: 15px;
  border: 1px solid transparent;
  white-space: nowrap !important; /* Links don't wrap text */
  display: inline-block !important;
}

.top-nav .menu a:hover { 
  background: rgba(180, 100, 255, 0.15);
  border-color: rgba(180, 100, 255, 0.3);
  color: #f3d9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(180, 100, 255, 0.2);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.menu-toggle:hover {
  background: rgba(255,255,255,0.1);
}

@media (max-width: 768px) {
  .top-nav { padding: 12px 16px; }
  .top-nav .logo img { height: 40px; }
  
  /* CRITICAL: Hide menu by default on mobile */
  .top-nav .menu {
    display: none !important;
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background: linear-gradient(180deg, #2d0050 0%, #1a002d 100%);
    flex-direction: column;
    padding: 12px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(180, 100, 255, 0.2);
    border-top: none;
    z-index: 999;
  }
  
  /* Only show when menu-active class is added */
  .top-nav .menu.menu-active { 
    display: flex !important; 
  }
  
  .top-nav .menu a {
    padding: 14px 16px;
    border-radius: 8px;
    text-align: right;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  
  .top-nav .menu a:last-child { border-bottom: none; }
  .menu-toggle { display: block; }
}

/* ===== Blog Preview Section ===== */
#blog-preview {
  background: radial-gradient(ellipse at top, #2d0050 0%, #1a002d 60%, #0d0015 100%);
  border-radius: 20px;
  padding: 40px 24px;
  color: #fff;
  max-width: 1200px;
  margin: 40px auto;
  box-shadow: 0 8px 40px rgba(120, 40, 200, 0.2), 0 0 0 1px rgba(180, 100, 255, 0.1);
}

.blog-grid { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 20px; 
}

@media (max-width: 992px) { 
  .blog-grid { grid-template-columns: repeat(2, 1fr); } 
}

@media (max-width: 576px) { 
  .blog-grid { grid-template-columns: 1fr; } 
}

.blog-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 20px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 8px 25px rgba(180, 100, 255, 0.25);
  border-color: rgba(180, 100, 255, 0.3);
}

.blog-card h3 { 
  color: #f3d9ff; 
  margin: 0 0 10px; 
  font-size: 1.1rem; 
  font-weight: 700; 
  line-height: 1.4; 
}

.blog-card p { 
  color: #e6d7ff; 
  margin: 0 0 14px; 
  font-size: 0.95rem; 
  line-height: 1.6; 
}

.blog-card a { 
  color: #b57bff; 
  font-weight: 700; 
  text-decoration: none; 
  transition: color 0.2s; 
}

.blog-card a:hover { 
  color: #d9b3ff; 
  text-decoration: underline; 
}

/* ===== Utilities ===== */
.container-narrow { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 0 16px; 
}

/* ===== Footer ===== */
.footer_link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: all 0.25s ease;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
}

.footer_link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.responsive-footer {
  background: linear-gradient(135deg, #5a1a8c 0%, #3d1066 50%, #2a0a4a 100%);
  margin-top: 50px;
  padding: 0;
  border-top: 1px solid rgba(180, 100, 255, 0.3);
  box-shadow: 0 -4px 20px rgba(120, 40, 200, 0.15);
}

.footer-container {
  color: #fff;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 20px 30px;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.footer-copyright {
  text-align: right;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  order: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.footer-links {
  display: flex;
  flex-wrap: nowrap;
  gap: 15px;
  justify-content: flex-start;
  order: 2;
  align-items: center;
  flex-shrink: 0;
}

/* Mobile responsive footer styles */
@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 25px 20px;
  }
  .footer-links {
    order: 1;
    justify-content: center;
    flex-wrap: wrap;
  }
  .footer-copyright {
    order: 2;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    width: 100%;
  }
}

/* ===== FAQ Section Responsive ===== */
@media (max-width: 768px) {
  #faq-header h2 {
    font-size: 28px !important;
    direction: rtl;
  }
  #faq-header p, .about_text {
    font-size: 15px !important;
    direction: rtl;
  }
  .detail summary h4 {
    font-size: 15px !important;
    direction: rtl;
  }
  .answer {
    font-size: 14px !important;
    direction: rtl;
  }
}

/* ===== CRITICAL: Hide AdSense ads in chat interface ===== */
#chat-background ins.adsbygoogle,
#overflow-chat ins.adsbygoogle,
.ia-chat-content ins.adsbygoogle,
.chat-frame ins.adsbygoogle,
.message-area-bottom ins.adsbygoogle {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ===== Service Overview Cards (Optimized) ===== */
.service-overview-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 15px;
  padding: 25px;
  color: #fff;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(130,0,255,0.15);
}

.service-overview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(200,130,255,0.35);
}

/* ===== Blog Post Cards (Optimized) ===== */
.blog-post-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.blog-post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(255,150,255,0.3);
}
