/* Universal Box-Sizing for predictable layout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* === 1. General & Root Styles === */
/* ... the rest of your css code ... */
/* === 1. General & Root Styles === */

html {
  scroll-behavior: smooth;
}

:root {
  /* Night Mode (Default) - Galaxy Theme */
  --bg-color: #0a0e1a;
  --header-bg: transparent;
  --header-border-color: rgba(139, 92, 246, 0.3);
  --text-primary: #ffffff;
  --text-muted: #bdc3c7;
  --card-bg: #ffffff;
  --card-text: #333;
  --button-bg: rgba(124, 58, 237, 0.15);
  --button-border: rgba(139, 92, 246, 0.4);
  --button-hover: rgba(167, 139, 250, 0.25);
  --link-color: #8b5cf6;
  --glow-color: rgba(124, 58, 237, 0.2);
  --icon-color: #ffffff;
  --input-bg: rgba(255,255,255,0.05);
  --input-border: rgba(255,255,255,0.2);
  --input-text: #ffffff;
  --section-bg: #111827;
  --section-title-color: #ffffff;
  --section-text-color: #bdc3c7;
  --footer-bg: #0a0e1a;
  --footer-text: #a0aec0;
  --footer-title: #ffffff;
  --footer-border: rgba(255,255,255,0.1);
}

