/* Custom styles for GRQ FX Validation Dashboard */

/* Custom color variables */
:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
}

/* FX Pair Card Styles */
.fx-pair-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #dee2e6;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fx-pair-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.fx-pair-card h6 {
  font-weight: 600;
}

.fx-pair-card .h5 {
  font-weight: 700;
}

/* Prediction Summary Styles */
.prediction-summary {
  font-size: 0.85rem;
  color: #6c757d;
}

.prediction-change {
  font-weight: 600;
}

.prediction-change.positive {
  color: #28a745;
}

.prediction-change.negative {
  color: #dc3545;
}

/* Pending Status */
.pending {
  color: #6c757d;
  font-style: italic;
}

.prediction-date {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 1rem;
}

/* Header gradient - fix the white on white issue */
.header-gradient {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  ) !important;
  color: white !important;
}

.header-gradient h1,
.header-gradient p {
  color: white !important;
}

/* Chart container - make it much taller and more prominent */
.chart-container {
  position: relative;
  height: 600px; /* Increased from 400px to 600px */
  margin-bottom: 2rem;
  padding-top: 20px; /* Add padding to ensure title is visible */
}

/* Ensure Chart.js title is visible */
.chart-container canvas {
  margin-bottom: 0;
}

/* Chart.js title styling */
.chart-container canvas + div {
  margin-top: 10px;
}

/* Chart.js legend positioning */
.chartjs-legend {
  margin-top: 10px;
  text-align: center;
}

/* Loading and message styles */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--secondary-color);
}

.error {
  border-left: 4px solid var(--danger-color);
}

.no-data {
  border-left: 4px solid var(--info-color);
}

/* Table styles */
.fx-table th {
  background: var(--light-color);
  font-weight: 600;
  color: var(--dark-color);
  border-bottom: 2px solid #dee2e6;
}

.fx-table tr:hover {
  background: var(--light-color);
}

/* Performance indicators */
.performance-positive {
  color: var(--success-color) !important;
  font-weight: bold;
}

.performance-negative {
  color: var(--danger-color) !important;
  font-weight: bold;
}

.performance-neutral {
  color: var(--dark-color) !important;
}

/* Clickable FX pair names */
.clickable-fx-pair {
  cursor: pointer;
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: bold;
}

.clickable-fx-pair:hover {
  color: var(--secondary-color);
}

/* Accuracy badges */
.accuracy-high {
  background-color: var(--success-color) !important;
  color: white !important;
}

.accuracy-medium {
  background-color: var(--warning-color) !important;
  color: var(--dark-color) !important;
}

.accuracy-low {
  background-color: var(--danger-color) !important;
  color: white !important;
}

/* FX pair totals row styling */
.table-info {
  background-color: rgba(102, 126, 234, 0.1) !important;
  border-top: 2px solid var(--primary-color);
}

.table-info td {
  font-weight: 600;
  color: var(--dark-color);
}

/* FX summary info styling */
.fx-summary {
  background-color: var(--light-color);
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin-top: 1rem;
  border-left: 4px solid var(--primary-color);
}

/* FX pair detail card styling */
#fxPairDetailCard {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

#fxPairDetailCard .card-header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  border-bottom: none;
  padding: 1rem 1.5rem;
}

#fxPairDetailCard .card-header h5 {
  color: white;
  margin: 0;
  font-weight: 600;
}

#fxPairDetailCard .card-body {
  padding: 1.5rem;
}

#fxPairDetailCard .row .row {
  margin-bottom: 0.5rem;
}

#fxPairDetailCard .row .row:last-child {
  margin-bottom: 0;
}

#fxPairDetailCard h6 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .chart-container {
    height: 400px; /* Still taller than before on mobile */
  }

  /* Hide chart legend on mobile devices */
  .chart-container canvas + div,
  .chartjs-legend {
    display: none !important;
  }
}

/* Additional mobile detection for touch devices */
@media (hover: none) and (pointer: coarse) {
  .chart-container canvas + div,
  .chartjs-legend {
    display: none !important;
  }
}

/* Custom form controls */
.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Custom button styles */
.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

/* Animation for loading states */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.loading-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Mobile-friendly table */
@media (max-width: 768px) {
  .table-responsive {
    font-size: 0.8rem;
  }

  .table th,
  .table td {
    padding: 0.5rem 0.25rem;
  }

  .table th {
    font-size: 0.7rem;
  }

  .badge {
    font-size: 0.6rem;
    padding: 0.25rem 0.5rem;
  }

  /* Hide less important columns on mobile */
  .table th:nth-child(3),
  .table td:nth-child(3),
  .table th:nth-child(4),
  .table td:nth-child(4),
  .table th:nth-child(5),
  .table td:nth-child(5) {
    display: none;
  }
}

