html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: "Open Sans", sans-serif;
  background-color: #f8f9fa;
  color: #333;
}
main {
  flex: 1;
}

/* =========================
   Navbar (desktop default)
   ========================= */
.navbar,
.navbar2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: transparent;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 100;
  height: auto;
}
.navbar2 {
  background-color: black;
}

.navbar-logo {
  max-height: 150px;
}

.navbar .logo a {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0ea5e9;
  text-decoration: none;
  transition: color 0.3s ease;
}
.navbar .logo a:hover {
  color: #38bdf8;
}

/* Desktop nav links */
.nav-links {
  display: flex;
  gap: 2rem;
}
.nav-links a {
  font-size: 1.1rem;
  color: #f1f5f9;
  text-decoration: none;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: #0ea5e9;
  transition: width 0.3s ease;
}
.nav-links a:hover {
  color: #0ea5e9;
}
.nav-links a:hover::after {
  width: 100%;
}

/* Legacy logo classes kept for safety (used in some pages) */
.logo-default,
.nav-logo {
  display: block;
  height: 150px;
  width: auto;
}
.logo-tablet {
  display: none;
}

/* Keep header links white when used as logo text */
.navbar .logo a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

/* =========================
   Hero
   ========================= */
/* Glass effect for hero background only */
.hero.with-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15); /* glass tint */
  backdrop-filter: blur(10px) saturate(120%) contrast(105%);
  -webkit-backdrop-filter: blur(12px) saturate(120%) contrast(105%);
  z-index: 0; /* sits below text but above background */
}

/* keep hero content above the glass */
.hero-content,
.hero-box {
  position: relative;
  z-index: 1;
}
.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  margin-top: -200px;
  text-align: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #1e293b;
  position: relative;
}
.hero.with-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-box {
  background: rgba(0, 0, 0, 0.6);
  padding: 0.5rem 1rem; /* just a sliver of breathing room */
  border-radius: 12px;
  text-align: center;
  backdrop-filter: blur(3px);
  max-width: 1000px;
  width: fit-content; /* shrink-wrap to content */
  margin: 0 auto; /* keep centered */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* no forced vertical centering */
}

.hero-logo {
  max-width: 180px;
  height: auto;
  margin: 0 auto 1rem;
  display: block;
  background: white;
  padding: 0.5rem;
}
/* Secondary hero on inner pages */
.secondary-hero {
  height: 80vh;
  min-height: 200px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* =========================
   Buttons / Cards
   ========================= */
.btn-group {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin: 1rem;
}
.service-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
}
.service-label {
  font-size: 1.1rem;
  font-weight: bold;
  color: white;
  margin-bottom: 0.5rem;
  text-shadow: 1px 1px 2px black;
}
.service-btn {
  position: relative;
  height: 150px;
  width: 260px;
  font-size: 1.2rem;
  font-weight: bold;
  background-size: cover;
  background-position: center;
  border: none;
  border-radius: 12px;
  color: white;
  text-decoration: none;
  text-align: center;
  overflow: hidden;
  transition: transform 0.2s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1rem;
  text-shadow: 1px 1px 2px black, -1px -1px 2px black;
}
.service-btn:hover {
  transform: scale(1.05);
}
.it-btn {
  background-image: url("../img/IT-splash.png");
}
.alarm-btn {
  background-image: url("../img/security/alarms/Q70.png");
}
.cctv-btn {
  background-image: url("../img/security/cctv/cctv.png");
}

.ssaib-logo {
  width: 100px;
  height: auto;
  border-radius: 8px;
  transition: transform 0.2s ease;
}
.ssaib-logo:hover {
  transform: scale(1.05);
}

