/* ============================================================
   Kal e-telecom plc - Animations & Micro-Interactions
   Ethio Telecom Master Agent Design System
   ============================================================ */

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(120, 190, 32, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(120, 190, 32, 0.8), 0 0 45px rgba(0, 93, 164, 0.3);
  }
}

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

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

@keyframes badgeShine {
  0% {
    left: -100%;
  }
  20%, 100% {
    left: 150%;
  }
}

@keyframes ripple {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.2;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.8;
  }
}

.animate-pulse-glow {
  animation: pulseGlow 3s infinite ease-in-out;
}

.animate-float {
  animation: floatElement 4s infinite ease-in-out;
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
}

/* Shine effect on badges and featured cards */
.shine-effect {
  position: relative;
  overflow: hidden;
}

.shine-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-25deg);
  animation: badgeShine 5s infinite;
}

/* Scroll reveal utility classes handled by IntersectionObserver */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Interactive Tactile Button Ripple Effect */
.btn-ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.15) 70%);
  pointer-events: none;
  transform: scale(0);
  animation: rippleExpandWave 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  z-index: 10;
}
@keyframes rippleExpandWave {
  to {
    transform: scale(1);
    opacity: 0;
  }
}

/* Glossy Button Light-Sweep */
@keyframes buttonSheenSweep {
  0%, 70% { left: -130%; }
  100% { left: 180%; }
}

/* Ambient Floating Background Orbs */
@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(80px, 60px) scale(1.12); }
  100% { transform: translate(-40px, 100px) scale(0.95); }
}
@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-90px, -70px) scale(1.15); }
  100% { transform: translate(50px, -40px) scale(0.9); }
}
@keyframes floatOrb3 {
  0% { transform: translate(0, 0) scale(0.9); }
  50% { transform: translate(-60px, 50px) scale(1.2); }
  100% { transform: translate(70px, -30px) scale(1); }
}
@keyframes floatOrb4 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(70px, -60px) scale(1.1); }
  100% { transform: translate(-50px, 40px) scale(0.92); }
}

/* Telecom Signal Pulse */
@keyframes telecomPulseRing {
  0% { transform: scale(0.15); opacity: 0.9; }
  50% { opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* Floating Tech Particle */
@keyframes particleFloat {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
  50% { transform: translateY(-30px) translateX(15px); opacity: 0.85; }
}

/* ============================================================
   Ethio Telecom Subpage Animation System & Micro-Interactions
   ============================================================ */

/* Ambient Glowing Background Orbs */
.subpage-hero {
  position: relative;
  overflow: hidden;
}

.hero-mesh-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  will-change: transform;
}

.hero-orb-green {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #72b01d 0%, rgba(114, 176, 29, 0) 70%);
  top: -100px;
  right: 5%;
  animation: floatOrb1 16s ease-in-out infinite alternate;
}

.hero-orb-blue {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, #0072ce 0%, rgba(0, 114, 206, 0) 70%);
  bottom: -120px;
  left: -60px;
  animation: floatOrb2 20s ease-in-out infinite alternate;
}

.hero-orb-gold {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, #f58220 0%, rgba(245, 130, 32, 0) 70%);
  top: 20%;
  right: 35%;
  opacity: 0.25;
  animation: floatOrb3 18s ease-in-out infinite alternate;
}

.subpage-hero > .container {
  position: relative;
  z-index: 2;
}

/* Live Pulse Beacon Indicator */
.live-beacon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.live-beacon-dot {
  width: 9px;
  height: 9px;
  background-color: #84cc16;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 10px #84cc16;
}

.live-beacon-dot::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid #84cc16;
  animation: telecomPulseRing 2s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

.live-beacon-blue .live-beacon-dot {
  background-color: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
}
.live-beacon-blue .live-beacon-dot::after {
  border-color: #38bdf8;
}

/* Interactive Card Elevations & Radiant Glow */
.interactive-card {
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), 
              box-shadow 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), 
              border-color 0.35s ease,
              background-color 0.35s ease;
  will-change: transform, box-shadow;
  position: relative;
  overflow: hidden;
}

