/* ============================================================================
   EMPTY STATES
   Beautiful, helpful empty state components
   ============================================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  min-height: 400px;
}

.empty-state-compact {
  min-height: 300px;
  padding: 40px 24px;
}

.empty-state-small {
  min-height: 200px;
  padding: 32px 16px;
}

/* Empty State Icon */
.empty-state-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 102, 0, 0.1) 0%, rgba(255, 102, 0, 0.05) 100%);
  border-radius: 50%;
  position: relative;
  animation: float 3s ease-in-out infinite;
}

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

.empty-state-icon::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 102, 0, 0.2);
  animation: rotate 20s linear infinite;
}

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

.empty-state-icon svg,
.empty-state-icon img {
  width: 64px;
  height: 64px;
  color: var(--accent-primary, #ff6600);
  opacity: 0.8;
}

.empty-state-compact .empty-state-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
}

.empty-state-compact .empty-state-icon svg,
.empty-state-compact .empty-state-icon img {
  width: 48px;
  height: 48px;
}

.empty-state-small .empty-state-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 12px;
}

.empty-state-small .empty-state-icon svg,
.empty-state-small .empty-state-icon img {
  width: 32px;
  height: 32px;
}

/* Empty State Content */
.empty-state-content {
  max-width: 480px;
}

.empty-state-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary, #e6edf3);
  margin-bottom: 12px;
  line-height: 1.3;
}

.empty-state-compact .empty-state-title {
  font-size: 20px;
  margin-bottom: 8px;
}

.empty-state-small .empty-state-title {
  font-size: 18px;
  margin-bottom: 8px;
}

