/* ==========================================
   AL-KHATIB CONSTRUCTION (الخطيب للإعمار)
   Design System & Shared Application Styles
   ========================================== */

/* Noto Kufi Arabic Local Font Definition */
@font-face {
  font-family: 'Noto Kufi Arabic';
  src: url('../fonts/Noto_Kufi_Arabic/NotoKufiArabic-VariableFont_wght.ttf') format('truetype-variations'),
       url('../fonts/Noto_Kufi_Arabic/NotoKufiArabic-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Global Reset & Typography Baseline */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Kufi Arabic', sans-serif;
  background-color: #f8f9fa;
  color: #191c1d;
  -webkit-font-smoothing: antialiased;
}

.font-mono {
  font-family: 'Noto Kufi Arabic', sans-serif;
}

/* Material Symbols Icon Font Override */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

/* Engineering Blueprint Background Grid (Dark Overlay Pattern) */
.bg-grid-pattern {
  background-image: linear-gradient(to right, rgba(193, 199, 210, 0.15) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(193, 199, 210, 0.15) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Engineering Blueprint Background Grid (Light Blue Pattern for White Canvas) */
.bg-grid-pattern-light {
  background-image: linear-gradient(to right, rgba(0, 88, 150, 0.08) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(0, 88, 150, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Custom RTL Form Inputs & Select Dropdown Arrow Positioning */
input[type="tel"] {
  direction: ltr !important;
  text-align: left !important;
  font-family: inherit;
}

input[type="tel"]::placeholder {
  direction: rtl !important;
  text-align: right !important;
}

select.custom-select-rtl {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23005896'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.85rem center;
  background-size: 1.25rem;
  padding-left: 2.5rem !important;
  padding-right: 1rem !important;
}

/* ==========================================
   STATE-OF-THE-ART PAGE LOADER SYSTEM
   ========================================== */

#page-loader {
  transition: opacity 650ms cubic-bezier(0.16, 1, 0.3, 1), visibility 650ms cubic-bezier(0.16, 1, 0.3, 1);
}

#page-loader.loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes spinClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinCounterClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

@keyframes logoPulseAura {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 4px 12px rgba(0, 88, 150, 0.15));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 8px 24px rgba(0, 88, 150, 0.3));
  }
}

.loader-ring-outer {
  animation: spinClockwise 12s linear infinite;
}

.loader-ring-inner {
  animation: spinCounterClockwise 8s linear infinite;
}

.loader-logo-animated {
  animation: logoPulseAura 2.5s ease-in-out infinite;
}

/* ==========================================
   MOTION SYSTEM & ANIMATIONS (Architectural)
   ========================================== */

:root {
  --ease-out-architectural: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Card & Interactive Micro-Interactions */
.project-card, .project-item {
  transition: transform 350ms var(--ease-out-architectural), box-shadow 350ms var(--ease-out-architectural), border-color 300ms ease;
}

.project-card:hover, .project-item:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 88, 150, 0.5);
  box-shadow: 0 16px 36px -10px rgba(0, 88, 150, 0.15);
}

/* Modal Reveal Entrance & Exit */
#project-modal {
  transition: opacity 300ms var(--ease-out-architectural);
}

#project-modal > div {
  transition: transform 300ms var(--ease-out-architectural), opacity 300ms var(--ease-out-architectural);
}

#project-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

#project-modal.hidden > div {
  transform: scale(0.96) translateY(16px);
  opacity: 0;
}

/* Scroll Reveal Animation Classes */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms var(--ease-out-architectural), transform 700ms var(--ease-out-architectural);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Laser Scanner Line Animation for Aerial Drone Section */
@keyframes laserScan {
  0% {
    top: 0%;
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0.2;
  }
}

.drone-scanner-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #005896, #ffffff, #005896, transparent);
  box-shadow: 0 0 12px #005896;
  animation: laserScan 4.5s var(--ease-in-out-smooth) infinite alternate;
  pointer-events: none;
}

/* Accessibility: Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll,
  .project-card,
  .project-item,
  #project-modal,
  #project-modal > div,
  #page-loader {
    transition: none !important;
    transform: none !important;
    animation: none !important;
    opacity: 1 !important;
  }
  .drone-scanner-line,
  .loader-ring-outer,
  .loader-ring-inner,
  .loader-logo-animated {
    animation: none !important;
  }
}