.cards-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(100vh - 55vh - 200px - 4rem);
  padding: 2rem;
}
.cards {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.card:hover h2 {
  color: #0ea5e9;
}

/* =========================
   Footer / Utilities
   ========================= */
footer {
  text-align: center;
  padding: 1rem;
  background: black;
  color: white;
}
html {
  scroll-behavior: smooth;
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #0ea5e9;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 50px;
  text-decoration: none;
  font-size: 1.5rem;
  display: none;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.back-to-top:hover {
  background: #38bdf8;
}
body.scrolled .back-to-top {
  display: block;
}

.service-details {
  padding: 4rem 2rem;
  background-color: #ffffff;
  color: #333;
  max-width: 1200px;
  margin: 0 auto;
}
.service-details > div {
  margin-bottom: 4rem;
  padding: 2rem;
  background: #f3f4f6;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
}
.service-details > div:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.service-details h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #1e293b;
}
.service-details p {
  line-height: 1.7;
  font-size: 1rem;
}
.service-details h2 i {
  margin-right: 0.5rem;
  color: #0ea5e9;
}

.floating-contact {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #0ea5e9;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: background 0.3s ease;
}
.floating-contact:hover {
  background-color: #0284c7;
}
.floating-contact i {
  margin-right: 0.5rem;
}

.floating-ssaib {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 998;
  background: white;
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}
.floating-ssaib:hover {
  transform: scale(1.05);
}
.floating-ssaib img {
  height: 50px;
  width: auto;
  display: block;
}

@keyframes highlight-focus {
  0% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.6);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(14, 165, 233, 0.4);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    transform: scale(1);
  }
}
.attention {
  animation: highlight-focus 1.5s ease;
}

/* ===========================================
   Tablet tweaks
   =========================================== */
@media (max-width: 1024px) {
  .navbar {
    padding: 1rem;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: auto;
    margin-top: 0;
  }

  .hero-content {
    height: auto;
    padding: 4rem 1rem;
    text-align: center;
  }
  .hero-box {
    padding: 1.5rem;
    width: 100%;
  }

  .btn-group {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }
  .service-btn {
    width: 100%;
    max-width: 300px;
  }

  .secondary-hero {
    height: 30vh;
    min-height: 160px;
  }

  /* Labels under images on tablet */
  .service-column {
    flex-direction: column-reverse;
  }
  .service-label {
    margin-top: 0.5rem;
    margin-bottom: 0;
  }
}

/* ===========================================
   Mobile menu (scaleY + stagger)
   =========================================== */

/* Hide button on desktop */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  margin-left: 1rem;
  padding: 0;
  line-height: 1;
}

@media (max-width: 768px) {
  /* Navbar row so “Menu” sits right of logo */
  .navbar {
    background-color: #1e293b;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    text-align: left;
  }
  .navbar .logo {
    display: flex;
    align-items: center;
    margin: 0;
  }
  .navbar-logo {
    max-height: 64px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.25rem;
    margin: 0;
  }
  .menu-toggle {
    display: inline-block;
  }

  /* Dropdown: auto-size with scaleY (no fullscreen) */
  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e293b;
    padding: 0 1rem;
    gap: 1rem;
    z-index: 999;

    transform-origin: top;
    transform: scaleY(0.8);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
      opacity 0.3s ease, visibility 0s linear 0.35s;
  }
  .nav-links.active {
    transform: scaleY(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    padding: 1rem;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
      opacity 0.3s ease, visibility 0s;
  }

  /* Staggered link reveal */
  .nav-links a {
    color: #f1f5f9;
    font-size: 1.1rem;
    text-decoration: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  .nav-links a:hover {
    color: #0ea5e9;
  }
  .nav-links.active a {
    opacity: 1;
    transform: translateY(0);
  }
  .nav-links.active a:nth-child(1) {
    transition-delay: 90ms;
  }
  .nav-links.active a:nth-child(2) {
    transition-delay: 150ms;
  }
  .nav-links.active a:nth-child(3) {
    transition-delay: 210ms;
  }

  /* Mobile sections */
  .hero {
    margin-top: 0;
  }
  .cards {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    overflow-x: hidden;
  }
  .card {
    width: 90%;
  }
  .service-details {
    padding: 2rem 1rem;
  }
  .service-details > div {
    padding: 1.5rem;
  }
  .service-details h2 {
    font-size: 1.5rem;
  }
  .service-details p,
  .service-details li {
    font-size: 0.95rem;
  }
  footer {
    padding: 1rem 0.5rem;
    font-size: 0.9rem;
  }
  .secondary-hero {
    height: 30vh;
    min-height: 160px;
  }
  .btn-group {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
  }
  .service-btn {
    width: 90%;
    max-width: 350px;
    height: 140px;
    font-size: 1rem;
  }
  .service-label {
    font-size: 1rem;
  }
  .service-column {
    width: 100%;
  }
}
