/**
 * Page-Specific Overrides
 * Ensures consistency across pages with embedded inline styles
 */

/* Force Orbitron on all stat numbers regardless of inline styles */
h1, h2, h3, h4, h5, h6 {
  font-family: inherit !important;
}

[style*="Orbitron"],
[style*="font-family"] h1,
[style*="font-family"] h2,
[style*="font-family"] h3,
.tier-score,
#overallGrade,
[class*="score"],
[class*="stat"],
[class*="metric"] [style*="font-weight: 700"],
[style*="font-weight: 800"] {
  font-family: 'Orbitron', sans-serif !important;
}

/* Ensure all inline background colors match our design system */
[style*="rgba(15,23,42"],
[style*="rgba(15, 23, 42"] {
  background: rgba(15, 23, 42, 0.8) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

/* Ensure all inline borders match our design system */
[style*="border: 1px solid rgba(59,130,246"],
[style*="border: 1px solid rgba(59, 130, 246"],
[style*="border: 2px solid rgba(59,130,246"],
[style*="border: 2px solid rgba(59, 130, 246"] {
  border-color: rgba(59, 130, 246, 0.2) !important;
}

/* Force hover states on all button-like elements */
[style*="cursor: pointer"],
button,
.btn,
[class*="button"],
[id*="Btn"],
[id*="Button"] {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[style*="cursor: pointer"]:hover,
button:hover,
.btn:hover,
[class*="button"]:hover,
[id*="Btn"]:hover:not(:disabled),
[id*="Button"]:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3) !important;
}

/* Ensure all cards have consistent styling */
[style*="border-radius: 16px"],
[style*="border-radius: 20px"],
[style*="border-radius: 24px"] {
  border-radius: 16px !important;
}

/* Add missing animations to containers */
.ai-coach-container > div,
.automation-container > div,
.dialer-container > div,
[style*="display: grid"] > div,
[style*="display: flex; flex-direction: column"] > div {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
  opacity: 0;
}

.ai-coach-container > div:nth-child(1) { animation-delay: 0.1s !important; }
.ai-coach-container > div:nth-child(2) { animation-delay: 0.2s !important; }
.ai-coach-container > div:nth-child(3) { animation-delay: 0.3s !important; }
.ai-coach-container > div:nth-child(4) { animation-delay: 0.4s !important; }

/* Primary gradient buttons consistency */
[style*="background: linear-gradient(135deg, #3B82F6, #06B6D4)"],
[style*="background: linear-gradient(135deg, #3b82f6, #06b6d4)"] {
  background: linear-gradient(135deg, #3B82F6, #06B6D4) !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

/* Pulse animation for live indicators */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

[style*="animation: pulse"] {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
}

/* Glow pulse for scores/grades */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px currentColor;
  }
  50% {
    box-shadow: 0 0 40px currentColor, 0 0 60px currentColor;
  }
}

[style*="animation: glowPulse"] {
  animation: glowPulse 3s ease-in-out infinite !important;
}

/* Ensure text colors match design system */
[style*="color: #fff"],
[style*="color: #ffffff"],
[style*="color: white"] {
  color: #FFFFFF !important;
}

[style*="color: #94a3b8"] {
  color: #94A3B8 !important;
}

[style*="color: #3B82F6"],
[style*="color: #3b82f6"] {
  color: #3B82F6 !important;
}

[style*="color: #06B6D4"],
[style*="color: #06b6d4"] {
  color: #06B6D4 !important;
}

[style*="color: #22C55E"],
[style*="color: #22c55e"] {
  color: #22C55E !important;
}

[style*="color: #EAB308"],
[style*="color: #eab308"] {
  color: #EAB308 !important;
}

[style*="color: #EF4444"],
[style*="color: #ef4444"] {
  color: #EF4444 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  [style*="display: grid; grid-template-columns: 1fr 1fr"],
  [style*="display: grid; grid-template-columns: repeat(2, 1fr)"],
  [style*="display: grid; grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  
  [style*="max-width: 1600px"],
  [style*="max-width: 1400px"],
  [style*="max-width: 1200px"] {
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}
