/* ===== ADVANCED MODULES STYLES ===== */

/* Chart Cards Enhancement */
.chart-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  border-left: 4px solid #218d8d;
  transition: box-shadow 0.3s ease;
}

.chart-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chart-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #133452;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
}

/* Descontos Module */
#descontos-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.summary-item {
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid #ef8860;
}

.summary-item h4 {
  font-size: 0.9rem;
  color: #626c71;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 600;
}

.summary-item .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #133452;
}

.summary-item .percentage {
  font-size: 0.85rem;
  color: #218d8d;
  margin-top: 4px;
}

/* Produto Analise Module */
#produto-analise-content .charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

/* Vendedor Analise Module */
#vendedor-analise-content .charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

/* Heatmap Calendar */
#heatmap-calendar {
  background: white;
  border-radius: 8px;
  padding: 16px;
}

.heatmap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.heatmap-table th,
.heatmap-table td {
  padding: 8px;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.heatmap-table th {
  background: #f0f4f8;
  font-weight: 600;
  color: #133452;
}

.heatmap-cell {
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.heatmap-cell:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(33, 141, 141, 0.3);
}

.heatmap-cell.empty {
  background: #f8fafc;
  color: #bdc3c7;
}

.heatmap-cell.low {
  background: #e8f5f5;
  color: #218d8d;
}

.heatmap-cell.medium {
  background: #b3dede;
  color: #0d4f4f;
}

.heatmap-cell.high {
  background: #6bb8b8;
  color: white;
}

.heatmap-cell.very-high {
  background: #218d8d;
  color: white;
  font-weight: 600;
}

/* Rankings and Lists */
.ranking-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: #f8fafc;
  border-radius: 6px;
  margin-bottom: 10px;
  gap: 12px;
}

.ranking-position {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #218d8d;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
}

.ranking-position.gold {
  background: #ffd700;
  color: #333;
}

.ranking-position.silver {
  background: #c0c0c0;
  color: #333;
}

.ranking-position.bronze {
  background: #cd7f32;
  color: white;
}

.ranking-info {
  flex: 1;
}

.ranking-name {
  font-weight: 600;
  color: #133452;
  margin-bottom: 4px;
}

.ranking-details {
  font-size: 0.85rem;
  color: #626c71;
}

.ranking-value {
  text-align: right;
  font-weight: 700;
  color: #218d8d;
  font-size: 1.1rem;
}

/* Module Loading States */
.module-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 400px;
  color: #626c71;
  font-size: 1rem;
}

.module-loading::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 12px;
  border: 3px solid #e2e8f0;
  border-radius: 50%;
  border-top-color: #218d8d;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error States */
.module-error {
  background: #fef5f5;
  border: 2px solid #ef8860;
  border-radius: 8px;
  padding: 20px;
  color: #c5192d;
  margin: 20px 0;
}

.module-error h4 {
  margin-bottom: 8px;
  font-weight: 600;
}

/* Data Table for Module Results */
.module-data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.module-data-table th {
  background: #f0f4f8;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #133452;
  border-bottom: 2px solid #e2e8f0;
}

.module-data-table td {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #626c71;
}

.module-data-table tr:hover {
  background: #f8fafc;
}

/* Responsive */
@media (max-width: 1024px) {
  #produto-analise-content .charts-grid,
  #vendedor-analise-content .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .heatmap-table {
    font-size: 0.75rem;
  }

  .heatmap-table th,
  .heatmap-table td {
    padding: 4px;
  }

  .ranking-item {
    flex-direction: column;
    text-align: center;
  }

  .ranking-value {
    text-align: center;
  }

  #descontos-summary {
    grid-template-columns: 1fr;
  }
}