.empty-state-description {
  font-size: 16px;
  color: var(--text-secondary, #8b949e);
  margin-bottom: 24px;
  line-height: 1.6;
}

.empty-state-compact .empty-state-description {
  font-size: 14px;
  margin-bottom: 20px;
}

.empty-state-small .empty-state-description {
  font-size: 13px;
  margin-bottom: 16px;
}

/* Empty State Actions */
.empty-state-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.empty-state-action-primary,
.empty-state-action-secondary {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.empty-state-action-primary {
  background: var(--accent-primary, #ff6600);
  color: white;
  border: none;
  cursor: pointer;
}

.empty-state-action-primary:hover {
  background: var(--accent-hover, #ff8533);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(255, 102, 0, 0.3);
}

.empty-state-action-secondary {
  background: transparent;
  color: var(--text-primary, #e6edf3);
  border: 1px solid var(--border-primary, #30363d);
  cursor: pointer;
}

.empty-state-action-secondary:hover {
  background: var(--bg-elevated, #1a222d);
  border-color: var(--accent-primary, #ff6600);
}

/* Empty State Variants */

/* No Data Variant */
.empty-state-no-data .empty-state-icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.empty-state-no-data .empty-state-icon::before {
  border-color: rgba(59, 130, 246, 0.2);
}

.empty-state-no-data .empty-state-icon svg {
  color: #d97757;
}

/* Error Variant */
.empty-state-error .empty-state-icon {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
}

.empty-state-error .empty-state-icon::before {
  border-color: rgba(239, 68, 68, 0.2);
}

.empty-state-error .empty-state-icon svg {
  color: #ef4444;
}

/* Success Variant */
.empty-state-success .empty-state-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.empty-state-success .empty-state-icon::before {
  border-color: rgba(16, 185, 129, 0.2);
}

.empty-state-success .empty-state-icon svg {
  color: #00c853;
}

/* Search Results Variant */
.empty-state-search .empty-state-icon {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
}

.empty-state-search .empty-state-icon::before {
  border-color: rgba(168, 85, 247, 0.2);
}

.empty-state-search .empty-state-icon svg {
  color: #c4875e;
}

/* Helper Text & Links */
.empty-state-help {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border-primary, #30363d);
  max-width: 640px;
  width: 100%;
}

.empty-state-help-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #e6edf3);
  margin-bottom: 12px;
}

.empty-state-help-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.empty-state-help-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-secondary, #8b949e);
}

.empty-state-help-list li::before {
  content: '→';
  color: var(--accent-primary, #ff6600);
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}

.empty-state-help-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 16px;
}

.empty-state-help-link {
  font-size: 13px;
  color: var(--accent-primary, #ff6600);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.empty-state-help-link:hover {
  text-decoration: underline;
  gap: 8px;
}

/* Illustration Background Pattern */
.empty-state-illustration {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  background-image: radial-gradient(circle at 20% 50%, currentColor 1px, transparent 1px),
                    radial-gradient(circle at 80% 80%, currentColor 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--accent-primary, #ff6600);
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .empty-state {
    padding: 40px 16px;
    min-height: 320px;
  }

  .empty-state-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
  }

  .empty-state-icon svg,
  .empty-state-icon img {
    width: 56px;
    height: 56px;
  }

  .empty-state-title {
    font-size: 20px;
  }

  .empty-state-description {
    font-size: 14px;
  }

  .empty-state-actions {
    flex-direction: column;
    width: 100%;
  }

  .empty-state-action-primary,
  .empty-state-action-secondary {
    width: 100%;
    justify-content: center;
  }

  .empty-state-help {
    margin-top: 24px;
    padding-top: 24px;
  }

  .empty-state-help-links {
    flex-direction: column;
    gap: 12px;
  }
}

/* Dark Mode Adjustments (already default) */

/* Light Mode */
[data-theme="light"] .empty-state-icon {
  background: linear-gradient(135deg, rgba(255, 102, 0, 0.08) 0%, rgba(255, 102, 0, 0.03) 100%);
}

[data-theme="light"] .empty-state-icon::before {
  border-color: rgba(255, 102, 0, 0.15);
}

[data-theme="light"] .empty-state-title {
  color: #111827;
}

[data-theme="light"] .empty-state-description {
  color: #8b909b;
}

[data-theme="light"] .empty-state-action-secondary {
  color: #111827;
  border-color: #e5e7eb;
  background: transparent;
}

[data-theme="light"] .empty-state-action-secondary:hover {
  background: #f3f4f6;
  border-color: #ff6600;
}

[data-theme="light"] .empty-state-help {
  border-top-color: #e5e7eb;
}

[data-theme="light"] .empty-state-help-title {
  color: #111827;
}

[data-theme="light"] .empty-state-help-list li {
  color: #8b909b;
}

/* Accessibility */
.empty-state[role="status"],
.empty-state[role="alert"] {
  /* Screen readers will announce this */
}

/* Animation Classes */
.empty-state.fade-in {
  animation: fadeIn 0.5s ease-out;
}

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

/* ============================================================================
   IX-EMPTY-STATE — shared Bloomberg-style block
   Used by: market.ejs, risk.ejs, tax-dashboard.ejs (and any future page).
   ix- prefix avoids collision with the legacy `.empty-state` patterns above.
   ============================================================================ */
.ix-empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 56px 32px; margin: 24px auto; max-width: 480px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  font-family: 'Inter', 'Poppins', -apple-system, sans-serif;
}
.ix-empty-icon {
  font-size: 38px !important; color: #d97757;
  background: rgba(217, 119, 87, 0.08);
  width: 64px; height: 64px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.ix-empty-title {
  font-family: 'Source Serif Pro','Source Serif 4', Georgia, serif;
  font-size: 19px; font-weight: 600; color: #ecead2;
  margin: 0 0 6px; letter-spacing: -0.012em;
}
.ix-empty-body {
  font-size: 13px; color: #b8b2a4;
  margin: 0 0 18px; line-height: 1.55; max-width: 360px;
}
.ix-empty-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  background: #d97757; color: #0a0a09;
  border: 1px solid #d97757; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.ix-empty-cta:hover {
  background: #f0875e; border-color: #f0875e; transform: translateY(-1px);
}
.ix-empty-cta .material-symbols-outlined { font-size: 16px; }
.ix-empty-cta-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12); color: #b8b2a4;
}
.ix-empty-cta-ghost:hover {
  border-color: rgba(255,255,255,0.22); color: #ecead2; background: transparent;
}

/* === Inline error — for failed fetches === */
.ix-inline-error {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; margin: 16px 0;
  background: rgba(196, 98, 93, 0.06);
  border: 1px solid rgba(196, 98, 93, 0.25);
  border-radius: 10px;
  font-family: 'Inter', sans-serif; font-size: 13px; color: #ecead2;
}
.ix-inline-error .material-symbols-outlined {
  color: #c4625d; font-size: 18px !important;
  flex-shrink: 0; margin-top: 1px;
}
.ix-inline-error-text { flex: 1; line-height: 1.55; }
.ix-inline-error-text strong { color: #c4625d; font-weight: 600; }
.ix-inline-error-retry {
  background: transparent;
  border: 1px solid rgba(196, 98, 93, 0.4); color: #c4625d;
  padding: 5px 12px; border-radius: 6px;
  font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ix-inline-error-retry:hover {
  background: rgba(196, 98, 93, 0.12); color: #ecead2;
}
