/* ==================================================
    ملف الأنماط الأساسي - مع قائمة هاتف مُعاد تصميمها
    Des By : Moez Tech +249123311897
    https://moez-tech.com
==================================================
*/

/* --- الأنماط العامة والخطوط --- */
body {
    background-color: #f8fafc; /* slate-50 */
    color: #1e293b; /* slate-800 */
    cursor: none; 
}

/* تحديد الخطوط لكل لغة */
html[dir="ltr"] body {
    font-family: 'Poppins', sans-serif;
}
html[dir="rtl"] body {
    font-family: 'Tajawal', sans-serif; 
}

html, body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- NEW: Mobile Menu Active State --- */
/* يمنع تمرير الصفحة عند فتح القائمة */
body.mobile-menu-active {
    overflow: hidden;
}

/* --- شاشة التحميل --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #156c4a;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.75s ease, visibility 0.75s;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; 
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(146, 193, 79, 0.3);
    border-top-color: #92c14f;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- المؤشر المخصص (لأجهزة الديسكتوب فقط) --- */
.cursor-dot, .cursor-outline {
    pointer-events: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.2s;
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .cursor-dot, .cursor-outline {
        display: block;
    }
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: #92c14f;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid #92c14f;
    transition: all 0.1s ease-out;
}

body:hover .cursor-dot, body:hover .cursor-outline {
    opacity: 1;
}

.cursor-outline.hover {
    transform: translate(-50%, -50%) scale(1.6);
    background-color: rgba(146, 193, 79, 0.1);
    border-color: rgba(146, 193, 79, 0.5);
}

/* --- الهيدر وشريط التنقل --- */
#main-header {
    z-index: 101; 
    background-color: transparent; /* جعل الهيدر شفافاً بشكل افتراضي */
    transition: background-color 0.4s ease; /* إضافة انتقال ناعم للخلفية */
}

/* START: LOGO STYLE */
.brand-logo img {
    background-color: #ffffff; /* White background */
    border-radius: 50%; /* Circle shape */
    padding: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
/* MODIFIED: Remove circle from logo on scroll */
.nav-scrolled .brand-logo img {
    background-color: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}
/* END: LOGO STYLE */


/* --- تأثير الهيدر الزجاجي عند التمرير --- */
#main-header.nav-scrolled {
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.nav-scrolled .nav-link, .nav-scrolled #menu-btn {
    color: #1e293b; 
}

.nav-scrolled .brand-logo span {
    color: #3c6027;
}

.nav-scrolled .nav-link:hover {
    color: #278361;
}

/* --- NEW: شريط تقدم التمرير --- */
#scroll-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px; /* سماكة الشريط */
    background-color: #92c14f; /* accent color */
    width: 0%; /* يبدأ بعرض صفر */
    z-index: 105;
    /* يتم التحكم في الانتقال عبر جافاسكريبت لتجنب التأخير */
}


/* ===============================================
    START: IMPROVED NAV LINK STYLES 
=============================================== */

/* تم تعديل هذا الجزء لجعل الانتقال سلساً واحترافياً */
.nav-link {
    padding: 0.5rem 1.25rem; /* توحيد الحجم لمنع القفز */
    border-radius: 9999px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    /* الانتقال السلس لجميع الخصائص */
    transition: color 0.4s ease, background-color 0.4s ease, transform 0.3s ease;
}

/* Active Nav Link Styling */
.nav-link.active {
    background-color: #92c14f; /* accent color */
    color: #3c6027; /* secondary color */
    font-weight: 700;
}

.nav-scrolled .nav-link.active {
    background-color: #3c6027; /* secondary color */
    color: #ffffff; /* white */
}

/* ===============================================
    END: IMPROVED NAV LINK STYLES 
=============================================== */


/* ===============================================
    START: NEW MOBILE MENU STYLES 
=============================================== */

/* --- The Overlay --- */
#mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 102; /* Higher than header */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

body.mobile-menu-active #mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
}

