/* Colour palette inspired by OffSec (bright accents on dark backgrounds) */
:root {
  --primary-dark: #0a192f;
  --secondary-dark: #112240;
  --primary-accent: #00bfcf;
  --secondary-accent: #6f00a9;
  --light-text: #e0e8ff;
  --muted-text: #97a4c7;
  --white: #ffffff;
}

/* Base page styling */
body {
  margin: 0;
  font-family: 'Montserrat', 'Roboto', 'Tajawal', 'Cairo', sans-serif;
  line-height: 1.6;
  color: var(--light-text);
  background-color: var(--primary-dark);
  transition: direction 0.3s ease;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* Navigation bar styling */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: rgba(10, 25, 47, 0.95);
  color: var(--light-text);
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 0;
}

.nav-links a {
  color: var(--light-text);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 0.2rem 0.4rem;
}

.nav-links a:hover::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: var(--primary-accent);
}

.lang-toggle {
  background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent));
  border: none;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s;
}

.lang-toggle:hover {
  background: var(--secondary-accent);
}

/* ------------------------------------------------------------------ */
/* Responsive mobile navigation                                         */
/* The menu toggle is hidden on larger screens and only appears on
   screens narrower than 768px. Clicking it toggles the `.open` class
   on the `.nav-links` list. RTL adjustments ensure proper alignment
   for Arabic pages. */

/* Hide the menu toggle by default */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.2rem;
}

@media (max-width: 768px) {
  /* Show the toggle button on small screens */
  .menu-toggle {
    display: block;
  }
  /* Convert nav links into a dropdown panel */
  .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: rgba(10, 25, 47, 0.95);
    flex-direction: column;
    width: 100%;
    text-align: center;
    padding: 1rem 0;
    gap: 1rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    /* Hide by default using max-height and opacity */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
  }
  .nav-links.open {
    max-height: 400px;
    opacity: 1;
  }
  /* Remove default margins for vertical items */
  .nav-links li {
    margin: 0;
  }
  /* Re‑space the logo, toggle, and nav container */
  .navbar .container {
    justify-content: space-between;
  }
  /* RTL: dropdown aligns to the left for Arabic pages */
  body[dir="rtl"] .nav-links {
    right: auto;
    left: 0;
  }
}

/* Section container */
.section {
  padding: 100px 0 80px;
  min-height: 60vh;
  box-sizing: border-box;
}

/* Hero section */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 70vh;
  background-color: var(--primary-dark);
  overflow: hidden;
  perspective: 800px;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('images/hero-bg.png') center/cover no-repeat;
  z-index: -3;
  filter: brightness(0.3);
}

/* Particle canvas overlay */
#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

/* Rotating logo (faint and behind text) */
.hero-logo-3d {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) rotateY(0deg);
  width: 250px;
  opacity: 0.04;
  animation: rotateLogo 20s linear infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes rotateLogo {
  from { transform: translate(-50%, -50%) rotateY(0deg); }
  to   { transform: translate(-50%, -50%) rotateY(360deg); }
}

/* Colourful overlay to separate text from animation */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(0,191,203,0.35), rgba(111,0,169,0.35));
  z-index: -1;
}

.hero-content {
  max-width: 800px;
  position: relative;
  z-index: 1;
  color: var(--white);
  animation: fadeInUp 1s ease-out forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent));
  color: var(--white);
  text-decoration: none;
  border-radius: 30px;
  font-weight: 500;
  transition: background 0.3s, transform 0.2s;
}

.btn:hover {
  background: var(--secondary-accent);
  transform: translateY(-2px);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  cursor: pointer;
}

.scroll-indicator span {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-right: 2px solid var(--primary-accent);
  border-bottom: 2px solid var(--primary-accent);
  transform: rotate(45deg);
}

@keyframes bounce {
  0%,20%,50%,80%,100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-8px); }
  60% { transform: translateX(-50%) translateY(-4px); }
}

@media (max-width: 480px) {
  .scroll-indicator { display: none; }
}

/* About section */
.about {
  background-color: var(--secondary-dark);
}

.about h2,
.services h2,
.contact h2,
.partners h2 {
  margin-bottom: 1.2rem;
  font-size: 2rem;
  color: var(--white);
  text-align: center;
}

.about p {
  font-size: 1rem;
  max-width: 800px;
  margin: auto;
  text-align: center;
  color: var(--light-text);
}

/* Services section */
.services {
  background-color: var(--primary-dark);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  perspective: 1000px;
}

.service-card {
  background-color: var(--secondary-dark);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.4s ease, box-shadow 0.3s;
  transform-style: preserve-3d;
  will-change: transform;
}

.service-card img.service-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 1rem;
  /* The processed icons already use the accent colour and have transparent backgrounds.
     Keep a modest border radius for a softer look but remove additional padding and filters. */
  border-radius: 8px;
}

.service-card i {
  font-size: 2.5rem;
  color: var(--primary-accent);
  margin-bottom: 1rem;
}

.service-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.service-card p {
  font-size: 0.95rem;
  color: var(--light-text);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

/* Partners section */
.partners {
  background-color: var(--primary-dark);
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
  align-items: center;
  justify-items: center;
  margin-top: 2rem;
}

/* Existing partner logo styling */
.partner-logo {
  width: 140px;
  height: auto;
  object-fit: contain;
  transition: transform 0.4s ease;
  filter: brightness(1.15) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.manageengine-logo,
.sophos-logo {
  width: 200px;
}

.partner-logo:hover {
  transform: scale(1.05);
}

/* Contact section */
.contact {
  background-color: var(--secondary-dark);
}

.contact p {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 2rem;
  font-size: 1rem;
  color: var(--light-text);
}

.contact-form {
  max-width: 600px;
  margin: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.2rem;
}

.form-group label {
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: var(--light-text);
}

.form-group input,
.form-group textarea {
  padding: 0.6rem;
  background-color: var(--primary-dark);
  border: 1px solid var(--primary-accent);
  border-radius: 6px;
  font-size: 1rem;
  color: var(--light-text);
  resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--muted-text);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary-accent);
  box-shadow: 0 0 0 2px rgba(111, 0, 169, 0.4);
}

.contact-form .btn {
  width: 100%;
  margin-top: 0.4rem;
}

/* Footer */
.footer {
  background-color: var(--primary-dark);
  color: var(--muted-text);
  text-align: center;
  padding: 1.2rem 0;
}

.footer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted-text);
}

/* Hidden/show classes for scroll reveal */
.hidden {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .nav-links { gap: 0.5rem; }
  .nav-links a { font-size: 0.9rem; }
  .service-card { padding: 1rem; }
}

/* RTL support */
body[dir="rtl"] {
  direction: rtl;
  text-align: right;
  font-family: 'Cairo', sans-serif;
}

body[dir="rtl"] .nav-links {
  flex-direction: row-reverse;
}

body[dir="rtl"] .service-card {
  text-align: right;
}

body[dir="rtl"] .contact-form .btn {
  align-self: flex-end;
}
