/* ===== HERO BANNER SECTION ===== */

/* Override all conflicting styles from styles.css */
.hero {
  position: relative !important;
  width: 100% !important;
  height: 100vh !important;
  min-height: 600px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: visible !important;
  padding: 0 !important;
  align-items: stretch !important;
  margin: 0 !important;
  border: none !important;
  background: none !important;
}

/* Ensure hero-banner is completely isolated */
.hero-banner {
  position: relative !important;
  height: 66.67% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-sizing: border-box !important;
}

/* ===== MAIN HERO BANNER (2/3 height) ===== */
.hero-banner {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.4) 100%
  ),
  url('/image/product/FASADE FRONT/baner geroj1/98aaef_5b7d74fb13e44f0b80d2d55a99f04834~mv2.avif') center/cover no-repeat;
  background-attachment: scroll !important;
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  perspective: 1000px;
  -webkit-transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  -webkit-perspective: 1000px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  overflow: hidden;
  isolation: isolate;
  contain: layout style paint;
}

.hero-banner-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 0 2rem;
  animation: fadeInUp 1s ease-out;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.2s both;
}

.badge-text {
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 2.5rem;
  animation: fadeInUp 1s ease-out 0.4s both;
}

.title-primary {
  display: block;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.25rem;
}

.title-accent {
  display: block;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24, #ff6b6b);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  position: relative;
  animation: gradientText 4s ease-in-out infinite;
}

.title-accent::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  border-radius: 2px;
  animation: expandLine 2s ease-out 0.5s both;
}

.title-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(238, 90, 36, 0.1));
  border-radius: 8px;
  transform: scale(1.1);
  opacity: 0;
  animation: textGlow 4s ease-in-out infinite;
}

@keyframes gradientText {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes expandLine {
  from { 
    width: 0; 
    opacity: 0; 
  }
  to { 
    width: 60px; 
    opacity: 1; 
  }
}

@keyframes textGlow {
  0%, 100% { 
    opacity: 0; 
    transform: scale(1.1); 
  }
  50% { 
    opacity: 0.3; 
    transform: scale(1.15); 
  }
}

.hero-actions {
  animation: fadeInUp 1s ease-out 0.6s both;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 50px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
  animation: pulseGlow 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 40px rgba(220, 38, 38, 0.6);
  background: linear-gradient(135deg, #ef4444, #dc2626);
  animation: pulseGlow 1.5s ease-in-out infinite;
}

.btn-primary:active {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.5);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.hero-banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.3) 100%
  );
  z-index: 1;
}

/* ===== BOTTOM SERVICES GRID (1/3 height) ===== */
.hero-services {
  height: 33.33%; /* 1/3 of hero height */
  width: 100%;
  background: #f8fafc;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.hero-services-container {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.service-card {
  position: relative;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.service-card:last-child {
  border-right: none;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.service-image {
  position: relative;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.3s ease;
}

.service-card:hover .service-image {
  transform: scale(1.05);
}

/* Service Images */
.service-card[data-service="alarm"] .service-image {
  background-image: linear-gradient(
    rgba(0, 0, 0, 0.4),
    rgba(0, 0, 0, 0.6)
  ),
  url('/image/product/FASADE FRONT/baner geroj2/5ec196_1457f199873f4cd0bbd78d96ab6d1089~mv2.avif');
}

.service-card[data-service="extinguishing"] .service-image {
  background-image: linear-gradient(
    rgba(0, 0, 0, 0.4),
    rgba(0, 0, 0, 0.6)
  ),
  url('/image/product/FASADE FRONT/baner geroj2/5ec196_1a579bf6ab754981a3d6b90b29bdf6d1~mv2.avif');
}

.service-card[data-service="evacuation"] .service-image {
  background-image: linear-gradient(
    rgba(0, 0, 0, 0.4),
    rgba(0, 0, 0, 0.6)
  ),
  url('/image/product/FASADE FRONT/baner geroj2/5ec196_1e214ce725a344f18bdd876b4363dc25~mv2.avif');
}

.service-card[data-service="specialized"] .service-image {
  background-image: linear-gradient(
    rgba(0, 0, 0, 0.4),
    rgba(0, 0, 0, 0.6)
  ),
  url('/image/product/FASADE FRONT/baner geroj2/5ec196_40913ed9aa2345fd922cb811d783f7dc~mv2.avif');
}

.service-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    transparent 0%,
    rgba(0, 0, 0, 0.7) 50%,
    rgba(0, 0, 0, 0.9) 100%
  );
  padding: 2rem 1.5rem 1.5rem;
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.service-card:hover .service-overlay {
  transform: translateY(-5px);
}

.service-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 
    1px 1px 2px rgba(0, 0, 0, 0.8),
    0 0 10px rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
}