/* --- The Menu Panel --- */
#mobile-menu {
    position: fixed;
    top: 0;
    width: 85%; /* Take up 85% of screen width */
    max-width: 320px; /* But not more than 320px */
    height: 100%;
    /* Use a brand color with a subtle gradient for depth */
    background: linear-gradient(170deg, #3c6027 0%, #2a4d1c 100%);
    z-index: 103; /* Higher than overlay */
    
    display: flex;
    flex-direction: column; /* Changed to column */
    
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
    /* Hide menu by default */
    transform: translateX(-100%);
}

/* Adjust position for RTL */
html[dir="rtl"] #mobile-menu {
    right: 0;
    left: auto;
    transform: translateX(100%);
}

/* Active state to slide the menu in */
body.mobile-menu-active #mobile-menu {
    transform: translateX(0);
}

/* --- NEW: Mobile Menu Header --- */
.mobile-menu-header {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0; /* Prevent header from shrinking */
}
.mobile-menu-header img {
    height: 56px; /* 14 * 4 */
    width: 56px;
    margin: 0 auto 0.75rem; /* Center the logo */
    background-color: #fff;
    border-radius: 50%;
    padding: 4px;
}
.mobile-menu-header .brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.mobile-menu-header .brand-subtext {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}


/* --- Menu Links --- */
.mobile-menu-links {
    flex-grow: 1; /* Allow links container to fill space */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center links vertically */
    padding: 1rem 0;
}

.mobile-nav-link {
    font-size: clamp(1.1rem, 4vw, 1.25rem); /* Slightly smaller font */
    font-weight: 500; /* Adjusted weight */
    color: rgba(255, 255, 255, 0.8);
    padding: 0.9rem 2rem;
    display: block;
    width: 100%;
    text-align: center;
    transition: color 0.3s, background-color 0.3s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Subtle separator */
}
.mobile-menu-links a:last-child {
    border-bottom: none; /* Remove border from last link */
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
    color: #ffffff;
    background-color: #92c14f; /* Use accent color for hover */
    font-weight: 600;
}


/* --- Close Button --- */
#close-btn {
    position: absolute;
    top: 1rem;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
}
html[dir="ltr"] #close-btn { right: 0.5rem; }
html[dir="rtl"] #close-btn { left: 0.5rem; }

#close-btn:hover {
    color: #92c14f; /* Accent color on hover */
    transform: rotate(90deg);
}

/* ===============================================
    END: NEW MOBILE MENU STYLES 
=============================================== */


/* --- قسم الهيرو --- */
.hero-section {
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    position: relative;
    min-height: calc(var(--vh, 1vh) * 100);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(21, 108, 74, 0.85), rgba(60, 96, 39, 0.85));
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 3;
}

.hero-headline .word {
     display: inline-block;
    overflow: hidden;
    margin-bottom: 0.05em;
    line-height: 1.2; /* يضمن وضوح كامل للحروف */
     padding-bottom: 0.1em; /* Add this line to prevent clipping */
}
.hero-headline .word-inner {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: revealWord 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes revealWord {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.hero-headline .word:nth-child(1) .word-inner { animation-delay: 0.2s; }
.hero-headline .word:nth-child(2) .word-inner { animation-delay: 0.3s; }
.hero-headline .word:nth-child(3) .word-inner { animation-delay: 0.4s; }
.hero-headline .word:nth-child(4) .word-inner { animation-delay: 0.5s; }
.hero-headline .word:nth-child(5) .word-inner { animation-delay: 0.6s; }

.mouse {
    width: 25px;
    height: 45px;
    border: 2px solid #fff;
    border-radius: 20px;
    position: relative;
    opacity: 0.7;
}
.mouse span {
    width: 3px;
    height: 8px;
    background: #fff;
    border-radius: 4px;
    display: block;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 1.6s ease-in-out infinite;
}
@keyframes scrollWheel {
    0% { top: 8px; opacity: 1; }
    100% { top: 25px; opacity: 0; }
}

/* Section Titles Color */
.section-title {
    color: #3c6027; /* secondary color */
}

/* --- بطاقات الخدمات --- */
.service-card {
    transition: box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.15);
}
.service-card-content {
    flex-grow: 1;
}

/* START: SERVICE TITLE COLOR */
.service-card h3 {
    color: #92c14f;
}
/* END: SERVICE TITLE COLOR */

/* START: WHY US TITLE COLOR */
#why-us .group h3 {
    color: #92c14f;
}
/* END: WHY US TITLE COLOR */