body.light-mode {
  /* Day Mode */
  --bg-color: #f4f8ff;
  --header-bg: rgba(255, 255, 255, 0.8);
  --header-border-color: #dee2e6;
  --text-primary: #212529;
  --text-muted: #6c757d;
  --card-bg: #ffffff;
  --card-text: #333;
  --button-bg: #f8f9fa;
  --button-border: #dee2e6;
  --button-hover: #e9ecef;
  --link-color: #007BFF;
  --glow-color: rgba(0, 123, 255, 0.08);
  --icon-color: #212529;
  --input-bg: #ffffff;
  --input-border: #ced4da;
  --input-text: #495057;
  --section-bg: #ffffff;
  --section-title-color: #212529;
  --section-text-color: #6c757d;
  --footer-bg: #f8f9fa;
  --footer-text: #6c757d;
  --footer-title: #212529;
  --footer-border: #e9ecef;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#vanta-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* === 2. Header & Navigation === */
header {
  background-color: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  padding: 2.5rem 2rem 1.5rem 2rem;
  display: flex;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--header-border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.logo {
  flex: 1;
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}

nav {
  flex: 2;
  display: flex;
  justify-content: center;
}

.header-controls {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.5rem;
  position: relative;
}

nav a:hover {
  color: #c4b5fd;
  text-shadow: 0 0 15px rgba(196, 181, 253, 0.7);
}

nav a .icon {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background-color: var(--icon-color);
  opacity: 0;
  transition: all 0.3s ease;
  mask-size: contain;
  -webkit-mask-size: contain;
}

nav a:hover .icon {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

nav a::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: var(--icon-color);
  bottom: 0;
  left: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease-out;
}

nav a:hover::after {
  transform: scaleX(1);
}

/* === 3. Header Controls: Language & Theme === */
.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.lang-switcher {
  position: relative;
}

.lang-current {
  background-color: transparent;
  border: 1px solid var(--header-border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.lang-current:hover {
  background-color: var(--button-hover);
}

.lang-icon {
  stroke: var(--text-primary);
}

.lang-dropdown {
  position: absolute;
  top: 130%;
  right: 0;
  background-color: var(--bg-color);
  border: 1px solid var(--header-border-color);
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  z-index: 1100;
  min-width: 120px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.lang-switcher.active .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.lang-option:hover,
.lang-option.active {
  background-color: var(--button-hover);
  color: var(--text-primary);
}

.theme-switch-wrapper {
  display: flex;
  align-items: center;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232c3e50' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'></path></svg>");
  background-repeat: no-repeat;
  background-position: center;
}

input:checked + .slider {
  background-color: var(--link-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231a2533' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='5'></circle><line x1='12' y1='1' x2='12' y2='3'></line><line x1='12' y1='21' x2='12' y2='23'></line><line x1='4.22' y1='4.22' x2='5.64' y2='5.64'></line><line x1='18.36' y1='18.36' x2='19.78' y2='19.78'></line><line x1='1' y1='12' x2='3' y2='12'></line><line x1='21' y1='12' x2='23' y2='12'></line><line x1='4.22' y1='19.78' x2='5.64' y2='18.36'></line><line x1='18.36' y1='5.64' x2='19.78' y2='4.22'></line></svg>");
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* === 4. Backgrounds, Layout & Titles === */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background-color: var(--bg-color);
  transition: background-color 0.3s ease;
}

body.light-mode #particles-js {
  background-color: var(--bg-color);
}

.interactive-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: radial-gradient(600px at 50% 50%, var(--glow-color), transparent 80%);
  z-index: -1;
  pointer-events: none;
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  text-align: center;
}

.section-title, .page-title {
  color: var(--text-primary);
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
}

.section-subtitle, .page-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 300;
  max-width: 600px;
  margin: 0.5rem auto 3rem auto;
}

main.content-wrapper {
  position: relative;
  z-index: 1;
}

/* === 5. Hero Section (Home Page) === */
.hero {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  pointer-events: none;
  padding: 28vh 0;
}

.hero-content {
  pointer-events: auto;
  max-width: 800px;
  padding: 2.5rem 3rem;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.light-mode .hero-content {
  background-color: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.1);
}

.hero-title {
  font-size: 3.0rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 300;
  max-width: 650px;
  margin: 0 auto 1.5rem auto; /* Adjusted margin for the new button group */
}

/* Container for both hero buttons */
.hero-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Allows buttons to stack on smaller screens if needed */
    gap: 1.5rem; /* Space between the two buttons */
    margin-top: 2rem;
}

.cta-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  background-color: var(--link-color);
  border: 2px solid var(--link-color);
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  align-self: center;
}

.cta-button:hover {
  background-color: transparent;
  color: var(--link-color);
  border-color: var(--link-color);
  transform: translateY(-3px);
}

/* Style for the new secondary button */
.cta-button.secondary {
    background-color: transparent;
    color: #ffffff; /* White text for contrast on dark bg */
    border-color: rgba(255, 255, 255, 0.5); /* Semi-transparent border */
}

.cta-button.secondary:hover {
    background-color: white;
    color: var(--bg-color); /* Dark text on hover */
    border-color: white;
}

/* Adjustments for light mode */
body.light-mode .cta-button.secondary {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

body.light-mode .cta-button.secondary:hover {
    background-color: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

/* === 6. Combined Section (Home Page) - WIDENED LAYOUT === */
.combined-section {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  z-index: 1;
  overflow: hidden;
  padding: 1px 0;
  color: #e6e6e6;
}

#star-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.combined-section .page-container {
  position: relative;
  z-index: 1;

  /* 
    KEY FIX: We are making THIS SPECIFIC container wider.
    Instead of 1200px, it can now be up to 1500px.
    This gives the cards inside room to spread out.
  */
  max-width: 1500px;
}

.combined-section .section-title, .combined-section .section-subtitle {
  color: var(--section-title-color);
}

.section-intro {
  max-width: 800px;
  margin: 0 auto 4rem auto;
  text-align: center;
}

.values-grid-inline {
  display: grid;
  
  /* Now this rule will work, because the container is wider */
  grid-template-columns: repeat(4, 1fr);
  
  gap: 3rem; /* A good gap for this new wide layout */
  margin-bottom: 3rem;
}

.value-card-inline {
  text-align: center;
  padding: 2rem;
  background-color: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.value-card-inline:hover {
  transform: translateY(-10px);
  background-color: var(--button-hover);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.value-card-inline .value-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 1.5rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--link-color);
  border-radius: 50%;
  color: var(--link-color);
}

.value-card-inline .value-icon svg {
  stroke: var(--link-color);
}

.value-card-inline h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
}

body.light-mode .value-card-inline h3 {
  color: var(--card-text);
}

.value-card-inline p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

body:not(.light-mode) .value-card-inline {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.1);
}