.service-card:hover .service-title {
  text-shadow: 
    1px 1px 2px rgba(0, 0, 0, 0.8),
    0 0 15px rgba(255, 255, 255, 0.3),
    0 0 25px rgba(220, 38, 38, 0.2);
  transform: translateY(-2px);
}

/* ===== ADVANCED EFFECTS ===== */
.hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(220, 38, 38, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(239, 68, 68, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, transparent 100%);
  z-index: 1;
  animation: gradientShift 8s ease-in-out infinite;
}

.hero-banner-content::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.02) 50%,
    transparent 70%
  );
  animation: scanline 6s linear infinite;
  pointer-events: none;
}

.service-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.service-card:hover::after {
  opacity: 1;
  animation: shimmer 1.5s ease-out;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes gradientShift {
  0%, 100% { 
    opacity: 1;
    transform: scale(1);
  }
  50% { 
    opacity: 0.8;
    transform: scale(1.05);
  }
}

@keyframes scanline {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
  }
  50% {
    box-shadow: 0 8px 35px rgba(220, 38, 38, 0.6);
  }
}

/* ===== DESKTOP STABILITY ===== */
@media (min-width: 769px) {
  .hero-banner {
    background-attachment: scroll !important;
    transform: translateZ(0) !important;
    backface-visibility: hidden !important;
    -webkit-transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
    -webkit-perspective: 1000px !important;
    perspective: 1000px !important;
  }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
  .hero-services-container {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
  }
  
  .service-card {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }
  
  .service-card:nth-child(2n) {
    border-right: none;
  }
  
  .service-card:nth-child(n+3) {
    border-bottom: none;
  }
}

@media (max-width: 768px) {
  .hero {
    height: auto;
    min-height: 100vh;
    overflow: visible !important;
  }
  
  .hero-banner {
    background-attachment: scroll !important;
    transform: none !important;
    height: 70vh;
    min-height: 500px;
  }
  
  .hero-services {
    height: auto;
  }
  
  .hero-services-container {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 200px);
  }
  
  .service-card {
    border-right: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }
  
  .service-card:last-child {
    border-bottom: none;
  }
  
  .hero-banner-content {
    padding: 0 1rem;
  }
  
  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 1.5rem;
  }
  
  .hero-badge {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
  }
  
  .btn-hero {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
  
  .service-title {
    font-size: 1rem;
  }
  
  .service-overlay {
    padding: 1.5rem 1rem 1rem;
  }
}

@media (max-width: 480px) {
  .hero-banner {
    height: 60vh;
    min-height: 400px;
    background-attachment: scroll !important;
    transform: none !important;
  }
  
  .hero-title {
    font-size: clamp(1.75rem, 10vw, 2.5rem);
  }
  
  .service-title {
    font-size: 0.9rem;
  }
  
  .hero-services-container {
    grid-template-rows: repeat(4, 180px);
  }
}

/* ===== HIGH RESOLUTION DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-banner {
    background-image: linear-gradient(
      135deg,
      rgba(0, 0, 0, 0.4) 0%,
      rgba(0, 0, 0, 0.2) 50%,
      rgba(0, 0, 0, 0.4) 100%
    ),
    url('/image/product/FASADE FRONT/baner geroj1/98aaef_5b7d74fb13e44f0b80d2d55a99f04834~mv2.avif');
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  .hero-banner-content,
  .hero-badge,
  .hero-title,
  .hero-actions {
    animation: none;
  }
  
  .service-card:hover {
    transform: none;
  }
  
  .service-card:hover .service-image {
    transform: none;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .hero {
    height: auto;
    page-break-inside: avoid;
  }
  
  .hero-banner {
    height: auto;
    background: #f0f0f0;
    color: #000;
  }
  
  .hero-services {
    display: none;
  }
}
