/* page-overrides.css - Layout fixes for SPA fragment pages
 * These !important overrides handle z-index conflicts, sidebar overlap,
 * and layout issues when standalone-designed pages are loaded as fragments.
 * TODO: Refactor pages to use proper CSS scoping to remove !important hacks.
 */
/**
 * 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;
  }
}

/* Compliance Page Styles */
.glass-card { background: rgba(30, 41, 59, 0.8); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem; }
.score-gauge { text-align: center; padding: 2rem; }
.gauge-wrapper { position: relative; width: 200px; height: 200px; margin: 0 auto; }
.gauge-circle { width: 200px; height: 200px; border-radius: 50%; background: conic-gradient(#22c55e var(--score, 0%), #1e293b var(--score, 0%)); display: flex; align-items: center; justify-content: center; }
.gauge-value { position: relative; z-index: 1; font-size: 3rem; font-weight: 700; color: #fff; }
.license-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.5rem; }
.license-cell { padding: 0.5rem; border-radius: 8px; text-align: center; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.license-cell.active { background: rgba(34, 197, 94, 0.2); border: 1px solid #22c55e; color: #22c55e; }
.license-cell.pending { background: rgba(234, 179, 8, 0.2); border: 1px solid #eab308; color: #eab308; }
.license-cell.inactive { background: rgba(100, 116, 139, 0.2); border: 1px solid #475569; color: #64748b; }
.checklist-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; background: rgba(30, 41, 59, 0.5); border-radius: 8px; margin-bottom: 0.5rem; cursor: pointer; transition: background 0.2s; }
.checklist-item:hover { background: rgba(30, 41, 59, 0.8); }
.checklist-item.completed { opacity: 0.7; }
.dnc-input { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.dnc-input input { flex: 1; background: rgba(15, 23, 42, 0.8); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 0.5rem 1rem; color: #fff; }
.dnc-input button { padding: 0.5rem 1rem; background: #3b82f6; color: #fff; border: none; border-radius: 8px; cursor: pointer; }
.audit-entry { padding: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.competitive-edge { background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(59, 130, 246, 0.1)); border: 1px solid rgba(34, 197, 94, 0.2); border-radius: 12px; padding: 1.5rem; }

/* Dashboard Shared Styles */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.stat-card { background: rgba(30, 41, 59, 0.8); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 1.5rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: #fff; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.overview-card { background: rgba(30, 41, 59, 0.6); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 1.5rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.kpi-card { background: rgba(30, 41, 59, 0.8); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 1rem; text-align: center; }
.revenue-hero { background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2)); border: 1px solid rgba(139, 92, 246, 0.3); border-radius: 16px; padding: 2rem; text-align: center; }
.metric-card { background: rgba(30, 41, 59, 0.7); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 1.25rem; }
.empire-title { font-family: 'Orbitron', monospace; font-size: 1.5rem; color: #f1c40f; text-shadow: 0 0 10px rgba(241, 196, 15, 0.3); }
