/* --- Global Scroll Settings --- */

html {
  scroll-behavior: smooth; /* Makes the jump to section slow/smooth */
  scroll-padding-top: 80px; /* Offsets the fixed navbar height so content isn't hidden */
}

.loader {
  width: 50px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 8px solid;
  border-color: #000 #0000;
  animation: l1 1s infinite;
}
@keyframes l1 {
  to {
    transform: rotate(0.5turn);
  }
}

#preloader {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Preloader fade/hidden state
   - Use the class `loader-hidden` (added by JS) to fade out and hide the preloader.
   - Transition duration should match the JS `fadeDuration` (600ms by default).
*/
#preloader {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* --- Navbar Base Styling --- */
.navbar {
    background-color: #ffffff; /* Solid White (Not transparent) */
    padding: 20px 0; /* Taller initial padding */
    transition: all 0.4s ease-in-out;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Subtle shadow for depth */
    height: 80px;
}

/* Logo Styling */
.navbar-brand img {
    height: 100px; /* Large initial size */
    width: auto;
    transition: height 0.4s ease-in-out;
}

/* --- Nav Links --- */
.navbar-nav .nav-item {
    margin: 0 15px;
}

.navbar-nav .nav-link {
    position: relative;
    color: #767B81; /* Third color (Grey) */
    font-weight: 600;
    transition: color 0.3s ease;
    padding-bottom: 5px;
}

/* Hover and Active States */
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #113746; /* Second color (Dark Blue/Cyan from logo) */
}

/* Underline Animation */
.navbar-nav .nav-link::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #113746; /* Matching Dark Blue */
    transition: width 0.3s ease-in-out;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 100%;
}

/* --- Custom Button (Language/Action) --- */
.btn-custom {
    color: #113746;
    border: 2px solid #113746;
    font-weight: bold;
    transition: all 0.3s ease;
    background-color: transparent;
}
.text-custom {
    color: #767B81;
}
.text-footer {
    color: #ffffff;
}
.btn-footer {
    background-color: #113746;
    color: #ffffff;
}
.btn-custom:hover {
    background-color: #113746;
    color: #ffffff;
}

/* --- Navbar Scrolled State (For JS to toggle) --- */
/* This makes the navbar thin when the class .scrolled is added */
.navbar.scrolled {
    padding: 5px 0; /* Reduced padding */
    box-shadow: 0 4px 20px rgba(0,0,0,0.1); /* Stronger shadow on scroll */
}

.navbar.scrolled .navbar-brand img {
    height: 60px; /* Smaller logo */
}

/* --- Global & Reset --- */
body {
  padding-top: 0; /* إزالة المسافة العلوية لتظهر القائمة فوق الصورة */
}

/* --- Hero Section --- */
#hero {
  width: 100%;
  height: 100vh; /* ملء الشاشة بالكامل */
  /* ضع مسار صورتك هنا */
  background: url('../images/WhatsApp\ Image\ 2025-11-24\ at\ 23.09.22_537bd4fb.jpg') top center no-repeat;
  background-size: cover; /* تغطية كامل المساحة */
  position: relative;
  z-index: 1;
}




/* --- Hero Section Styling --- */
#heroCarousel .carousel-item {
    height: 100vh; /* Full screen height */
    min-height: 500px; /* Fallback for small content */
    background-color: #000; /* Fallback background */
}

/* Fix image view (Cover) */
#heroCarousel .carousel-item img {
    height: 100%;
    width: 100%;
    object-fit: cover; /* This prevents stretching and cropping nicely */
}

/* Dark Overlay for text readability */
#heroCarousel .carousel-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.4); /* 40% opacity black overlay */
}

/* Carousel Caption Styling */
.carousel-caption {
    z-index: 2; /* Sit on top of overlay */
    bottom: 30%; /* Move up from bottom */
}

.carousel-caption h5 {
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.carousel-caption .btn-primary {
    background-color: #113746;
    border-color: #113746;
}

.carousel-caption .btn-primary:hover {
    background-color: #0d2a36;
    border-color: #0d2a36;
}
/* --- About Section Custom Styles --- */

/* Letter spacing for the small sub-heading */
.ls-2 {
  letter-spacing: 2px;
}

/* Animation Base */
.animate-left,
.animate-right {
  opacity: 0; /* Hidden initially */
  animation-duration: 1s;
  animation-fill-mode: forwards; /* Keeps the element visible after animation ends */
}



/* --- Directional Scroll Animations --- */

/* 1. Slide from Left (Text) */
.scroll-left {
  opacity: 0;
  transform: translateX(-100px); /* Start 100px to the left */
  transition: all 1s ease-out;
}

/* 2. Slide from Right (Image) */
.scroll-right {
  opacity: 0;
  transform: translateX(100px); /* Start 100px to the right */
  transition: all 1s ease-out;
}

/* 3. The Active State (Triggered by JS) */
.scroll-left.show,
.scroll-right.show {
  opacity: 1;
  transform: translateX(0); /* Move to original position */
}
/* 1. Hover Effect */
.project-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

/* 2. Image Handling */
/* This ensures the image covers the entire right column area */
.project-img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  min-height: 200px; /* Ensures image doesn't disappear if text is very short */
}
/* --- Scroll Animation Styles --- */