.interactive-card:hover {
  transform: translateY(-7px) scale(1.01);
  box-shadow: 0 20px 38px -10px rgba(0, 90, 156, 0.16), 0 8px 16px -6px rgba(114, 176, 29, 0.12) !important;
  border-color: #72b01d !important;
}

.interactive-card:hover .interactive-icon {
  transform: scale(1.12) rotate(4deg);
  background: linear-gradient(135deg, #72b01d, #005a9c);
  color: white !important;
}

.interactive-icon {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.35s ease, color 0.35s ease;
}

/* Staggered Content Animation */
@keyframes fadeInUpStagger {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-entrance {
  animation: fadeInUpStagger 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Ethio Telecom Radiant Button Glow */
.btn-telecom-glow {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-telecom-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.75s ease;
}

.btn-telecom-glow:hover::before {
  left: 150%;
}

.btn-telecom-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(114, 176, 29, 0.38);
}

/* ============================================================
   Dynamic Background Animations
   ============================================================ */
@keyframes bgWaveShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.subpage-hero {
  background-size: 200% 200% !important;
  animation: bgWaveShift 14s ease infinite alternate !important;
}

/* 3D Floating Showcase Container for Images */
.hero-visual-showcase {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-visual-img {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 24px 50px -12px rgba(0, 35, 75, 0.35), 0 0 30px rgba(114, 176, 29, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.25);
  animation: floatElement 4.5s ease-in-out infinite;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-visual-img:hover {
  transform: scale(1.03) rotate(-1deg);
  box-shadow: 0 30px 60px -10px rgba(0, 90, 156, 0.45), 0 0 40px rgba(114, 176, 29, 0.4);
}

.hero-visual-badge {
  position: absolute;
  bottom: -15px;
  right: -10px;
  background: white;
  color: #061828;
  padding: 8px 16px;
  border-radius: 30px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid #72b01d;
  animation: floatOrb4 4s ease-in-out infinite alternate;
}

/* ============================================================
   Mobile Responsive Typography & Layout Optimization
   ============================================================ */
@media (max-width: 900px) {
  .subpage-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    text-align: center;
  }
  .subpage-hero-grid .hero-actions {
    justify-content: center;
  }
  .subpage-hero-grid .breadcrumb-row {
    justify-content: center;
  }
  .hero-visual-showcase {
    max-width: 320px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 14px !important;
  }
  body {
    font-size: 0.88rem !important;
    line-height: 1.5 !important;
  }
  h1, .hero-title {
    font-size: 1.62rem !important;
    line-height: 1.25 !important;
    letter-spacing: -0.3px !important;
    margin-bottom: 12px !important;
  }
  .hero-lead {
    font-size: 0.86rem !important;
    line-height: 1.55 !important;
    margin-bottom: 20px !important;
  }
  h2, .section-title {
    font-size: 1.42rem !important;
    line-height: 1.3 !important;
    margin-bottom: 10px !important;
  }
  .section-desc {
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
  }
  h3 {
    font-size: 1.10rem !important;
  }
  .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  .subpage-hero {
    padding: 36px 0 30px !important;
  }
  .hero-badge {
    font-size: 0.72rem !important;
    padding: 4px 10px !important;
    margin-bottom: 10px !important;
  }
  .hero-actions {
    gap: 8px !important;
    flex-direction: column !important;
  }
  .hero-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 10px 14px !important;
    font-size: 0.84rem !important;
  }
  .kpi-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 14px !important;
    margin-top: -16px !important;
  }
  .kpi-item {
    border-right: none !important;
    padding: 6px !important;
    border-bottom: 1px solid #f1f5f9;
  }
  .kpi-val {
    font-size: 1.30rem !important;
  }
  .kpi-label {
    font-size: 0.70rem !important;
  }
  /* Grids & Cards */
  .services-9-grid, 
  .bills-grid-6, 
  .fin-cards-grid, 
  .denoms-grid, 
  .steps-grid, 
  .devices-grid, 
  .sim-types-grid,
  .catalog-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .hubs-bar {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 14px !important;
  }
  .channel-banner {
    grid-template-columns: 1fr !important;
    padding: 24px 16px !important;
    gap: 20px !important;
  }
  .related-nav {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .ussd-dialer {
    max-width: 100% !important;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 13.5px !important;
  }
  h1, .hero-title {
    font-size: 1.40rem !important;
  }
  .kpi-strip {
    grid-template-columns: 1fr 1fr !important;
    padding: 10px 8px !important;
  }
  .hubs-bar {
    grid-template-columns: 1fr !important;
  }
  .top-bar-inner {
    font-size: 0.70rem !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 6px !important;
  }
  .navbar {
    height: 62px !important;
  }
  .brand-logo img {
    height: 30px !important;
  }
  .partner-logo-img {
    height: 24px !important;
  }
}

/* ============================================================
   Subpage Dropdown Instant Click & Hover Bridge Enhancement
   ============================================================ */
.nav-item-dropdown {
  position: relative;
}

.dropdown-trigger {
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.dropdown-trigger i.fa-chevron-down {
  transition: transform 0.22s ease;
}

.dropdown-menu {
  position: absolute;
  top: 100% !important;
  margin-top: 4px;
  left: 0;
  width: 270px;
  background: #ffffff !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 36px rgba(0, 35, 75, 0.18) !important;
  border: 1px solid var(--gray-border, #e2e8f0) !important;
  padding: 8px !important;
  display: none !important;
  flex-direction: column !important;
  gap: 3px !important;
  z-index: 10000 !important;
}

/* Invisible hover bridge to prevent hover loss when moving down */
.dropdown-menu::after {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
  background: transparent;
}

.nav-item-dropdown:hover .dropdown-menu,
.nav-item-dropdown:focus-within .dropdown-menu,
.nav-item-dropdown.active .dropdown-menu,
.nav-item-dropdown.is-open .dropdown-menu {
  display: flex !important;
}

.nav-item-dropdown:hover .dropdown-trigger i.fa-chevron-down,
.nav-item-dropdown.active .dropdown-trigger i.fa-chevron-down,
.nav-item-dropdown.is-open .dropdown-trigger i.fa-chevron-down {
  transform: rotate(180deg);
}

.dropdown-menu a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  color: #334155 !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all 0.18s ease !important;
}

.dropdown-menu a:hover {
  background: rgba(114, 176, 29, 0.12) !important;
  color: #588a15 !important;
  transform: translateX(4px) !important;
}

/* Floating Language Switcher Pill (Quick touch from anywhere on mobile/desktop) */
.floating-lang-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1090;
  background: rgba(6, 24, 40, 0.94);
  backdrop-filter: blur(10px);
  padding: 4px 6px;
  border-radius: 30px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(114, 176, 29, 0.5);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.floating-lang-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.45);
}
.float-lang-btn {
  background: none;
  border: none;
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.float-lang-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}
.float-lang-btn.active {
  background: #72b01d;
  color: white;
  box-shadow: 0 2px 8px rgba(114, 176, 29, 0.5);
}

@media (max-width: 600px) {
  .floating-lang-pill {
    bottom: 16px;
    right: 16px;
    padding: 3px 5px;
  }
  .float-lang-btn {
    font-size: 0.72rem;
    padding: 5px 9px;
  }
}

/* Top Strip Language Switcher Component */
.lang-switcher {
  display: inline-flex !important;
  align-items: center !important;
  background: rgba(255, 255, 255, 0.18) !important;
  border-radius: 20px !important;
  padding: 2px 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  margin-left: 6px;
}
.lang-btn {
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  padding: 3px 10px !important;
  cursor: pointer !important;
  border-radius: 14px !important;
  transition: all 0.2s ease !important;
  outline: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.lang-btn:hover {
  background: rgba(255, 255, 255, 0.25) !important;
}
.lang-btn.active {
  background: #72b01d !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}
