/* =========================================================
   Alkafaa Telecom – GLOBAL CSS (FIXED + SAFE)
   Contains: Variables, Base, Layout, Header, Footer,
   Buttons, Language System, Safe Animations
========================================================= */


/* =========================================================
   SECTION: Theme Variables (Colours, Shadows, Transitions)
========================================================= */
:root {
  --primary: #F79633;
  --primary-dark: #d57814;
  --primary-light: #ffae54;
  --secondary: #fbbd6c;
  --accent: #f9b24a;

  --bg: #151515;
  --bg-alt: #1f1f1f;
  --card: #212121;
  --card-soft: #252525;
  --header-bg: rgba(18,18,18,0.96);
  --header-border: rgba(255,255,255,0.06);

  --text-main: #f5f5f5;
  --text-muted: #b0b0b0;

  --light: #f8f9fa;
  --dark: #111;
  --gray: #6c757d;
  --shadow: 0 10px 30px rgba(0,0,0,0.45);
  --transition: all 0.3s ease;
}


/* =========================================================
   SECTION: Base Styles & Typography
========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg);

  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.045) 1px, transparent 0);
  background-size: 22px 22px;

  transition: var(--transition);
  padding-top: 100px; /* fixed header */
}

body.rtl {
  direction: rtl;
  text-align: right;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}


/* =========================================================
   SECTION: Section Structure (FIXED OVERLAY)
========================================================= */
section {
  padding: 80px 0;
  position: relative;
  isolation: isolate; /* prevents stacked overlay conflicts */
}

/* FIXED: Overlay is BELOW content, never above */
section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
      180deg,
      rgba(247, 150, 51, 0.05),
      rgba(0, 0, 0, 0.85)
  );
  z-index: 0; /* FIXED (was -1 which caused hiding issues) */
}

/* Always keep content ABOVE overlay */
section > * {
  position: relative;
  z-index: 1;
}


h1, h2, h3, h4 {
  margin-bottom: 1rem;
  line-height: 1.3;
  color: var(--text-main);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

body.rtl h2::after {
  left: auto;
  right: 50%;
  transform: translateX(50%);
}

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}


/* =========================================================
   SECTION: Buttons
========================================================= */
.btn {
  display: inline-block;
  padding: 12px 30px;
  background: var(--primary);
  color: white;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.7);
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 0 22px rgba(247, 150, 51, 0.7);
}

.btn-accent {
  background: var(--accent);
  color: #111;
}

.btn-accent:hover {
  background: #f7a63d;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.text-center { text-align: center; }


/* =========================================================
   SECTION: Bilingual System
========================================================= */
.english { display: block; }
.arabic { display: none !important; }

body.arabic-lang .english { display: none !important; }
body.arabic-lang .arabic { display: block !important; }


/* =========================================================
   SECTION: Header & Navigation
========================================================= */
header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 12px 30px rgba(0,0,0,0.65);
  z-index: 900;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

header.hide {
  transform: translateY(-100%);
  opacity: 0;
}

.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 5%;
  position: relative;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-left: -40px;
}

.logo { margin-right: 45px; }

body.rtl .logo {
  margin-left: 45px !important;
  margin-right: 0 !important;
}

.logo-img {
  height: 50px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.7));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
}

.nav-links a, .lang-btn {
  text-decoration: none;
  color: #f1f1f1;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  background: none;
  border: none;
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a:hover,
.lang-btn:hover {
  color: var(--primary);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: translateX(-50%);
  transition: width 0.25s ease;
}

.nav-links a:hover::after { width: 60%; }

.lang-btn.active {
  color: var(--primary);
  font-weight: 700;
}

/* Dropdown */
.nav-links .dropdown {
  position: relative;
}

.nav-links .dropdown > a {
  padding-right: 14px;
  padding-bottom: 8px;
}

.dropdown-menu {
  position: absolute;
  top: 100%; left: 0;
  min-width: 240px;
  padding: 10px 0;
  background: rgba(10,10,10,0.98);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 25px 55px rgba(0,0,0,0.8);
}

.nav-links .dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 12px 20px;
  color: #ddd;
}

.dropdown-menu a:hover {
  background: rgba(247,150,51,0.15);
  color: var(--primary-light);
}

body.rtl .dropdown-menu {
  left: auto;
  right: 0;
}


/* Mobile Navigation */
.mobile-menu {
  display: none;
  font-size: 1.8rem;
  color: #fff;
  cursor: pointer;
  position: absolute;
  right: 5%;
}

@media (max-width: 768px) {
  .navbar { justify-content: space-between; }
  .mobile-menu { display: block; }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #0b0b0b;
    position: absolute;
    top: 100%; left: 0;
    padding: 20px 0 30px;
  }

  .nav-links.active {
    display: flex;
  }
}


/* =========================================================
   SECTION: Footer
========================================================= */
footer {
  background: linear-gradient(180deg, #101010, #050505);
  color: white;
  padding: 60px 0 30px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
}

.footer-column h3 {
  color: white;
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }

.footer-links a {
  color: #999;
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary-light);
  padding-left: 5px;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-links a {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--primary);
  transform: translateY(-4px) scale(1.06);
}


/* =========================================================
   SECTION: SAFE GLOBAL ANIMATIONS (FIXED)
========================================================= */

/* FIXED: Elements are visible by default */
.fade-in {
  opacity: 1;
  transform: none;
  transition: all 0.6s ease;
}

/* JS can apply .fade-hidden to animate when needed */
.fade-hidden {
  opacity: 0;
  transform: translateY(30px);
}


/* =========================================================
   MOBILE NAV FIXES + ARABIC MODE
========================================================= */
@media (max-width: 768px) {
  #main-header .navbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 16px !important;
    width: 100% !important;
  }

  .nav-center {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .logo {
    display: flex !important;
    align-items: center !important;
  }

  .logo-img {
    display: block !important;
    max-width: 120px !important;
    height: auto !important;
    object-fit: contain !important;
  }

  .mobile-menu {
    display: block !important;
    margin-left: auto !important;
  }
}

/* Arabic mobile adjustments */
body.arabic-lang .mobile-menu {
  right: auto !important;
  left: 5% !important;
}

body.arabic-lang .navbar {
  flex-direction: row-reverse !important;
}

body.arabic-lang .nav-center {
  flex-direction: row-reverse !important;
  justify-content: space-between !important;
}

body.arabic-lang .logo {
  margin: 0 !important;
  margin-left: auto !important;
}

body.arabic-lang .nav-links {
  text-align: right !important;
}


/* =========================================================
   MOBILE DROPDOWN FIX
========================================================= */
@media (max-width: 768px) {
  .nav-links .dropdown-menu {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    display: none;
  }

  .nav-links .dropdown-menu.active {
    display: block !important;
    margin-top: 6px;
    background: #0d0d0d !important;
    padding: 6px 0 !important;
    border-radius: 8px;
  }

  .nav-links .dropdown-menu a {
    padding: 12px 26px !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.95rem;
    display: block;
  }

  .nav-links .dropdown:hover .dropdown-menu {
    display: none;
  }
}