/* Initial State: Hidden and pushed down */
.scroll-hidden {
  opacity: 0;
  transform: translateY(50px); /* Starts 50px lower */
  transition: all 0.8s ease-out; /* Smooth transition duration */
}

/* Active State: Visible and back to original position */
.scroll-hidden.show {
  opacity: 1;
  transform: translateY(0);
}

/* Optional: Stagger Effect 
   This makes the second item in a row wait 0.2s before showing up. 
   It creates a nice 'wave' effect. */
.scroll-hidden:nth-child(even) {
  transition-delay: 0.2s;
}
/* --- Contact Section Styles --- */

/* Style for the small icon container next to the text */
.icon-box {
  width: 50px;
  height: 50px;
  background-color: rgba(13, 110, 253, 0.1); /* Light transparent blue */
  border-radius: 50%; /* Makes it a circle */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* Prevents circle from squashing if text is long */
}

/* Form Floating Label tweaks (Optional, just makes it cleaner) */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: #113746; /* Blue color when active */
  opacity: 1;
}

.form-control:focus {
  border-color: #113746;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}
/* --- Footer Custom Styles --- */

/* 1. Footer Links (Hover Effect) */
.footer-link {
  color: rgba(255, 255, 255, 0.6); /* Text is slightly grey */
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

.footer-link:hover {
  color: #fff; /* Turns bright white */
  padding-left: 5px; /* Slides slightly to the right */
}

/* 2. Social Icons (Circle Background) */
.social-icon {
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%; /* Makes it a circle */
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background-color: #113746; /* Turns blue on hover */
  color: white;
  transform: translateY(-3px); /* Floats up slightly */
}
/* ... (Keep your existing CSS above this) ... */

/* =========================================
   MOBILE VIEW CUSTOMIZATION (Max Width 991px)
   ========================================= */
@media (max-width: 991px) {
  
  /* --- Navbar Mobile Tweaks --- */
  .navbar {
    background-color: #ffffff; /* Ensures the bar behind logo/hamburger is white */
    padding: 10px 15px; /* Standard mobile padding */
    /* Optional: Add a shadow so it separates from the hero section */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
  }

  .navbar-brand img {
    height: 50px; /* Slightly smaller to save vertical space */
    width: auto;
  }

  .navbar-toggler {
    border: none;
    padding: 0;
    outline: none;
  }
  
  .navbar-toggler:focus {
    box-shadow: none;
  }

  /* The Dropdown Menu Area */
  .navbar-collapse {
    background-color: #ffffff; /* Background for the opened menu */
    margin-top: 10px; /* Reduced from 15px */
    padding-bottom: 20px;
    /* Removed the border-radius/shadow for a cleaner "full" look, 
       but you can keep them if you prefer the card look */
    border-top: 1px solid #f0f0f0; 
  }

  .navbar-nav {
    text-align: center;
    margin-bottom: 15px;
  }

  .navbar-nav .nav-item {
    margin: 5px 0; /* Reduced spacing to fit more content */
  }

  /* SCOPED the flex fix so it doesn't break other parts of the site */
  .navbar .d-flex {
    justify-content: center;
    width: 100%;
  }

  /* --- Hero Section Mobile Tweaks --- */
  #hero {
    /* Drastically reduced top spacing so headlines are visible immediately */
    margin-top: 80px; 
    padding: 30px 20px; /* Added side padding so text doesn't touch screen edges */
    text-align: center;
    overflow: hidden; /* Prevents horizontal scroll bars */
  }

  #hero h1 {
    font-size: 2rem; /* Reduced from 2.5rem to fit mobile screens better */
    line-height: 1.3;
    margin-bottom: 15px;
    word-wrap: break-word; /* Ensures long words don't overflow */
  }

  #hero .lead {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  /* Stack order */
  .hero-content {
    flex-direction: column-reverse;
  }
  
  /* Ensure hero image doesn't overflow */
  .hero-content img {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
  }
}