/* Mobile-friendly buttons */
@media (max-width: 768px) {
  .btn {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
  }

  .btn-sm {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Mobile-friendly cards */
@media (max-width: 768px) {
  .card-body {
    padding: 1rem;
  }
}

/* Mobile-friendly form controls */
@media (max-width: 768px) {
  .form-select,
  .form-control {
    font-size: 0.9rem;
    padding: 0.375rem 0.75rem;
  }

  .form-label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
  }
}

/* Ensure proper spacing on mobile */
@media (max-width: 768px) {
  .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }

  .col,
  .col-md-6,
  .col-lg-4 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .mb-4 {
    margin-bottom: 1.5rem !important;
  }

  .mb-3 {
    margin-bottom: 1rem !important;
  }
}

/* Detailed FX pair view styles */
.fx-pair-detail-view .table-responsive {
  overflow-x: auto;
  max-width: 100%;
}

.fx-pair-detail-view .table th,
.fx-pair-detail-view .table td {
  white-space: nowrap;
  min-width: 80px;
}

.fx-pair-detail-view .table th:first-child,
.fx-pair-detail-view .table td:first-child {
  min-width: 120px;
}

.fx-pair-detail-view .table th:last-child,
.fx-pair-detail-view .table td:last-child {
  white-space: normal;
  min-width: 200px;
  max-width: 300px;
}

/* Error styling */
.error-small {
  color: var(--danger-color);
  font-weight: 500;
}

.error-medium {
  color: var(--warning-color);
  font-weight: 500;
}

.error-large {
  color: var(--danger-color);
  font-weight: 600;
}

/* Mobile adjustments for detailed view */
@media (max-width: 768px) {
  .fx-pair-detail-view .table th,
  .fx-pair-detail-view .table td {
    font-size: 0.7rem;
    padding: 0.3rem 0.2rem;
  }

  .fx-pair-detail-view .table th:last-child,
  .fx-pair-detail-view .table td:last-child {
    min-width: 150px;
    max-width: 200px;
  }

  /* Hide some columns on mobile for detailed view */
  .fx-pair-detail-view .table th:nth-child(4),
  .fx-pair-detail-view .table td:nth-child(4),
  .fx-pair-detail-view .table th:nth-child(5),
  .fx-pair-detail-view .table td:nth-child(5),
  .fx-pair-detail-view .table th:nth-child(7),
  .fx-pair-detail-view .table td:nth-child(7),
  .fx-pair-detail-view .table th:nth-child(8),
  .fx-pair-detail-view .table td:nth-child(8) {
    display: none;
  }

  /* Mobile adjustments for FX pair detail card */
  #fxPairDetailCard .card-body {
    padding: 1rem;
  }

  #fxPairDetailCard .row .row {
    margin-bottom: 0.75rem;
  }

  #fxPairDetailCard .row .row .col-6 {
    padding: 0.25rem 0.5rem;
  }

  #fxPairDetailCard h6 {
    font-size: 0.7rem;
    margin-bottom: 0.75rem;
  }
}

.clickable-value {
  cursor: pointer;
  color: #007bff;
  transition: color 0.2s ease;
}
.clickable-value:hover {
  color: #0056b3;
}
.clickable-value:active {
  color: #004085;
}

/* Ensure debug info is always visible */
#debug-info {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-size: 0.7rem !important;
  color: #6c757d !important;
  word-break: break-word;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* Mobile adjustments for debug info */
@media (max-width: 768px) {
  #debug-info {
    font-size: 0.6rem !important;
    padding: 0 0.5rem;
  }
}

/* Mobile-specific styles */
@media (max-width: 768px) {
  .chart-container {
    height: 300px;
  }

  /* Force hide chart legend on mobile */
  .chartjs-legend {
    display: none !important;
  }

  /* Alternative selector for Chart.js legend */
  canvas + div[style*='position: relative'] {
    display: none !important;
  }

  /* Hide any element that might be the legend */
  .chart-container canvas + div {
    display: none !important;
  }
}

/* Ensure debug info is always visible */
.debug-info {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: static !important;
  z-index: 9999 !important;
}
