/* CSS do Analisador SEO - Estilo RD Station */

#seo-analyzer {
  padding: 0;
  max-width: 100%;
  margin: 0 auto;
  background: var(--bg-color);
}

/* Header Section - Estilo RD Station */
.seo-header {
  background: linear-gradient(135deg, #00a5a5 0%, #003d5b 100%);
  padding: 40px 30px;
  text-align: center;
  color: white;
  border-radius: 0 0 20px 20px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.seo-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: radial-gradient(
    ellipse,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.seo-header h1.seo-title,
.seo-header h2,
.seo-header h1 {
  font-size: 2.2rem;
  color: white !important;
  margin-bottom: 10px;
  font-weight: 700;
}

.seo-header p,
.seo-header .seo-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: 0;
}

/* Formulário de Busca */
.seo-search-container {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  margin: -20px 30px 30px;
  border: 1px solid var(--border-color);
  position: relative;
  z-index: 10;
}

.seo-search-form {
  display: grid;
  grid-template-columns: 2fr 1.5fr auto;
  gap: 15px;
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 500;
  color: var(--text-color);
}

.form-group input {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus {
  border-color: #00a5a5;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 165, 165, 0.1);
}

.btn-analyze,
#seo-analyze-btn {
  padding: 12px 30px;
  background: linear-gradient(135deg, #00a5a5, #003d5b);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-analyze:hover,
#seo-analyze-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 165, 165, 0.3);
}

.btn-analyze:disabled,
#seo-analyze-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Loading State */
.seo-loading {
  text-align: center;
  padding: 60px;
  display: none;
}

.seo-loading.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.loading-spinner,
.loader {
  border: 4px solid var(--border-color);
  border-top: 4px solid #00a5a5;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Resultados Container */
.seo-results {
  display: none;
  animation: fadeIn 0.5s ease;
  padding: 0 30px 30px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Score Geral - Gauge Circular */
.score-gauge-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #00a5a5 0%, #003d5b 100%);
  border-radius: 16px;
  margin-bottom: 30px;
  position: relative;
}

.score-gauge {
  position: relative;
  width: 180px;
  height: 180px;
}

.score-gauge svg {
  transform: rotate(-90deg);
}

.score-gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 12;
}

.score-gauge-fill {
  fill: none;
  stroke: #fff;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  transition: stroke-dashoffset 1.5s ease-out;
}

.score-gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
}

.score-gauge-value .score-number {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

.score-gauge-value .score-percent {
  font-size: 1.5rem;
  font-weight: 400;
}

.score-gauge-value .score-label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-top: 5px;
}

.score-gauge-info {
  margin-left: 40px;
  color: white;
  max-width: 350px;
}

.score-gauge-info h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.score-gauge-info p {
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.5;
}

.score-gauge-info .btn-optimize {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background: white;
  color: #003d5b;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s;
}

.score-gauge-info .btn-optimize:hover {
  transform: translateY(-2px);
}

/* Seções de Análise */
.seo-analysis-section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 25px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
}

.section-score {
  font-size: 1.2rem;
  font-weight: 700;
  color: #00a5a5;
  margin-left: 10px;
}

.section-score.score-good {
  color: #10b981;
}
.section-score.score-medium {
  color: #f59e0b;
}
.section-score.score-bad {
  color: #ef4444;
}

.section-description {
  color: var(--text-color-light);
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Progress Bar da Seção */
.section-progress {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

.section-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease-out;
}

.section-progress-fill.good {
  background: linear-gradient(90deg, #10b981, #34d399);
}
.section-progress-fill.medium {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.section-progress-fill.bad {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Check Items Grid */
.check-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  background: var(--bg-color);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.check-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.check-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.check-icon.passed {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.check-icon.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.check-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.check-content {
  flex: 1;
}

.check-title {
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.check-description {
  color: var(--text-color-light);
  font-size: 0.85rem;
  line-height: 1.4;
}

.check-value {
  color: #00a5a5;
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Recomendações */
.recommendations-section {
  background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
  border: 1px solid #ffc107;
  border-radius: 16px;
  padding: 25px;
  margin-top: 30px;
}

[data-theme="dark"] .recommendations-section {
  background: linear-gradient(135deg, #2d2a1f 0%, #3d3520 100%);
  border-color: #b38600;
}

.recommendations-section h3 {
  color: #b38600;
  font-size: 1.3rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.recommendation-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rec-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  border-left: 4px solid var(--border-color);
}

[data-theme="dark"] .rec-item {
  background: rgba(0, 0, 0, 0.2);
}

.rec-item.priority-alta {
  border-left-color: #ef4444;
}
.rec-item.priority-média {
  border-left-color: #f59e0b;
}
.rec-item.priority-baixa {
  border-left-color: #10b981;
}

.rec-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.rec-content {
  flex: 1;
}

.rec-content h4 {
  margin: 0 0 5px 0;
  font-size: 1rem;
  color: var(--text-color);
}

.rec-content p {
  margin: 0;
  color: var(--text-color-light);
  font-size: 0.9rem;
}

/* Erro */
.seo-error {
  text-align: center;
  padding: 40px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  border-radius: 12px;
  margin: 30px;
  color: #ef4444;
}

.seo-error i {
  font-size: 2rem;
  margin-bottom: 15px;
}

/* Responsivo */
@media (max-width: 768px) {
  .seo-search-form {
    grid-template-columns: 1fr;
  }

  .score-gauge-container {
    flex-direction: column;
    text-align: center;
  }

  .score-gauge-info {
    margin-left: 0;
    margin-top: 25px;
  }

  .check-items-grid {
    grid-template-columns: 1fr;
  }

  .seo-results {
    padding: 0 15px 15px;
  }

  .seo-search-container {
    margin: -20px 15px 20px;
  }
}

/* Ilustrações e CTA Final */
.seo-cta-section {
  background: linear-gradient(135deg, #00a5a5 0%, #003d5b 100%);
  border-radius: 16px;
  padding: 40px;
  margin-top: 30px;
  text-align: center;
  color: white;
}

.seo-cta-section h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.seo-cta-section p {
  opacity: 0.9;
  margin-bottom: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.seo-cta-section .btn-cta {
  display: inline-block;
  padding: 12px 30px;
  background: white;
  color: #003d5b;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s;
}

.seo-cta-section .btn-cta:hover {
  transform: translateY(-2px);
}

/* Legacy compatibility - Score Cards antigos */
.score-cards-grid,
.seo-score-cards {
  display: none !important;
}

.seo-section {
  display: none !important;
}

/* Mostrar novas seções */
.seo-results-new {
  display: block;
}

/* ============================================
   SEO ANALYZER - Dark Mode Overrides
   ============================================ */

/* Cards de Projeto SEO */
html[data-theme="dark"] .seo-project-card,
html[data-theme="dark"] #seo-projects-grid .seo-project-card {
  background: rgba(30, 30, 45, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .seo-project-card:hover {
  border-color: #00a5a5 !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 165, 165, 0.2) !important;
}

/* Textos nos cards */
html[data-theme="dark"] .seo-project-card h3,
html[data-theme="dark"] .seo-project-card .project-name {
  color: #ffffff !important;
}

html[data-theme="dark"] .seo-project-card p,
html[data-theme="dark"] .seo-project-card .project-desc,
html[data-theme="dark"] .seo-project-card span {
  color: #a1a1aa !important;
}

html[data-theme="dark"] .seo-project-card .stat-label,
html[data-theme="dark"] .seo-project-card small {
  color: #71717a !important;
}

html[data-theme="dark"] .seo-project-card .stat-value {
  color: #ffffff !important;
}

/* Container de projetos SEO */
html[data-theme="dark"] #seo-projects-container h2,
html[data-theme="dark"] .seo-projects-title {
  color: #ffffff !important;
}

/* Seções de análise */
html[data-theme="dark"] .seo-analysis-section {
  background: rgba(30, 30, 45, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .section-title h3 {
  color: #ffffff !important;
}

html[data-theme="dark"] .section-description {
  color: #a1a1aa !important;
}

/* Check items */
html[data-theme="dark"] .check-item {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .check-title {
  color: #ffffff !important;
}

html[data-theme="dark"] .check-description {
  color: #a1a1aa !important;
}

/* Search container */
html[data-theme="dark"] .seo-search-container {
  background: rgba(30, 30, 45, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .seo-search-container input {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .seo-search-container label {
  color: #ffffff !important;
}

/* Modal de novo projeto */
html[data-theme="dark"] #new-seo-project-modal .modal-content {
  background: #1e1e2e !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] #new-seo-project-modal .modal-title,
html[data-theme="dark"] #new-seo-project-modal h3 {
  color: #ffffff !important;
}

html[data-theme="dark"] #new-seo-project-modal .form-label,
html[data-theme="dark"] #new-seo-project-modal label {
  color: #ffffff !important;
}

html[data-theme="dark"] #new-seo-project-modal input,
html[data-theme="dark"] #new-seo-project-modal textarea {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] #new-seo-project-modal input::placeholder,
html[data-theme="dark"] #new-seo-project-modal textarea::placeholder {
  color: #71717a !important;
}
