/* PrimeBusca - Theme moderno e profissional */
:root {
  /* Cores da identidade da Prime */
  --prime-gold: #f8c152;
  --prime-gold-light: #fad78e;
  --prime-bronze: #b06a25;
  --prime-bronze-light: #c17a35;
  --prime-bronze-dark: #9a5b20;
  --prime-dark: #1e293b;
  --prime-darker: #0f172a;
  
  /* Tema claro (padrão) */
  --primary: var(--prime-bronze);
  --primary-dark: var(--prime-bronze-dark);
  --secondary: var(--prime-gold);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --light: #f8fafc;
  --dark: #1e293b;
  --border: #e2e8f0;
  --text: #334155;
  --text-light: #64748b;
  --bg-main: #f9fafb;
  --bg-card: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --header-gradient: linear-gradient(120deg, var(--prime-darker), var(--prime-dark) 40%, var(--prime-bronze-dark) 80%);
  --radius: 6px;
  --transition: all 0.2s ease;
  --container-width: 1140px;
}

/* Tema escuro */
[data-theme="dark"] {
  --primary: var(--prime-gold);
  --primary-dark: #e5b142;
  --secondary: var(--prime-bronze-light);
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --light: #1e293b;
  --dark: #f8fafc;
  --border: #334155;
  --text: #e2e8f0;
  --text-light: #94a3b8;
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --header-gradient: linear-gradient(120deg, #000, var(--prime-darker) 50%, var(--prime-bronze-dark) 85%);
}

/* Reset e base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text);
  line-height: 1.5;
  background-color: var(--bg-main);
  padding: 0;
  margin: 0;
  transition: background-color 0.3s ease;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
  color: var(--dark);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

p {
  margin-bottom: 1rem;
}

/* Header e branding */
.app-header {
  background: var(--header-gradient);
  color: white;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  z-index: 2;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.logo {
  max-height: 65px;
  max-width: 200px;
  height: auto;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

.header-text {
  flex: 1;
}

.app-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  padding: 0;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.app-subtitle {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
  color: white;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* Theme Switcher */
.theme-switch-wrapper {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  z-index: 3;
}

.theme-switch {
  display: inline-block;
  height: 34px;
  position: relative;
  width: 60px;
}

.theme-switch input {
  display: none;
}

.slider {
  background-color: rgba(255, 255, 255, 0.3);
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  background-color: white;
  bottom: 4px;
  content: "";
  height: 26px;
  left: 4px;
  position: absolute;
  transition: .4s;
  width: 26px;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--prime-gold);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider-icons {
  color: white;
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  box-sizing: border-box;
  z-index: 1;
  pointer-events: none;
}

.slider-icons span {
  font-size: 12px;
}

/* Formulários */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark);
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--dark);
  background-color: var(--bg-card);
  background-clip: padding-box;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(176, 106, 37, 0.2);
}

/* Botões */
.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background-color: var(--primary);
  border-color: var(--primary);
}

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

/* Cards e contêineres */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Progresso */
.progress-container {
  margin: 1.5rem 0;
  background-color: var(--border);
  border-radius: var(--radius);
  height: 10px;
  overflow: hidden;
  display: none;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary);
  border-radius: var(--radius);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* Tabelas */
.table-container {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.9375rem;
}

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-weight: 600;
  color: var(--text-light);
  background-color: rgba(0, 0, 0, 0.02);
  white-space: nowrap;
}

[data-theme="dark"] .table th {
  background-color: rgba(255, 255, 255, 0.02);
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background-color: rgba(0, 0, 0, 0.01);
}

[data-theme="dark"] .table tr:hover td {
  background-color: rgba(255, 255, 255, 0.01);
}

/* Linhas de detalhe para avaliação */
.detail-row td {
  padding: 0;
  border-top: none;
}

