/* ==========================================================================
   💬 زر التواصل العائم + قائمة السوشيال + طلب صيانة (نسخة مصغّرة)
   ========================================================================== */

/* --- الزر العائم --- */
.chat-widget {
  position: fixed;
  bottom: 70px;
  right: 16px;
  z-index: 9999;
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
}
.chat-toggle {
  position: relative;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0288D1, #002F6C);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 47, 108, 0.5);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  padding: 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.chat-toggle:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, #00BFFF, #0288D1);
}
.chat-toggle svg {
  width: 22px;
  height: 22px;
  fill: white;
  transition: transform 0.4s ease;
  pointer-events: none;
}

/* Badge */
.chat-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ff3b30;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  opacity: 0;
  transform: scale(0);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
}
.chat-badge.show {
  opacity: 1;
  transform: scale(1);
  animation: badgeBounce 0.6s ease-in-out;
}
@keyframes badgeBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* Tooltip */
.chat-tooltip {
  position: absolute;
  bottom: 50%;
  right: 58px;
  transform: translateY(50%) translateX(20px);
  padding: 8px 13px;
  background: #fff;
  color: #002F6C;
  border: 2px solid #00BFFF;
  border-radius: 20px;
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
}
.chat-tooltip::before { content: "👋 "; margin-left: 4px; }
.chat-tooltip::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left: 8px solid #fff;
}
.chat-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(50%) translateX(0);
}