/* --- أزرار سلايدر آراء العملاء --- */
.slider-btn {
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    height: 48px;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    transition: all 0.2s ease-in-out;
}
.slider-btn:hover {
    background-color: #f1f5f9;
    transform: scale(1.1);
}

/* --- زر العودة للأعلى --- */
#back-to-top-btn {
    position: fixed;
    bottom: 20px;
    width: 50px;
    height: 50px;
    background-color: #278361;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 90;
}
html[dir="ltr"] #back-to-top-btn { right: 20px; }
html[dir="rtl"] #back-to-top-btn { left: 20px; }

#back-to-top-btn.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#back-to-top-btn:hover {
    background-color: #156c4a;
    transform: scale(1.1) translateY(-5px);
}

/* --- عناصر الفورم والأيقونات الاجتماعية --- */
.form-input {
    width: 100%;
    background-color: #f8fafc;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: #278361;
    box-shadow: 0 0 0 2px rgba(39, 131, 97, 0.3);
}

.social-icon {
    height: 40px;
    width: 40px;
    background-color: #e2e8f0;
    color: #475569;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.social-icon:hover {
    background-color: #278361;
    color: white;
    transform: translateY(-4px);
}


/* START: TABLET RESPONSIVENESS IMPROVEMENTS */
@media (min-width: 768px) and (max-width: 1023px) {
    section {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    #services .grid, #why-us .grid {
        gap: 2.5rem; /* A slightly larger gap for tablet */
    }
    .section-title {
        font-size: 2.5rem; /* Adjust title size for tablet */
    }
    .hero-section h1 {
        font-size: 3.5rem; /* Adjust hero title size */
    }
}
/* END: TABLET RESPONSIVENESS IMPROVEMENTS */
/* ===== WhatsApp FAB (Bottom-Left) ===== */
.wa-fab{
  position: fixed;
  /* Safe area للموبايلات الحديثة */
  bottom: calc(env(safe-area-inset-bottom, 0) + 20px);
  left: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  /* جراديانت واتساب ناعم */
  background: radial-gradient(120% 120% at 30% 30%, #2fe26e 0%, #25d366 60%, #1ebe5d 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18), 0 6px 12px rgba(0,0,0,0.12);
  z-index: 9999;
  transform: translateZ(0);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

/* لو الصفحة عربي (RTL) خليها يمين */
html[dir="rtl"] .wa-fab {
  left: auto;
  right: 20px;
}
/* نبضة خفيفة حوالين الزر */
.wa-fab .wa-pulse{
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.45);
  animation: wa-pulse 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes wa-pulse{
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.45); }
  70%  { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Hover/Active/Focus states */
.wa-fab:hover{
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 28px rgba(0,0,0,0.22), 0 8px 16px rgba(0,0,0,0.16);
  filter: saturate(115%);
}
.wa-fab:active{
  transform: translateY(0) scale(0.98);
}
.wa-fab:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.9), 0 0 0 6px rgba(37,211,102,0.6);
}

/* Tooltip أنيق فوق الزر */
.wa-fab::after{
  
  position: absolute;
  bottom: 66px; /* فوق الزر */
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(30,41,59,0.92); /* slate-800 شبه شفاف */
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}
.wa-fab:hover::after{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* تصغير بسيط للموبايل */
@media (max-width: 480px){
  .wa-fab{
    width: 52px;
    height: 52px;
    font-size: 24px;
    bottom: calc(env(safe-area-inset-bottom, 0) + 16px);
    left: 16px;
  }
  .wa-fab::after{
    bottom: 60px;
  }
}

/* خيار: إظهار الزر فقط في الموبايل (شغّل لو عايزو موبايل بس) */
/*
@media (min-width: 1024px){
  .wa-fab{ display: none; }
}
*/
