/**
 * X-Ray Assessment Styles
 * Clean, powerful, simple diagnostic cards
 */

/* ═══════════════════════════════════════════════════════════
   SUMMARY PANEL
   ═══════════════════════════════════════════════════════════ */

.xray-summary-panel {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 2px solid #44f21d;
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 40px;
  box-shadow: 0 8px 32px rgba(68, 242, 29, 0.15);
}

.xray-summary-panel h3 {
  color: #44f21d;
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 24px 0;
  text-align: center;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.stat-item:hover {
  border-color: #44f21d;
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(68, 242, 29, 0.2);
}

.stat-item.urgency-high {
  border-color: #FF6B6B;
}

.stat-item.urgency-medium {
  border-color: #FFD93D;
}

.stat-item.urgency-low {
  border-color: #6BCF7F;
}

.stat-number {
  display: block;
  font-size: 48px;
  font-weight: 800;
  color: #44f21d;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-item.urgency-high .stat-number {
  color: #FF6B6B;
}

.stat-item.urgency-medium .stat-number {
  color: #FFD93D;
}

.stat-item.urgency-low .stat-number {
  color: #6BCF7F;
}

.stat-label {
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.summary-insight {
  background: rgba(68, 242, 29, 0.1);
  border-left: 4px solid #44f21d;
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 8px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
}

.summary-insight strong {
  color: #44f21d;
  font-weight: 700;
}

/* PHASE 2: Sphere Breakdown Bars */
.sphere-breakdown {
  margin: 24px 0;
}

.sphere-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sphere-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sphere-label {
  min-width: 160px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.sphere-bar-container {
  flex: 1;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sphere-bar-fill {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.sphere-count {
  min-width: 40px;
  text-align: right;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}

/* Sphere Color Classes */
.sphere-self .sphere-bar-fill {
  background: linear-gradient(90deg, #44f21d 0%, rgba(68, 242, 29, 0.7) 100%);
}

.sphere-relational .sphere-bar-fill {
  background: linear-gradient(90deg, #40e0d0 0%, rgba(64, 224, 208, 0.7) 100%);
}

.sphere-community .sphere-bar-fill {
  background: linear-gradient(90deg, #9B59B6 0%, rgba(155, 89, 182, 0.7) 100%);
}

.sphere-cultural .sphere-bar-fill {
  background: linear-gradient(90deg, #E67E22 0%, rgba(230, 126, 34, 0.7) 100%);
}

.sphere-critical .sphere-bar-fill {
  background: linear-gradient(90deg, #E74C3C 0%, rgba(231, 76, 60, 0.7) 100%);
}

/* Stat Cards with new naming */
.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: #44f21d;
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(68, 242, 29, 0.2);
}

.stat-card.urgency-high {
  border-color: #FF6B6B;
}

.stat-card.urgency-medium {
  border-color: #FFD93D;
}

.stat-card.urgency-low {
  border-color: #6BCF7F;
}

.stat-value {
  display: block;
  font-size: 48px;
  font-weight: 800;
  color: #44f21d;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card.urgency-high .stat-value {
  color: #FF6B6B;
}

.stat-card.urgency-medium .stat-value {
  color: #FFD93D;
}

.stat-card.urgency-low .stat-value {
  color: #6BCF7F;
}

.summary-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(68, 242, 29, 0.3);
}

.summary-action {
  text-align: center;
  margin-top: 24px;
}

.dashboard-btn {
  display: inline-block;
  background: linear-gradient(135deg, #44f21d 0%, #40e0d0 100%);
  color: #000;
  padding: 16px 48px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(68, 242, 29, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dashboard-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(68, 242, 29, 0.5);
}

/* ═══════════════════════════════════════════════════════════
   X-RAY CARDS CONTAINER
   ═══════════════════════════════════════════════════════════ */

.xray-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

@media (max-width: 768px) {
  .xray-cards-container {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════
   X-RAY CARD COMPONENT
   ═══════════════════════════════════════════════════════════ */

.xray-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.xray-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Urgency-specific borders */
.xray-card.urgency-high {
  border-color: #FF6B6B;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.2);
}

.xray-card.urgency-high:hover {
  box-shadow: 0 8px 32px rgba(255, 107, 107, 0.4);
}

.xray-card.urgency-medium {
  border-color: #FFD93D;
  box-shadow: 0 4px 16px rgba(255, 217, 61, 0.2);
}

.xray-card.urgency-medium:hover {
  box-shadow: 0 8px 32px rgba(255, 217, 61, 0.4);
}

.xray-card.urgency-low {
  border-color: #6BCF7F;
  box-shadow: 0 4px 16px rgba(107, 207, 127, 0.2);
}

.xray-card.urgency-low:hover {
  box-shadow: 0 8px 32px rgba(107, 207, 127, 0.4);
}

/* ═══════════════════════════════════════════════════════════
   CARD HEADER
   ═══════════════════════════════════════════════════════════ */

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.variable-icon {
  font-size: 24px;
  line-height: 1;
}

.card-header h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.urgency-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #000;
}

.urgency-badge.high {
  background-color: #FF6B6B;
}

.urgency-badge.medium {
  background-color: #FFD93D;
}

.urgency-badge.low {
  background-color: #6BCF7F;
}

/* ═══════════════════════════════════════════════════════════
   CARD BODY
   ═══════════════════════════════════════════════════════════ */

.card-body {
  padding: 24px;
}

.core-limitation,
.hidden-cost {
  margin-bottom: 20px;
}

.core-limitation strong,
.hidden-cost strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: #44f21d;
}

.core-limitation p,
.hidden-cost p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

.impact-spheres {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.impact-spheres strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.sphere-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sphere-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.sphere-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════════════════════════════════════════
   CARD FOOTER
   ═══════════════════════════════════════════════════════════ */

.card-footer {
  padding: 0 24px 24px 24px;
}

.view-solution-btn {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #44f21d 0%, #40e0d0 100%);
  color: #000;
  text-align: center;
  padding: 14px 24px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(68, 242, 29, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.view-solution-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(68, 242, 29, 0.5);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .xray-summary-panel {
    padding: 24px 16px;
  }
  
  .xray-summary-panel h3 {
    font-size: 24px;
  }
  
  .summary-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-number {
    font-size: 36px;
  }
  
  .stat-label {
    font-size: 12px;
  }
  
  .dashboard-btn {
    padding: 14px 32px;
    font-size: 16px;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .urgency-badge {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  .summary-stats {
    grid-template-columns: 1fr;
  }
  
  .xray-cards-container {
    gap: 16px;
  }
  
  .card-body {
    padding: 20px 16px;
  }
  
  .card-header h4 {
    font-size: 18px;
  }
  
  .core-limitation p,
  .hidden-cost p {
    font-size: 14px;
  }
}

/* ═══════════════════════════════════════════════════════════
   LOADING STATES
   ═══════════════════════════════════════════════════════════ */

.xray-loading {
  text-align: center;
  padding: 60px 20px;
}

.xray-loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(68, 242, 29, 0.2);
  border-top-color: #44f21d;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.xray-loading-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════ */

.xray-empty {
  text-align: center;
  padding: 80px 20px;
  color: rgba(255, 255, 255, 0.5);
}

.xray-empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.xray-empty-message {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.xray-empty-hint {
  font-size: 14px;
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.xray-card {
  animation: fadeIn 0.5s ease-out;
}

.xray-card:nth-child(1) { animation-delay: 0.1s; }
.xray-card:nth-child(2) { animation-delay: 0.2s; }
.xray-card:nth-child(3) { animation-delay: 0.3s; }
.xray-card:nth-child(4) { animation-delay: 0.4s; }
.xray-card:nth-child(5) { animation-delay: 0.5s; }
.xray-card:nth-child(n+6) { animation-delay: 0.6s; }

/* ═══════════════════════════════════════════════════════════
   DARK MODE OPTIMIZATION
   ═══════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  .xray-summary-panel {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  }
  
  .xray-card {
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
  }
}

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════ */

.xray-card:focus-within {
  outline: 3px solid #44f21d;
  outline-offset: 2px;
}

.view-solution-btn:focus {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .xray-card {
    border-width: 3px;
  }
  
  .urgency-badge,
  .view-solution-btn {
    font-weight: 900;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .xray-card,
  .stat-item,
  .view-solution-btn {
    transition: none;
    animation: none;
  }
}
