/* Radar de Mercado Specific Styles */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1001;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  background-color: #218838;
  transform: scale(1.05);
}

.mobile-menu-toggle i {
  font-size: 20px;
}

/* Hide hamburger button when sidebar is open */
.mobile-menu-toggle.hide {
  display: none !important;
}

/* Mobile close button (X) in sidebar */
.mobile-close-btn {
  display: none;
  color: #dc3545;
  font-size: 22px;
  padding: 5px 10px;
  border: none;
  background: transparent;
  transition: all 0.2s ease;
}

.mobile-close-btn:hover {
  background-color: rgba(220, 53, 69, 0.1);
  color: #c82333;
  transform: scale(1.1);
}

.mobile-close-btn i {
  font-weight: bold;
}

/* Desktop toggle button (chevron) */
.desktop-toggle-btn {
  display: block;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* Market Cards Styling */
.market-card {
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border-radius: 12px;
}

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

.market-card .card-body {
  padding: 1.75rem;
}

.market-card h3 {
  font-weight: 700;
  color: #2c3e50;
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.market-card .text-muted {
  font-size: 0.8rem;
  color: #6c757d !important;
}

/* Specific Icon Styles for Market Metrics */
.selic-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background-color: rgba(52, 144, 220, 0.1);
  color: #3490dc;
}

.ipca-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.financing-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background-color: rgba(138, 43, 226, 0.1);
  color: #8a2be2;
}

.incc-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background-color: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

/* Chart Container Styling */
.charts-section .card {
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}

.charts-section .card-header {
  border-bottom: 1px solid #f1f3f4;
  padding: 1.5rem 2rem;
  background-color: #ffffff;
  border-radius: 12px 12px 0 0;
}

.charts-section .card-body {
  padding: 2rem;
}

.charts-section .card-header h6 {
  color: #2c3e50;
  font-weight: 600;
  font-size: 1rem;
}

/* Evolution Chart Specific Styling */
#evolutionChart {
  max-height: 400px;
}

/* Market Data Animation */
@keyframes marketPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

.market-card:hover .metric-icon {
  animation: marketPulse 0.6s ease-in-out;
}

/* Responsive adjustments for market cards */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 250px !important;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  /* Hide desktop toggle button on mobile */
  .sidebar .desktop-toggle-btn {
    display: none !important;
  }

  /* Show mobile close button when sidebar is open */
  .sidebar.show .mobile-close-btn {
    display: block;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .main-content.sidebar-collapsed {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .header {
    padding: 1rem !important;
  }

  .header .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }

  .market-card .card-body {
    padding: 1.25rem;
  }

  .market-card h3 {
    font-size: 1.5rem;
  }

  .market-card .metric-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .charts-section .card-body {
    padding: 1rem;
  }

  .charts-section .card-header {
    padding: 1rem 1.5rem;
  }

  .metrics-section .col-md-3 {
    margin-bottom: 1rem;
  }
}

/* Desktop styles */
@media (min-width: 769px) {
  .mobile-close-btn {
    display: none !important;
  }

  .desktop-toggle-btn {
    display: block !important;
  }
}

/* Enhanced card borders with subtle gradients */
.market-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(90deg, #28a745, #20c997);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.market-card:hover::before {
  opacity: 1;
}

/* Market trend indicators */
.trend-up {
  color: #28a745 !important;
}

.trend-down {
  color: #dc3545 !important;
}

.trend-neutral {
  color: #6c757d !important;
}

/* Loading animation for charts */
.chart-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 400px;
  color: #6c757d;
}

.chart-loading::after {
  content: "";
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #28a745;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Custom tooltip styling for market data */
.market-tooltip {
  background-color: rgba(44, 62, 80, 0.95) !important;
  border: none !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.market-tooltip .tooltip-inner {
  padding: 8px 12px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Market indicators legend */
.market-legend {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6c757d;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-selic {
  background-color: #28a745;
}

.legend-ipca {
  background-color: #3490dc;
}

/* Enhanced focus states for accessibility */
.market-card:focus-within {
  outline: 2px solid #28a745;
  outline-offset: 2px;
}

/* Print styles for market reports */
@media print {
  .market-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #dee2e6;
  }

  .charts-section {
    page-break-inside: avoid;
  }
}

/* Highlights Section */
.highlights-section .card {
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background-color: #ffffff;
}

.highlight-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
  color: #000;
}

.highlight-title i {
  color: #28a745;
  font-size: 1.25rem;
}

.highlight-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.4;
}

.highlight-item:last-child {
  margin-bottom: 0;
}

.highlight-item i {
  color: #28a745;
  font-size: 0.75rem;
  margin-top: 0.35rem;
}