/* Hero Section */
.wp-block-apc-hero .hero,
.hero {
  padding: 80px 0;
  min-height: calc(100vh - 5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-container {
  padding: 0 40px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 100px;
}

/* Hero Icons Animation */
.hero-icons-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 15;
}

.hero-icons {
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

/* Show first icon set by default (cloud-icons) - only before JS loads */
.hero-icons.cloud-icons:not(.hero-icons-initialized) {
  opacity: 1;
}

.hero-icons.active {
  opacity: 1;
}

.processes-icons .hero-icon {
  width: 400px;
}

.hero-icon {
  position: absolute;
  width: 160px;
  height: auto;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.6s ease-in-out;
}

/* Show cloud icons by default on page load - only before JS initializes */
.hero-icons.cloud-icons:not(.hero-icons-initialized) .hero-icon {
  opacity: 1;
  transform: scale(1);
}

.hero-icons.active .hero-icon {
  opacity: 1;
  transform: scale(1);
}

/* Circular positioning around the text */
.hero-icon.icon-top {
  top: -120px;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
}

.hero-icon.icon-right {
  top: 50%;
  right: -200px;
  transform: translateY(-50%) scale(0.8);
}

.hero-icon.icon-bottom {
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
}

.hero-icon.icon-left {
  top: 50%;
  left: -200px;
  transform: translateY(-50%) scale(0.8);
}

.hero-icon.icon-top-right {
  top: -80px;
  right: -160px;
  transform: scale(0.8);
}

.hero-icon.icon-top-left {
  top: -80px;
  left: -160px;
  transform: scale(0.8);
}

.hero-icon.icon-bottom-right {
  bottom: -80px;
  right: -160px;
  transform: scale(0.8);
}

.hero-icon.icon-bottom-left {
  bottom: -80px;
  left: -160px;
  transform: scale(0.8);
}

/* Processes specific positioning */
.processes-icons .hero-icon.icon-top-left {
  top: -45%;
  left: -37%;
  right: auto;
  bottom: auto;
  transform: scale(1);
}

.processes-icons .hero-icon.icon-bottom-right {
  bottom: -52%;
  right: -37%;
  left: auto;
  top: auto;
  transform: scale(1);
}

/* Active state transforms */
.hero-icons.active .hero-icon.icon-top {
  transform: translateX(-50%) scale(1);
}

.hero-icons.active .hero-icon.icon-right {
  transform: translateY(-50%) scale(1);
}

.hero-icons.active .hero-icon.icon-bottom {
  transform: translateX(-50%) scale(1);
}

.hero-icons.active .hero-icon.icon-left {
  transform: translateY(-50%) scale(1);
}

.hero-icons.active .hero-icon.icon-top-right,
.hero-icons.active .hero-icon.icon-top-left,
.hero-icons.active .hero-icon.icon-bottom-right,
.hero-icons.active .hero-icon.icon-bottom-left {
  transform: scale(1);
}

.hero-icons.active .hero-icon:nth-child(1) {
  transition-delay: 0.1s;
}
.hero-icons.active .hero-icon:nth-child(2) {
  transition-delay: 0.2s;
}
.hero-icons.active .hero-icon:nth-child(3) {
  transition-delay: 0.3s;
}
.hero-icons.active .hero-icon:nth-child(4) {
  transition-delay: 0.4s;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  font-size: 96px;
  font-weight: 900;
  position: relative;
  z-index: 10;
}

.hero-line {
  color: var(--text-color);
  line-height: 1.2;
}

.hero-highlight {
  display: inline-block;
  text-align: center;
  perspective: 2000px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cube-container {
  height: 100px;
  position: relative;
  transform-style: preserve-3d;
  display: inline-block;
  min-width: 300px;
  perspective: 1000px;
}

.cube {
  height: 100px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.65, 0, 0.35, 1);
  display: inline-block;
  width: 100%;
}

.cube-face {
  position: absolute;
  height: 100px;
  background: linear-gradient(
    90deg,
    var(--secondary-color) 0%,
    var(--brand-color) 100%
  );
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: inherit;
  line-height: 1.2;
  backface-visibility: hidden;
  transition: transform 1s cubic-bezier(0.65, 0, 0.35, 1);
  white-space: nowrap;
  text-align: center;
  padding: 0 40px;
  min-width: max-content;
  left: 50%;
  transform-origin: center;
}

/* Default initial state - first face visible, others hidden */
.cube-face:first-child {
  transform: translateX(-50%) rotateX(0deg) translateZ(50px);
  z-index: 10;
  opacity: 1;
}

.cube-face:not(:first-child) {
  transform: translateX(-50%) rotateX(90deg) translateZ(50px);
  z-index: 1;
  opacity: 0;
}

/* Default initial state - first face visible, others hidden */
.cube-face:first-child {
  transform: translateX(-50%) rotateX(0deg) translateZ(50px);
  z-index: 10;
  opacity: 1;
}

.cube-face:not(:first-child) {
  transform: translateX(-50%) rotateX(90deg) translateZ(50px);
  z-index: 1;
  opacity: 0;
}

/* Active states override the default when JS is loaded */
.cube-face.active {
  transform: translateX(-50%) rotateX(0deg) translateZ(50px);
  z-index: 10;
  opacity: 1;
}

.cube-face.previous {
  transform: translateX(-50%) rotateX(-90deg) translateZ(50px);
  z-index: 5;
  opacity: 1;
}

.cube-face.next {
  transform: translateX(-50%) rotateX(90deg) translateZ(50px);
  z-index: 1;
  opacity: 1;
}

.cube-face.hidden {
  transform: translateX(-50%) rotateX(180deg) translateZ(50px);
  z-index: 1;
  opacity: 0;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  body .wp-block-apc-hero .hero,
  body .hero {
    min-height: 100vh !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body .wp-block-apc-hero .hero-container,
  body .hero-container {
    padding: 40px 0px !important;
    max-width: 100% !important;
    width: 100% !important;
    text-align: center !important;
    position: relative !important;
    overflow: visible !important;
  }

  body .wp-block-apc-hero .hero-icons-container,
  body .hero-icons-container {
    position: absolute !important;
    top: 0 !important;
    left: -20px !important;
    right: -20px !important;
    bottom: 0 !important;
    width: calc(100% + 40px) !important;
    height: 100% !important;
    z-index: 1 !important;
    pointer-events: none !important;
  }



  /* Mobile text sizing */
  body .wp-block-apc-hero .hero-text,
  body .hero-text {
    font-size: 42px !important;
    gap: 30px !important;
    text-align: center !important;
    max-width: 100% !important;
    line-height: 1.1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body .wp-block-apc-hero .hero-line,
  body .hero-line {
    line-height: 1.1 !important;
    margin: 0 !important;
    font-weight: 900 !important;
  }

  body .wp-block-apc-hero .hero-highlight,
  body .hero-highlight {
    height: 70px !important;
    margin: 15px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body .wp-block-apc-hero .cube-container,
  body .wp-block-apc-hero .cube,
  body .wp-block-apc-hero .cube-face,
  body .cube-container,
  body .cube,
  body .cube-face {
    height: 70px !important;
  }

  body .wp-block-apc-hero .cube-face,
  body .cube-face {
    border-radius: 20px !important;
    padding: 0 25px !important;
    font-size: 25px !important;
    line-height: 1.1 !important;
    font-weight: 600 !important;
  }

  /* Mobile icon adjustments - smaller and constrained */
  body .wp-block-apc-hero .hero-icons-container,
  body .hero-icons-container {
    display: block !important;
    z-index: 1 !important;
  }

  /* Mobile hero icons - bigger and higher from text */
  .hero-icon {
    width: 160px !important;
    height: auto !important;
    opacity: 0.8 !important;
  }

  .hero-icon.icon-top {
    top: -25% !important;
    left: 50% !important;
    transform: translateX(-50%) scale(1) !important;
  }
  
  .hero-icon.icon-top-left {
    top: -59% !important;
    left: 8% !important;
    transform: scale(1) !important;
  }
  
  .hero-icon.icon-top-right {
    top: -59% !important;
    right: 8% !important;
    transform: scale(1) !important;
  }
  
  .hero-icon.icon-bottom {
    bottom: -25% !important;
    left: 50% !important;
    transform: translateX(-50%) scale(1) !important;
  }
  
  .hero-icon.icon-bottom-left {
    bottom: -59% !important;
    left: 8% !important;
    transform: scale(1) !important;
  }
  
  .hero-icon.icon-bottom-right {
    bottom: -59% !important;
    right: 8% !important;
    transform: scale(1) !important;
  }
  
  .hero-icon.icon-left {
    top: 50% !important;
    left: -15% !important;
    transform: translateY(-50%) scale(1) !important;
  }
  
  .hero-icon.icon-right {
    top: 50% !important;
    right: -15% !important;
    transform: translateY(-50%) scale(1) !important;
  }

  /* Active state for mobile icons */
  .hero-icons.active .hero-icon {
    opacity: 1 !important;
  }

  /* Special handling for processes icons on mobile */
  .processes-icons .hero-icon {
    width: 220px !important;
  }
  
  .processes-icons .hero-icon.icon-top-left {
    top: -45% !important;
    left: 5% !important;
    transform: scale(1) !important;
  }

  .processes-icons .hero-icon.icon-bottom-right {
    bottom: -45% !important;
    right: 5% !important;
    transform: scale(1) !important;
  }
}

/* Smaller mobile screens */
@media (max-width: 480px) {
  body .wp-block-apc-hero .hero,
  body .hero {
    min-height: 88vh !important;
    padding: 0 !important;
  }

  body .wp-block-apc-hero .hero-container,
  body .hero-container {
    padding: 30px 0px !important;
  }

  body .wp-block-apc-hero .hero-text,
  body .hero-text {
    font-size: 32px !important;
    gap: 25px !important;
  }

  body .wp-block-apc-hero .hero-highlight,
  body .hero-highlight {
    height: 55px !important;
    margin: 12px 0 !important;
  }

  body .wp-block-apc-hero .cube-container,
  body .wp-block-apc-hero .cube,
  body .wp-block-apc-hero .cube-face,
  body .cube-container,
  body .cube,
  body .cube-face {
    height: 55px !important;
  }

  body .wp-block-apc-hero .cube-face,
  body .cube-face {
    border-radius: 18px !important;
    padding: 0 20px !important;
    font-size: 25px !important;
    line-height: 1.1 !important;
  }

  /* Small mobile screens - bigger icons higher from text */
  .hero-icon {
    width: 130px !important;
  }

  .hero-icon.icon-top {
    top: -20% !important;
  }

  .hero-icon.icon-bottom {
    bottom: -20% !important;
  }
  
  .hero-icon.icon-top-left, .hero-icon.icon-bottom-left {
    left: 5% !important;
  }
  
  .hero-icon.icon-top-right, .hero-icon.icon-bottom-right {
    right: 5% !important;
  }
  
  .hero-icon.icon-left {
    left: -10% !important;
    top: 48% !important;
  }
  
  .hero-icon.icon-right {
    right: -10% !important;
    top: 48% !important;
  }

  .processes-icons .hero-icon {
    width: 250px !important;
  }

  .processes-icons .hero-icon.icon-top-left {
    top: -95% !important;
        left: 8% !important;
        transform: rotate(45deg) !important;
  }

  .processes-icons .hero-icon.icon-bottom-right {
    top: 46% !important;
        right: 8% !important;
        transform: rotate(268deg) !important;
  }
}

/* Block Editor Styles */
.hero-block-editor {
  border: 2px dashed #ccc;
  padding: 20px;
  margin: 20px 0;
}

.hero-preview {
  background: #f9f9f9;
  padding: 40px 20px;
  border-radius: 8px;
  text-align: center;
}

.hero-preview .hero-text {
  font-size: 48px;
  font-weight: 900;
}

.hero-preview .hero-line {
  color: #333;
  line-height: 1.2;
}

.hero-preview .cube-face {
  font-size: 48px;
}

.editor-note {
  margin-top: 20px;
  padding: 10px;
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  font-size: 14px;
}

.editor-note p {
  margin: 0;
  color: #1976d2;
}