/* Neraca88 additions: Market Dashboard */
.market-card {
  transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  cursor: pointer;
  height: 100%;
  min-height: 140px;
  border: 1px solid var(--bs-border-color);
}

.market-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme='dark'] .market-card:hover {
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Market grid responsive layout */
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

@media (max-width: 768px) {
  .market-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .market-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* Status dots */
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  flex-shrink: 0;
}

.status-green {
  background-color: #16a34a;
}
.status-yellow {
  background-color: #f59e0b;
}
.status-red {
  background-color: #ef4444;
}
.status-gray {
  background-color: #9ca3af;
}
.status-blue {
  background-color: #3b82f6;
}

/* Card backgrounds - improved readability */
.market-card.bg-success-subtle {
  background-color: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.2);
}

.market-card.bg-warning-subtle {
  background-color: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
}

.market-card.bg-danger-subtle {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

.market-card.bg-primary-subtle {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
}

.market-card.bg-neutral-200 {
  background-color: rgba(156, 163, 175, 0.1);
  border-color: rgba(156, 163, 175, 0.2);
}

/* Dark mode overrides */
[data-theme='dark'] .market-card.bg-success-subtle {
  background-color: rgba(22, 163, 74, 0.15);
  border-color: rgba(22, 163, 74, 0.3);
  color: #e5e7eb;
}

[data-theme='dark'] .market-card.bg-warning-subtle {
  background-color: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #e5e7eb;
}

[data-theme='dark'] .market-card.bg-danger-subtle {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #e5e7eb;
}

[data-theme='dark'] .market-card.bg-primary-subtle {
  background-color: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #e5e7eb;
}

[data-theme='dark'] .market-card.bg-neutral-200 {
  background-color: rgba(156, 163, 175, 0.15);
  border-color: rgba(156, 163, 175, 0.3);
  color: #e5e7eb;
}

/* Text contrast improvements */
.market-card h6 {
  color: var(--bs-body-color);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.3;
}

.market-card .text-secondary-light {
  color: var(--bs-secondary-color) !important;
  font-size: 0.85rem;
}

[data-theme='dark'] .market-card .text-secondary-light {
  color: #9ca3af !important;
}

/* Status text - larger and more readable */
.market-status {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--bs-body-color);
  display: flex;
  align-items: center;
}

.market-result {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bs-body-color);
}

[data-theme='dark'] .market-result {
  color: #f3f4f6;
}

/* Legend styling */
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.legend-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 768px) {
  .legend-wrapper {
    gap: 0.75rem;
  }

  .legend-item {
    font-size: 0.85rem;
  }
}

/* Market logo styling */
.market-logo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--bs-border-color);
}

/* Force badge styling */
.badge-force {
  border: 1px dashed currentColor;
  font-size: 0.7rem;
  padding: 0.25em 0.5em;
}

/* Card link styling */
.market-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.market-card-link:hover {
  color: inherit;
  text-decoration: none;
}

/* Loading and empty states */
.market-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--bs-secondary-color);
}

.market-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

/* Priority indicators */
.priority-high .market-card {
  border-left: 4px solid #ef4444;
}

.priority-medium .market-card {
  border-left: 4px solid #f59e0b;
}

.priority-low .market-card {
  border-left: 4px solid #10b981;
}

/* Global dark mode text improvements */
[data-theme='dark'] .text-muted {
  color: #9ca3af !important;
}

[data-theme='dark'] .text-secondary {
  color: #d1d5db !important;
}

[data-theme='dark'] .text-secondary-light {
  color: #9ca3af !important;
}

/* Ensure good contrast for card text in dark mode */
[data-theme='dark'] .card .text-muted,
[data-theme='dark'] .card .text-secondary,
[data-theme='dark'] .card .text-secondary-light {
  color: #d1d5db !important;
}