.evaluation-details {
  padding: 1rem 1.5rem 1.5rem;
  background-color: rgba(0, 0, 0, 0.01);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .evaluation-details {
  background-color: rgba(255, 255, 255, 0.01);
}

.evaluation-title {
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.evaluation-content {
  line-height: 1.5;
  color: var(--text);
}

/* Estilização específica para as oportunidades */
.table tr.opportunity-high td {
  background-color: rgba(16, 185, 129, 0.05);
  border-left: 3px solid var(--success);
}

.table tr.opportunity-medium td {
  background-color: rgba(245, 158, 11, 0.05);
  border-left: 3px solid var(--warning);
}

[data-theme="dark"] .table tr.opportunity-high td {
  background-color: rgba(16, 185, 129, 0.1);
}

[data-theme="dark"] .table tr.opportunity-medium td {
  background-color: rgba(245, 158, 11, 0.1);
}

/* Score circle */
.score-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--prime-bronze);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.score-high {
  background-color: var(--success);
}

.score-medium {
  background-color: var(--warning);
}

.score-low {
  background-color: var(--secondary);
}

/* Warning icon */
.warning-icon {
  position: relative;
  display: inline-block;
  margin-left: 6px;
  color: var(--warning);
}

/* Alertas e mensagens */
.alert {
  position: relative;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
}

.alert-info {
  color: #055160;
  background-color: #cff4fc;
  border-color: #b6effb;
}

.alert-warning {
  color: #664d03;
  background-color: #fff3cd;
  border-color: #ffecb5;
}

.alert-danger {
  color: #842029;
  background-color: #f8d7da;
  border-color: #f5c2c7;
}

[data-theme="dark"] .alert-info {
  color: #b6effb;
  background-color: rgba(5, 81, 96, 0.8);
  border-color: #055160;
}

[data-theme="dark"] .alert-warning {
  color: #ffecb5;
  background-color: rgba(102, 77, 3, 0.8);
  border-color: #664d03;
}

[data-theme="dark"] .alert-danger {
  color: #f5c2c7;
  background-color: rgba(132, 32, 41, 0.8);
  border-color: #842029;
}

/* Nota informativa */
.note-box {
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-top: 1.5rem;
  border-left: 3px solid var(--secondary);
}

[data-theme="dark"] .note-box {
  background-color: rgba(255, 255, 255, 0.02);
}

.note-box h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.note-box ul {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.note-box li {
  margin-bottom: 0.5rem;
}

.note-box p {
  margin-bottom: 0;
}

/* Valores monetários */
.price-tag {
  font-weight: 600;
  white-space: nowrap;
}

.price-difference {
  font-weight: 500;
}

.price-positive {
  color: var(--success);
}

.price-negative {
  color: var(--danger);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease-in-out;
}

.modal-content {
  position: relative;
  background-color: var(--bg-card);
  margin: 10% auto;
  padding: 0;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 500px;
  animation: slideDown 0.3s ease-in-out;
}

.modal-header {
  padding: 1rem 1.5rem;
  background-color: var(--danger);
  color: white;
  font-weight: 600;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background-color: rgba(0, 0, 0, 0.02);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  text-align: right;
}

[data-theme="dark"] .modal-footer {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Estilos específicos para os novos modais */
.cleanup-icon {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

.warning-box {
  background-color: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

[data-theme="dark"] .warning-box {
  background-color: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.4);
}

.warning-box .warning-icon {
  color: #f59e0b;
  font-size: 1rem;
}

/* Botão de perigo para ações destrutivas */
.btn-danger {
  background-color: var(--danger);
  color: white;
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
  transform: translateY(-1px);
}

/* Botão outline para ações secundárias */
.btn-outline {
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background-color: var(--border);
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-outline {
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

@keyframes slideDown {
  0% { transform: translateY(-50px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Responsividade - para telas menores */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .theme-switch-wrapper {
    position: static;
    justify-content: center;
    margin-top: 1rem;
  }
  
  .logo {
    max-height: 50px;
  }
  
  .table th, 
  .table td {
    padding: 0.5rem;
  }
  
  .score-circle {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
  
  .btn {
    padding: 0.625rem 1.25rem;
  }
  
  .app-title {
    font-size: 1.5rem;
  }

  .evaluation-details {
    padding: 0.75rem;
  }
}

/* Utilitários */
.mt-4 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.text-center {
  text-align: center;
}

.d-none {
  display: none;
}

.font-bold {
  font-weight: 600;
}

.text-small {
  font-size: 0.875rem;
}

.text-muted {
  color: var(--text-light);
}

/* Animações */
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

/* Interface de progresso moderna */
.modern-progress-container {
  margin: 20px 0;
  padding: 20px;
  background-color: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.progress-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.progress-stats {
  display: flex;
  gap: 25px;
  margin-bottom: 20px;
}

.progress-stat {
  flex: 1;
  text-align: center;
  padding: 12px;
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius);
}

[data-theme="dark"] .progress-stat {
  background-color: rgba(255, 255, 255, 0.02);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-light);
}

.modern-progress-bar-container {
  height: 16px;
  background-color: var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.modern-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 8px;
  transition: width 0.5s ease;
  position: relative;
}

.progress-percentage {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 15px;
}

.processing-detail {
  margin-top: 20px;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
}

[data-theme="dark"] .processing-detail {
  background-color: rgba(255, 255, 255, 0.02);
  border-left-color: var(--primary);
}

.detail-title {
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--dark);
}

.detail-content {
  font-size: 14px;
  line-height: 1.5;
}

.progress-stage {
  display: flex;
  margin-top: 20px;
}

.stage-item {
  flex: 1;
  text-align: center;
  padding: 10px 5px;
  position: relative;
}

.stage-item::after {
  content: "";
  position: absolute;
  top: 25px;
  right: 0;
  width: 100%;
  height: 3px;
  background-color: var(--border);
  z-index: 1;
}

.stage-item:last-child::after {
  display: none;
}

.stage-indicator {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  position: relative;
  z-index: 2;
  font-weight: 600;
  color: var(--text-light);
}

.stage-indicator.active {
  background-color: var(--primary);
  color: white;
}

.stage-indicator.completed {
  background-color: var(--success);
  color: white;
}

.stage-name {
  font-size: 12px;
  margin-top: 5px;
  color: var(--text-light);
}

.activity-log {
  margin-top: 20px;
  max-height: 150px;
  overflow-y: auto;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.5;
}

[data-theme="dark"] .activity-log {
  background-color: rgba(255, 255, 255, 0.02);
}

.log-entry {
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-time {
  color: var(--text-light);
  margin-right: 5px;
}

.log-message {
  color: var(--text);
}

.error-log {
  color: var(--danger);
}

.success-log {
  color: var(--success);
}

.time-estimate {
  text-align: center;
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-light);
}

.status-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  background-color: var(--border);
  color: var(--text);
}

/* Estilo específico para dispositivos móveis */
@media (max-width: 768px) {
  .progress-stats {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .progress-stat {
    flex: 1 0 40%;
  }
  
  .progress-stage {
    flex-wrap: wrap;
  }
  
  .stage-item {
    flex: 1 0 50%;
    margin-bottom: 20px;
  }
  
  .stage-item::after {
    display: none;
  }
}

/* Animação de pulse para indicar processamento ativo */
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  animation: pulse 1.5s ease-in-out infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.3);
  }
}

/* Estilo para mensagens de progresso com ícones */
#progressStatus {
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Animação de fade-in para logs */
.log-entry {
  animation: fadeInLog 0.3s ease-in;
}

@keyframes fadeInLog {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Barra de progresso indeterminada */
.indeterminate-progress-wrapper {
  width: 100%;
  height: 4px;
  background-color: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 15px 0;
  position: relative;
}

.indeterminate-progress-bar {
  height: 100%;
  background: linear-gradient(90deg,
    var(--prime-gold) 0%,
    var(--prime-bronze) 50%,
    var(--prime-gold) 100%);
  background-size: 200% 100%;
  animation: indeterminateProgress 2s ease-in-out infinite;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(248, 193, 82, 0.5);
}

@keyframes indeterminateProgress {
  0% {
    transform: translateX(-100%);
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    transform: translateX(100%);
    background-position: 0% 50%;
  }
}

/* Estilo aprimorado para o status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background-color: var(--success);
  color: white;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}