/* القائمة */
.chat-menu {
  position: absolute;
  bottom: 58px;
  right: 0;
  width: 230px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.25) !important;
  backdrop-filter: blur(25px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 16px !important;
  box-shadow: 0 14px 40px rgba(0, 47, 108, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transform-origin: bottom right;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: none;
}
.chat-widget.open .chat-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-menu-header {
  text-align: center;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}
.chat-menu-header h4 {
  margin: 0 0 3px 0;
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.chat-menu-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* أزرار القائمة */
.chat-action {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  padding: 9px 11px !important;
  margin-bottom: 7px !important;
  border-radius: 12px !important;
  text-decoration: none !important;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  width: 100% !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  font-family: inherit !important;
  text-align: right !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}
.chat-action:hover {
  transform: translateX(-4px);
  background: rgba(255, 255, 255, 0.35) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}

.chat-action-icon {
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.3) !important;
  border-radius: 50% !important;
  transition: all 0.3s ease;
  flex-shrink: 0 !important;
}
.chat-action:hover .chat-action-icon {
  transform: rotate(15deg) scale(1.1);
}
.chat-action-icon svg {
  width: 17px !important;
  height: 17px !important;
  fill: #ffffff;
  pointer-events: none;
}

.chat-action-title {
  font-size: 11.5px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.chat-action-subtitle {
  font-size: 10px !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

/* زر طلب الصيانة */
.chat-action.maintenance {
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
  border: 1px solid rgba(255,255,255,0.35) !important;
}
.chat-action.maintenance .chat-action-icon {
  background: rgba(255,255,255,0.25) !important;
}
.chat-action.maintenance .chat-action-icon svg {
  fill: none !important;
  stroke: #fff !important;
  stroke-width: 2.2 !important;
}
.chat-action.maintenance:hover {
  background: linear-gradient(135deg, #38bdf8, #0284c7) !important;
}

/* سوشيال */
.chat-social-title {
  position: relative;
  margin: 10px 0 7px 0;
  text-align: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 11px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.chat-social-title::before,
.chat-social-title::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 25%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}
.chat-social-title::before { right: 0; }
.chat-social-title::after { left: 0; }
.chat-social-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.chat-social-item {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.chat-social-item:hover {
  transform: translateY(-4px) rotate(360deg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.chat-social-item svg {
  width: 15px;
  height: 15px;
  fill: white;
}
.chat-social-item.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.chat-social-item.twitter { background: #000000; }
.chat-social-item.snapchat { background: #FFFC00; }
.chat-social-item.snapchat svg { fill: #000; }
.chat-social-item.tiktok { background: linear-gradient(135deg, #ff0050, #00f2ea); }
.chat-social-item.facebook { background: #1877f2; }

/* Overlay الشات */
.chat-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(3px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}
.chat-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.chat-widget.open .chat-toggle {
  background: linear-gradient(135deg, #ff5252, #c62828);
}
.chat-widget.open .chat-toggle svg {
  transform: rotate(180deg) scale(0.9);
}

/* ===== نافذة طلب الصيانة (مصغّرة قليلًا) ===== */
#maintOverlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483646 !important;
  background: rgba(10, 30, 60, 0.75) !important;
  backdrop-filter: blur(6px);
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 14px !important;
  direction: rtl !important;
}
#maintOverlay.active {
  display: flex !important;
}
#maintOverlay .maint-modal {
  background: #fff !important;
  border-radius: 16px !important;
  width: 100% !important;
  max-width: 380px !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  padding: 22px 18px 18px !important;
  position: relative !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35) !important;
  font-family: 'Tajawal', sans-serif !important;
}
#maintOverlay .maint-close {
  position: absolute !important;
  top: 10px !important;
  left: 10px !important;
  width: 30px !important;
  height: 30px !important;
  border: none !important;
  background: #f1f5f9 !important;
  border-radius: 50% !important;
  font-size: 18px !important;
  color: #64748b !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}
#maintOverlay .maint-header {
  text-align: center !important;
  margin-bottom: 14px !important;
}
#maintOverlay .maint-header h2 {
  margin: 0 0 4px !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}
#maintOverlay .maint-header p {
  margin: 0 !important;
  font-size: 11px !important;
  color: #64748b !important;
  line-height: 1.5 !important;
}
#maintOverlay .maint-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 9px !important;
}
#maintOverlay .maint-field label {
  display: block !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  margin-bottom: 4px !important;
}
#maintOverlay .maint-field input,
#maintOverlay .maint-field select,
#maintOverlay .maint-field textarea {
  width: 100% !important;
  padding: 9px 11px !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  font-size: 12.5px !important;
  font-family: inherit !important;
  background: #f8fafc !important;
  outline: none !important;
  box-sizing: border-box !important;
  color: #0f172a !important;
}
#maintOverlay .maint-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 9px !important;
}
#maintOverlay .maint-submit {
  margin-top: 4px !important;
  width: 100% !important;
  padding: 11px !important;
  border: none !important;
  border-radius: 50px !important;
  background: linear-gradient(90deg, #0ea5e9, #06b6d4) !important;
  color: #fff !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  cursor: pointer !important;
}
#maintOverlay .maint-note {
  margin: 6px 0 0 !important;
  font-size: 10px !important;
  color: #94a3b8 !important;
  text-align: center !important;
}

@media (max-width: 479px) {
  .chat-widget { bottom: 64px; right: 12px; }
  .chat-toggle { width: 42px; height: 42px; }
  .chat-toggle svg { width: 20px; height: 20px; }
  .chat-badge { width: 16px; height: 16px; font-size: 9px; }
  .chat-tooltip { right: 50px; padding: 7px 11px; font-size: 10.5px; }
  .chat-menu {
    width: calc(100vw - 24px);
    max-width: 250px;
    right: -4px;
    bottom: 52px;
  }
  .chat-social-item { width: 30px; height: 30px; }
  .chat-social-item svg { width: 14px; height: 14px; }
  #maintOverlay .maint-row { grid-template-columns: 1fr !important; }
}

/* ==========================================================================
   🌊 شاشة افتتاحية (Splash Screen) — شعار نقاء الساحل الجديد + رسالة ترحيبية
   أضف هذا الكود في نهاية حقل الأكواد الإضافية (CSS) بجانب الأكواد الموجودة
   ========================================================================== */
#npqSplash {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(6px) saturate(140%);
    -webkit-backdrop-filter: blur(6px) saturate(140%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}
#npqSplash.npq-splash-out {
    opacity: 0;
    pointer-events: none;
}
.npq-splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}
#npqSplash img {
    width: 460px;
    max-width: 88vw;
    max-height: 78vh;
    height: auto;
    object-fit: contain;
    animation: npqSplashPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.npq-splash-text {
    margin: 20px 0 0;
    font-family: 'Tajawal', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #123B72;
    opacity: 0;
    transform: translateY(10px);
    animation: npqSplashTextIn 0.5s ease 0.35s both;
}
@keyframes npqSplashPop {
    0%   { transform: scale(0.7); opacity: 0; }
    60%  { transform: scale(1.06); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes npqSplashTextIn {
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 479px) {
    #npqSplash img { width: 320px; max-width: 92vw; max-height: 68vh; }
    .npq-splash-text { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    #npqSplash img,
    .npq-splash-text { animation: none; opacity: 1; transform: none; }
    #npqSplash { transition-duration: 0.2s; }
}