/* CCTV PAGE STYLES */

/* Hero Section */
.cctv-hero {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 0;
}
.cctv-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('/assets/services/cctv/camera-family.jpg') center center/cover no-repeat;
  opacity: 0.7;
  z-index: 1;
}
.cctv-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10,34,54,0.75);
  z-index: 1;
  pointer-events: none;
}

/* Main BG */
.cctv-main-bg {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  background: none !important;
  overflow: hidden;
}
.cctv-main-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url('/assets/services/cctv/cctv-service-bg.jpg') center center/cover no-repeat;
  opacity: 0.22;
  pointer-events: none;
}
.cctv-main-bg > section,
.cctv-main-bg > div {
  position: relative;
  z-index: 2;
}

/* AI CCTV Section */
.ai-cctv-section {
  background: transparent !important;
  padding: 3rem 2rem 2rem 1rem;
  max-width: 90vw;
  min-width: 80vw;
}
.ai-cctv-title {
  font-size: 1.7rem;
  color: #222;
  margin-bottom: 2.2rem;
  margin-left: 13rem;
  margin-right: 0 !important;
  text-align: center !important;
  font-family: 'Montserrat', Arial, sans-serif;
  font-variant: small-caps;
}
.ai-cctv-title i {
  color: #b50202;
  margin-right: 0.5rem;
  align-items: center;
}
.ai-cctv-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}
.ai-flip-card {
  perspective: 1000px;
  width: 100%;
  max-width: 250px;
  min-width: 250px;
  height: 250px;
  border-radius: 16px;
}
.ai-flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(.77,0,.18,1);
  transform-style: preserve-3d;
  border-radius: 16px;
}
.ai-flip-card:hover .ai-flip-card-inner,
.ai-flip-card:focus-within .ai-flip-card-inner {
  transform: rotateY(-180deg);
}
.ai-flip-card-front, .ai-flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  box-shadow: 0 2px 16px rgba(17, 21, 21, 0.07);
  border: 2px solid #e0f7fa;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.ai-flip-card-front h3 {
  color: #222;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}
.ai-flip-card-back {
  transform: rotateY(-180deg);
  flex-direction: column;
  justify-content: center;
  gap: 1.2rem;
}
.ai-flip-card-back h3,
.ai-flip-card-back .ai-flip-card-front h3 {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.ai-flip-card-back p {
  color: #222;
  font-size: 1.01rem;
  text-align: justify;
}
.ai-flip-card-back .btn {
  margin-top: 0.5rem;
}
.ai-flip-card:hover .ai-flip-card-front,
.ai-flip-card:focus-within .ai-flip-card-front {
  box-shadow: 0 4px 24px rgba(30,198,217,0.13);
  border-color: #b50202;
}
.ai-cctv-card {
  background: none !important;
  border-radius: 16px;
  padding: 0 !important;
  flex: 1 1 220px;
  max-width: 300px;
  transition: box-shadow 0.2s;
}
.ai-cctv-card:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: #b50202;
}
.ai-cctv-card h3 {
  color: #222;
  margin-bottom: 0.7rem;
  font-size: 1.15rem;
  font-weight: 700;
}
.ai-cctv-card p {
  color: #222;
  font-size: 1.01rem;
  margin: 0;
  padding-top: 15px;
  text-align: justify;
}
/* AI CCTV Card Front with Background Image and Overlay */
.ai-cctv-card.ai-flip-card .ai-flip-card-front {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  background: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.ai-cctv-card.ai-flip-card .ai-flip-card-front::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  z-index: 1;
}
.ai-cctv-card.ai-flip-card .ai-flip-card-front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000 80%;
  opacity: 0.5;
  z-index: 2;
}
.ai-cctv-card.ai-flip-card .ai-flip-card-front h3 {
  position: relative;
  z-index: 10;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  margin-bottom: 0.7rem;
  margin-top: 0;
  width: 100%;
  text-align: center;
}
.ai-flip-card-front {
  pointer-events: auto;
}
.ai-flip-card:hover .ai-flip-card-front,
.ai-flip-card:focus-within .ai-flip-card-front {
  pointer-events: none;
}
.anpr-card .ai-flip-card-front::before {
  background: url('/assets/services/cctv/anpr.jpg') center center/cover no-repeat;
}
.face-card .ai-flip-card-front::before {
  background: url('/assets/services/cctv/fr.webp') center center/cover no-repeat;
}
.thermal-card .ai-flip-card-front::before {
  background: url('/assets/services/cctv/ti.webp') center center/cover no-repeat;
}
.people-card .ai-flip-card-front::before {
  background: url('/assets/services/cctv/people.webp') center center/cover no-repeat;
}
.perimeter-card .ai-flip-card-front::before {
  background: url('/assets/services/cctv/perimeter.png') center center/cover no-repeat;
}
.download-brochure {
  background-color: #b50202;
  color: #fff;
}
.download-brochure:hover {
  background-color: #000;
  color: #fff;
}

/* Responsive Styles */
@media (max-width: 900px) {
  .ai-cctv-grid {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    /* gap: 1.2rem; */
  }
  .ai-flip-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 270px !important;
    margin-left: 0.5rem !important;
    box-sizing: border-box;
  }
  .ai-cctv-section {
  padding: 1rem !important;
  max-width: 95vw !important;
  min-width: 85vw !important;
}
  .ai-cctv-title {
  font-size: 1.3rem;
  margin-left: 0.7rem !important;
  /* text-align: justify !important; */
 }
.ai-cctv-title i {
  color: #b50202;
  margin-right: 0.5rem;
  /* align-items: center; */
}
}
@media (max-width: 600px) {
  .ai-cctv-grid {
    padding: 0;
  }
  .ai-flip-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 260px !important;
    box-sizing: border-box;
  }
}
/* --- Animation Keyframes & Classes --- */
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(40px);}
  100% { opacity: 1; transform: translateY(0);}
}
@keyframes fadeInDown {
  0% { opacity: 0; transform: translateY(-40px);}
  100% { opacity: 1; transform: translateY(0);}
}
@keyframes fadeInLeft {
  0% { opacity: 0; transform: translateX(-40px);}
  100% { opacity: 1; transform: translateX(0);}
}
@keyframes fadeInRight {
  0% { opacity: 0; transform: translateX(40px);}
  100% { opacity: 1; transform: translateX(0);}
}
@keyframes scaleIn {
  0% { opacity: 0; transform: scale(0.95);}
  100% { opacity: 1; transform: scale(1);}
}

.animated { opacity: 0; transition: opacity 0.3s; }
.fade-in-up.in-view { animation: fadeInUp 1s cubic-bezier(.77,0,.18,1) forwards; }
.fade-in-down.in-view { animation: fadeInDown 1s cubic-bezier(.77,0,.18,1) forwards; }
.fade-in-left.in-view { animation: fadeInLeft 1s cubic-bezier(.77,0,.18,1) forwards; }
.fade-in-right.in-view { animation: fadeInRight 1s cubic-bezier(.77,0,.18,1) forwards; }
.scale-in.in-view { animation: scaleIn 0.9s cubic-bezier(.77,0,.18,1) forwards; }

.animated.delay-1 { animation-delay: 0.15s; }
.animated.delay-2 { animation-delay: 0.3s; }
.animated.delay-3 { animation-delay: 0.45s; }
.animated.delay-4 { animation-delay: 0.6s; }
.animated.delay-5 { animation-delay: 0.75s; }