/* Make it responsive */
@media (max-width: 1200px) {
  .values-grid-inline {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .values-grid-inline {
    grid-template-columns: 1fr;
  }
}



/* === 7. Partners Page === */
.filter-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.tab-button {
  background-color: var(--button-bg);
  color: var(--text-primary);
  border: 1px solid var(--button-border);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-button:hover {
  background-color: var(--button-hover);
}

.tab-button.active {
  background-color: var(--link-color);
  color: white;
  border-color: var(--link-color);
}

.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.partner-link {
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
}

.partner-link.hide {
  transform: scale(0.8);
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  padding: 0;
  margin: -0.75rem;
  overflow: hidden;
}

.partner-card {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 1px solid var(--card-border-color);
}

.partner-link:hover .partner-card {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.partner-card img {
  max-height: 60px;
  max-width: 140px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.partner-card h3 {
  color: var(--card-text);
  font-size: 0.9rem;
}

/* Make Magnet Forensics logo larger */
.partner-card img[alt="Magnet Forensics"] {
  transform: scale(1.5);
  margin: 1.5rem 0;
}

/* Make Oxygen Forensics logo larger */
.partner-card img[alt="Oxygen Forensics"] {
  transform: scale(3.5);
  margin: 2.5rem 0;
}

/* Make all partner logos larger except specific ones */
.partner-card img:not([alt="Chuwi"]):not([alt*="SIYI"]):not([alt="Magnet Forensics"]) {
  transform: scale(1.4);
  margin: 1.5rem 0; /* Add more vertical space to accommodate larger logo */
  font-weight: 500;
}

/* === 8. About Us Page (New) === */
.about-page .page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.about-intro {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem auto;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.about-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.about-section-card {
  background-color: var(--card-bg-color);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: left;
}

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

.about-section-card .section-title {
  font-size: 1.75rem;
  color: var(--primary-accent-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-accent-color);
  display: inline-block;
}

.about-section-card .section-title .fas,
.about-section-card .activities-list h3 .fas {
  margin-right: 0.8rem;
  color: #fff;
  width: 24px; /* Fixed width for alignment */
  text-align: center;
}

.about-section-card .activities-list h3 {
  display: flex;
  align-items: center;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.about-section-card p {
    line-height: 1.6;
    color: var(--text-secondary);
}

.about-section-card .activities-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.about-section-card .activities-list li {
    margin-bottom: 1.5rem;
}

.about-section-card .activities-list li:last-child {
    margin-bottom: 0;
}

.about-section-card .activities-list h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* Ensure the footer is at the bottom */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper {
    flex: 1;
}



/* === 9. Partners Page === */
.partners-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  width: 100%;
}

.partner-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 8px;
  width: 200px;
  margin: 0;
}

.partner-card img {
  max-width: 120px;
  max-height: 60px;
  margin-bottom: 1rem;
  object-fit: contain;
}

.partner-card h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--card-text);
}

/* === 10. Contact Page === */
.contact-form {
  max-width: 700px;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  position: relative;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 1rem;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--input-text);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--link-color);
  outline: none;
}

.form-group label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s ease;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label,
.form-group select:focus + label,
.form-group select:not([value=""]) + label {
  top: -0.75rem;
  left: 0.75rem;
  font-size: 0.8rem;
  color: var(--link-color);
  background-color: var(--bg-color);
  padding: 0 0.25rem;
}

/* === 10. Footer === */
.site-footer {
  position: relative;
  z-index: 1;
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 4rem 2rem 2rem;
  margin-top: auto;
  border-top: 1px solid var(--footer-border);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--footer-border);
}

.footer-column .footer-logo {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--footer-title);
  margin-bottom: 1rem;
}

.footer-column p,
.footer-column li {
  font-size: 0.95rem;
  line-height: 1.8;
}

.footer-column a {
  color: var(--footer-text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-column a:hover {
  color: var(--link-color);
}

.footer-column h4 {
  font-size: 1rem;
  font-weight: bold;
  color: var(--footer-title);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column ul li {
  margin-bottom: 0.75rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
}

.footer-bottom p {
  font-size: 0.9rem;
  margin: 0;
}

body:not(.light-mode) .footer-container {
  color: #bdc3c7;
}

body.light-mode .site-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

body.light-mode .footer-column a {
  color: var(--text-muted);
}

body.light-mode .footer-column a:hover {
  color: var(--text-primary);
}

/* === 11. Nav SVG Icons === */
/* Navigation Icons */
.icon-home {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8h5z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8h5z"/></svg>');
}
.icon-domains {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-1.46.4-2.83 1.08-4l3.5 3.5c.28.28.44.66.44 1.06V16h1.5v3.18C7.07 18.45 4 15.54 4 12zm12 6.5c-1.24 0-2.25-1.01-2.25-2.25S14.76 14 16 14s2.25 1.01 2.25 2.25S17.24 18.5 16 18.5z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-1.46.4-2.83 1.08-4l3.5 3.5c.28.28.44.66.44 1.06V16h1.5v3.18C7.07 18.45 4 15.54 4 12zm12 6.5c-1.24 0-2.25-1.01-2.25-2.25S14.76 14 16 14s2.25 1.01 2.25 2.25S17.24 18.5 16 18.5z"/></svg>');
}
.icon-partners {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 11c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V18h14v-1.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V18h6v-1.5c0-2.33-4.67-3.5-7-3.5z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 11c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zm-8 0c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V18h14v-1.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V18h6v-1.5c0-2.33-4.67-3.5-7-3.5z"/></svg>');
}
.icon-about {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/></svg>');
}
.icon-contact {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"/></svg>');
}
/* UPDATED: Theodolite / Total Station Icon */
.icon-products {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8L12 18"></path><path d="M10 20L14 20"></path><path d="M12 4L12 4"></path><path d="M8 8L16 8"></path><path d="M7 13L17 13"></path><path d="M7 16L17 16"></path><path d="M16 4L19 2"></path><path d="M8 4L5 2"></path></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8L12 18"></path><path d="M10 20L14 20"></path><path d="M12 4L12 4"></path><path d="M8 8L16 8"></path><path d="M7 13L17 13"></path><path d="M7 16L17 16"></path><path d="M16 4L19 2"></path><path d="M8 4L5 2"></path></svg>');
}


/* === Contact Page Layout === */
.contact-page-layout {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.contact-form-container {
    flex: 1;
    padding: 2rem;
    background: var(--section-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.vertical-divider {
    width: 1px;
    background: var(--text-muted);
    opacity: 0.2;
    margin: 1rem 0;
}

.map-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.map-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.map-wrapper {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.address-info {
    padding: 1.5rem;
    background: var(--section-bg);
    border-radius: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.address-info p {
    margin: 0.5rem 0;
}

.address-info strong {
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 992px) {
    .contact-page-layout {
        flex-direction: column;
    }
    
    .vertical-divider {
        width: 100%;
        height: 1px;
        margin: 1.5rem 0;
    }
    
    .map-wrapper iframe {
        min-height: 300px;
    }
}

/* === 12. Domains Section (FINAL CLEAN LAYOUT - UPSCALED) === */
.domains-section {
  background-color: var(--bg-color);
  padding: 3rem 2rem; /* Reduced vertical padding */
}

body.light-mode .domains-section {
  background-color: var(--bg-color);
}

.domains-section .section-intro {
  margin-bottom: 5rem; /* Increased margin */
}

.domains-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4rem; /* I slightly reduced the gap for a better balance with the new width */

  /* 
    KEY CHANGE: The grid will now occupy 90% of the page width.
    This ensures it expands on larger screens while leaving a small 5% margin
    on each side, which looks very professional.
  */
  width: 100%; 
  max-width: 1800px; /* An upper limit just in case */
  margin: auto;
}

.domain-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--header-border-color);
  transition: all 0.3s ease-in-out;
}

.domain-card:hover {
    transform: translateY(-15px); /* More lift on hover */
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    border-color: var(--link-color);
}

.domain-card img {
  /* UPDATED: Increased image height to make the card much larger */
  /* This value is arbitrary, based on the overall height we want */
  height: 350px; 
  width: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.domain-card:hover img {
    transform: scale(1.05);
}

.domain-card-title-area {
  flex-grow: 1; 
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem; /* More padding in the text area */
}

.domain-card h3 {
  margin: 0;
  color: var(--text-muted);

  /* UPDATED: Larger font to match bigger card */
  font-size: 1.8rem; 
  
  font-weight: 500;
  transition: color 0.3s ease;
}

.domain-card:hover h3 {
    color: var(--text-primary);
}


/* Responsive rules for mobile */
@media (max-width: 992px) {
  .domains-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* Domains Page Styles */
.domains-container {
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.domains-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.domain-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.domain-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--link-color);
}

.domain-card h3 {
    color: var(--link-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.domain-card p {
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 1rem;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .domains-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
}

/* === 13. Modal Styles === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s 0.3s ease;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.modal-content {
  background-color: var(--section-bg);
  border-radius: 12px;
  max-width: 90vw;
  width: 1000px;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  display: flex;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  border: 1px solid var(--header-border-color);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  font-size: 24px;
  line-height: 35px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
}

.modal-close:hover {
  background: rgba(255,0,0,0.8);
  transform: scale(1.1);
}

.modal-body {
  display: flex;
  width: 100%;
  height: 100%;
  max-height: 90vh;
}

.modal-body img {
  width: 55%;
  object-fit: cover;
  flex-shrink: 0;
}

.modal-text {
  padding: 2.5rem;
  overflow-y: auto;
  color: var(--text-muted);
}

.modal-text h2 {
  color: var(--text-primary);
  font-size: 2.2rem;
  margin: 0 0 1.5rem 0;
}

.modal-text h4 {
  color: var(--link-color);
  font-size: 1.1rem;
  margin: 2rem 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-text p {
  line-height: 1.7;
  font-size: 1rem;
  margin: 0;
}

body.modal-open {
  overflow: hidden; /* Prevent scrolling background when modal is open */
}

/* === 14. Location Section (NEW) === */
.location-section {
    background-color: var(--bg-color);
    padding: 1px 0; /* Prevents margin collapse */
}
.location-section .page-container {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.location-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: center;
    text-align: left;
}

.location-text-content .section-title {
    text-align: left;
    margin-bottom: 1.5rem;
}

.location-address {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.location-text-content .cta-button {
    align-self: flex-start;
}

.location-map-content {
    height: 450px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid var(--header-border-color);
}

.location-map-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}
/* This CSS trick makes the Google Map dark to match the theme */
body:not(.light-mode) .location-map-content iframe {
    filter: invert(100%) hue-rotate(180deg) contrast(90%);
}

/* === 15. Responsive & Mobile Styles (UPDATED) === */
@media (max-width: 992px) {
  nav { display: none; } /* Temporary fix for mobile menu */
  header { padding: 1.5rem; justify-content: space-between; }
  .logo { margin-right: auto; }

  .location-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .location-text-content .section-title {
      text-align: center;
  }
  .location-text-content .cta-button {
      align-self: center;
  }
  .location-map-content {
      margin-top: 2rem;
      height: 350px;
  }
}

@media (max-width: 768px) {
  .hero-content { padding: 1.5rem; }
  .hero-title { font-size: 2.2rem; }
  .section-title, .page-title { font-size: 2rem; }
  
  .values-grid-inline, .domains-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-body {
    flex-direction: column;
  }
  .modal-body img {
    width: 100%;
    height: 40%;
    max-height: 250px;
  }
  .modal-text {
    padding: 1.5rem;
  }
  .modal-text h2 {
    font-size: 1.8rem;
  }
}
/* === 16. Legal Pages Layout (Privacy & Terms) === */
.legal-page-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    color: var(--text-muted);
}

.legal-page-content .page-title {
    text-align: center;
}

.legal-page-content .legal-last-updated {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    margin-top: -2.5rem;
    margin-bottom: 3rem;
}

.legal-page-content h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    /* REMOVED: border-bottom: 1px solid var(--header-border-color); */
    padding-bottom: 0.5rem;
}

.legal-page-content p {
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.legal-page-content a {
    color: var(--link-color);
    text-decoration: underline;
}
/* === 17. Legal Pages Enhancements === */
.legal-page-content .page-title {
    /* FIX: Adds space below the main title */
    margin-bottom: 1.5rem; 
}

.legal-page-content .legal-last-updated {
    /* FIX: Removed negative margin that caused the overlap */
    margin-top: 0;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* NEW: Styling for the back button */
.back-button {
    display: inline-flex; /* Use flexbox for alignment */
    align-items: center;
    gap: 0.5rem; /* Space between icon and text */
    text-decoration: none;
    color: var(--link-color);
    border: 1px solid var(--button-border);
    background-color: var(--button-bg);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 500;
    margin-bottom: 1.5rem; /* Space between button and last-updated text */
    transition: all 0.3s ease;
    
    /* Center the button */
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.back-button:hover {
    background-color: var(--link-color);
    border-color: var(--link-color);
    color: white;
}

.back-button svg {
    transition: transform 0.3s ease;
}

.back-button:hover svg {
    transform: translateX(-3px);
}

/* === 18. Products Page Layout (ULTRA-WIDE & FINAL FIX) === */

.products-page .page-container .page-title,
.products-page .page-container .page-subtitle {
    /* Keep titles centered within a normal width */
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* This is the new wrapper we added */
.product-grid-wrapper {
    width: 100%;
    /* Create the small side margins directly on the wrapper */
    padding: 0 3rem; 
}

.product-categories-grid {
    display: grid;
    /* Divide the space into 3 equal, stretching columns */
    grid-template-columns: repeat(3, 1fr);
    /* Large gap between the stretched cards */
    gap: 5rem; 
    margin-top: 4rem;
    width: 100%; /* Ensure grid takes full width of the wrapper */
}

/* Responsive rules for tablets and phones */
@media (max-width: 1200px) {
    .product-grid-wrapper {
        padding: 0 1.5rem; /* Reduce side margins on smaller screens */
    }
    .product-categories-grid {
        grid-template-columns: 1fr; /* Stack into a single column */
        gap: 2.5rem;
    }
}


/* --- Card styling below ensures they look good when large --- */

.category-card {
    background-color: var(--section-bg);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--header-border-color);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none; /* This will remove the underline from all text inside the card */
}

.category-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 45px rgba(0,0,0,0.2);
}

.category-card-header {
    height: 280px;
    overflow: hidden;
}

.category-card-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.category-card:hover .category-card-header img {
    transform: scale(1.1);
}

.category-card-body {
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.category-card-body h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    text-align: center;
}

.category-card-body p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
    flex-grow: 1;
    text-align: center;
    margin-bottom: 2rem;
}

.category-card-body .cta-button {
    margin-top: auto;
    align-self: center;
    background: transparent; color: var(--link-color); border: 2px solid var(--link-color); font-weight: 600; padding: 1rem 2.5rem; font-size: 1.1rem; border-radius: 50px; text-decoration: none; transition: all 0.3s ease-in-out;
}

.category-card-body .cta-button:hover {
    background: var(--link-color); color: white; box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4); transform: translateY(-2px);
}
/* ===== تعديلات لتكبير بطاقات المنتجات ===== */

/* 1. زيادة عرض الشبكة بتقليل الهوامش الجانبية */
.product-grid-wrapper {
    padding: 0 1.5rem; /* كانت 3rem */
}

/* 2. زيادة ارتفاع الصورة وهو ما يزيد ارتفاع البطاقة بشكل عام */
.category-card-header {
    height: 380px; /* كانت 280px */
}

/* 3. زيادة الهوامش الداخلية في قسم النص ليتناسب مع الحجم الجديد */
.category-card-body {
    padding: 3rem 2rem; /* كانت 2.5rem 2rem */
}

/* 4. تكبير حجم خط العنوان */
.category-card-body h2 {
    font-size: 2.2rem; /* كانت 2rem */
}

/* 5. تكبير حجم خط الوصف */
.category-card-body p {
    font-size: 1.2rem; /* كانت 1.1rem */
}
/* ===== تعديل جديد: بطاقات أعرض وأقصر (تملأ الشاشة) ===== */

/* 1. جعل الحاوية الرئيسية تشغل عرض الشاشة بالكامل تقريبًا */
.product-grid-wrapper {
    padding: 0 0rem; /* كانت 3rem - قلّلنا الهامش الجانبي كثيرًا */
}

/* 2. تقليل المسافة بين البطاقات لتوفير مساحة أكبر لها */
.product-categories-grid {
    gap: 1.2rem; /* كانت 5rem */
}

/* Custom Background Styles */
.custom-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: #0a0e1a; /* Dark background color */
}

.custom-bg canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Downward arrow for navigation */
.nav-links a .arrow-down {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.6em;
  vertical-align: middle;
  transition: transform 0.2s ease;
  opacity: 0.7;
  line-height: 1;
  position: relative;
  top: -0.5px;
}

.nav-links a:hover .arrow-down {
  opacity: 1;
  transform: translateY(1px);
}

/* Ensure content is above the background */
.content-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* 3. تقليل ارتفاع الصورة لجعل البطاقة أقصر بشكل ملحوظ */
.category-card-header {
    height: 220px; /* كانت 280px - الآن أقصر */
}

/* 4. تعديل بسيط في هوامش النص ليتناسب مع الارتفاع الجديد */
.category-card-body {
    padding: 2rem;
}

/* === Product Category Page System === */

.product-filter-container {
  margin-top: 3rem;
  width: 100%;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  border-bottom: 1px solid var(--header-border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
}

.category-tab {
  background-color: var(--button-bg);
  border: 1px solid var(--button-border);
  color: var(--text-muted);
  padding: 0.8rem 1.8rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-tab:hover {
  background-color: var(--button-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.category-tab.active {
  background-color: var(--link-color);
  color: white;
  border-color: var(--link-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.product-list {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  min-height: 200px; /* يعطي ارتفاعًا للمناطق الفارغة */
}

.product-list.active {
  display: grid;
}

.product-card {
  background-color: var(--section-bg);
  border: 1px solid var(--header-border-color);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.product-card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  margin-bottom: 1.5rem;
  background-color: rgba(255,255,255,0.05); /* لون خلفية خفيف لمكان الصورة */
  border-radius: 8px;
}

.product-card h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.product-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.product-card a {
  display: inline-block;
  text-decoration: none;
  color: var(--link-color);
  border: 1px solid var(--link-color);
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-weight: 500;
  margin-top: auto;
  transition: all 0.3s ease;
}

.product-card a:hover {
  background-color: var(--link-color);
  color: white;
}
/* === NEW Geospatial Product Page Layout === */

/* --- 1. Category Grid (the visible cards) --- */
/* === NEW Geospatial Product Page Layout (Corrected Centering) === */

/* --- 1. Category Grid (the visible cards) --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.category-grid-card {
    background-color: var(--section-bg);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

/* --- هنا يتم تحقيق التوسيط المطلوب للصف الثاني --- */
.category-grid-card:nth-child(4) {
    /* البطاقة الرابعة (Accessoires) تبدأ من العمود الثاني */
    grid-column: 2 / span 2;
}
.category-grid-card:nth-child(5) {
    /* البطاقة الخامسة (Carnet de Terrain) تبدأ من العمود الرابع */
    grid-column: 4 / span 2;
}

/* للتأكد من أن التصميم يعمل جيدًا على الشاشات الصغيرة */
@media (max-width: 992px) {
    .category-grid {
        /* نعود للتصميم المتجاوب البسيط على الموبايل */
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    .category-grid-card:nth-child(4),
    .category-grid-card:nth-child(5) {
        /* نلغي تحديد الأعمدة الخاص على الموبايل */
        grid-column: unset;
    }
}
/* ----- نهاية الكود الجديد ----- */


.category-grid-card:hover {
    transform: translateY(-5px);
}

.category-grid-card.active {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px var(--glow-color);
}

.category-grid-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
    background-color: #fff; /* White background for images */
}

.category-grid-card:hover img {
    transform: scale(1.05);
}

.category-grid-title {
    padding: 1.25rem;
    background-color: var(--section-bg);
    margin-top: auto; /* Pushes title to the bottom */
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
}

/* Scoped styles for IT Products page grid */
.it-category-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.it-category-grid .category-grid-card {
    width: 400px;
    flex-shrink: 0;
}

.it-category-grid .category-grid-card img {
    height: 300px;
}

/* Specific layout for the Geospatial Products page grid */
.geospatial-category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* Use a 6-column grid for precise control */
    grid-template-rows: auto;
    gap: 2rem;
}

.geospatial-category-grid .category-grid-card:nth-child(1) {
    grid-column: 1 / 3; /* First item */
}
.geospatial-category-grid .category-grid-card:nth-child(2) {
    grid-column: 3 / 5; /* Second item */
}
.geospatial-category-grid .category-grid-card:nth-child(3) {
    grid-column: 5 / 7; /* Third item */
}
.geospatial-category-grid .category-grid-card:nth-child(4) {
    grid-column: 2 / 4; /* Fourth item, centered */
}
.geospatial-category-grid .category-grid-card:nth-child(5) {
    grid-column: 4 / 6; /* Fifth item, centered */
}

.geospatial-category-grid .category-grid-card img {
    height: 331px; /* Set height to 331px as requested */
}

/* Styles for the dynamically shown product content sections */
.products-display-area {
    display: none; /* Hidden by default */
    padding: 3rem 0;
}

.products-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.products-content.show {
    display: block;
}

/* Styles for the new fullscreen overlay */
.products-display-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 1100; /* Above header */
    display: none; /* Hidden by default */
    padding: 8rem 2rem 2rem 2rem; /* Padding to avoid header */
    overflow-y: auto;
}

.products-display-overlay.is-visible {
    display: block;
}

body.product-overlay-active {
    overflow: hidden;
}

/* Hide the glowing background when the overlay is active */
body.product-overlay-active .interactive-bg {
    display: none;
}

.back-to-categories-btn {
    position: fixed; /* Use fixed positioning to stay relative to viewport */
    top: 2.5rem;
    left: 2rem;
    background: var(--button-bg);
    border: 1px solid var(--button-border);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    z-index: 1102; /* Ensure it's on top of the overlay content */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); /* Add shadow to make it pop */
}

.back-to-categories-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.back-to-categories-btn svg {
    stroke: var(--text-primary);
}

/* Professional styling for the content inside the overlay */
.overlay-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 4rem; /* Space below the back button */
}

.product-category-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1rem;
}

.product-placeholder {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-align: center;
    padding: 4rem 1rem;
    border: 2px dashed var(--header-border-color);
    border-radius: 12px;
    margin-top: 2rem;
}

@media (max-width: 992px) {
  .hero-content { padding: 1.5rem; }
  .hero-title { font-size: 2.2rem; }
  .section-title, .page-title { font-size: 2rem; }
  
  .values-grid-inline, .domains-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-body {
    flex-direction: column;
  }
  .modal-body img {
    width: 100%;
    height: 40%;
    max-height: 250px;
  }
  .modal-text {
    padding: 1.5rem;
  }
  .modal-text h2 {
    font-size: 1.8rem;
  }
}

main.content-wrapper {
  position: relative;
  z-index: 1;
}