/* SERP Core Web Vitals Analyzer Styles */

.serp-cwv-container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Poppins', sans-serif;
  background: #fff;
}

/* Form */
.serp-cwv-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  margin-top: 40px;
  padding: 24px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.serp-cwv-form input[type="text"] {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  line-height: 1.5;
  font-size: 16px;
  color: #000;
  background: #fff;
  font-family: 'Poppins', Helvetica, Arial, Lucida, sans-serif;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.serp-cwv-form input[type="text"]:focus {
  outline: none;
  border-color: #667eea;
  border-width: 2px;
}

.serp-cwv-form select {
  flex: 0 0 auto;
  min-width: 150px;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
  color: #000;
  font-family: 'Poppins', Helvetica, Arial, Lucida, sans-serif;
  cursor: pointer;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
  height: 48px;
  line-height: 1.5;
}

.serp-cwv-form select:focus {
  outline: none;
  border-color: #667eea;
  border-width: 2px;
}

.serp-cwv-form button[type="submit"] {
  flex: 0 0 auto;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  background-color: #000;
  font-family: 'Poppins', Helvetica, Arial, Lucida, sans-serif;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.serp-cwv-form button[type="submit"]:hover {
  background: #333;
}

/* Loading */
.serp-cwv-loading {
  text-align: center;
  padding: 60px 20px;
}

.loader-animation {
  width: 60px;
  height: 60px;
  border: 4px solid #e5e7eb;
  border-top-color: #667eea;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.serp-cwv-loading p {
  color: #374151;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}

.loader-detail {
  color: #6b7280;
  font-size: 14px;
}

/* Results */
.serp-cwv-results {
  margin-top: 30px;
}

/* Chart Container */
.serp-cwv-chart-container {
  margin-bottom: 10px;
}

.serp-cwv-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.serp-cwv-chart-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #000;
}

.serp-cwv-metric-select {
  padding: 10px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  color: #000;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.serp-cwv-metric-select:focus {
  outline: none;
  border-color: #667eea;
}

#serp-cwv-chart {
  max-height: 400px;
  width: 100% !important;
  height: 400px !important;
}

/* Table Container */
.serp-cwv-table-container {
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
}

.serp-cwv-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.serp-cwv-table thead {
  background: #f8f9fa;
}

.serp-cwv-table th {
  padding: 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}

.serp-cwv-table th:nth-child(2) {
  width: 300px;
}

.serp-cwv-table tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.2s ease;
}

.serp-cwv-table tbody tr:hover {
  background: #f9fafb;
}

.serp-cwv-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: #374151;
}

.serp-cwv-table td:first-child {
  font-weight: 500;
}

/* Domain and URL in same cell */
.domain-url-wrapper {
  max-width: 400px;
}

.domain-url-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.domain-line {
  font-weight: 600;
  color: #000;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lightning-icons {
  display: inline-flex;
  gap: 3px;
  margin-right: 6px;
  align-items: center;
}

.lightning-icon {
  font-size: 16px;
  color: #F6A228;
  opacity: 1;
  display: inline-block;
  font-style: normal;
  line-height: 1;
  font-weight: bold;
}

.lightning-icons .lightning-icon:nth-child(1) {
  color: #F6A228;
}

.lightning-icons .lightning-icon:nth-child(2) {
  color: #F6A228;
}

.lightning-icons .lightning-icon:nth-child(3) {
  color: #24C789;
}

.metrics-source-icon {
  font-size: 12px;
  color: #667eea;
  opacity: 0.7;
}

.url-line {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-line a {
  color: #667eea;
  text-decoration: none;
}

.url-line a:hover {
  text-decoration: underline;
}

.number-cell {
  font-family: 'Courier New', monospace;
  text-align: right;
  font-weight: 600;
}

.na-value {
  color: #9ca3af;
  font-style: italic;
}

/* Metric value color coding based on Core Web Vitals thresholds */
.number-cell.metric-good {
  background-color: #d1fae5;
  color: #065f46;
  font-weight: 700;
}

.number-cell.metric-needs-improvement {
  background-color: #fef3c7;
  color: #92400e;
  font-weight: 700;
}

.number-cell.metric-poor {
  background-color: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}


/* CWV Score Column */
.cwv-cell {
  font-weight: 600;
  text-align: center;
  padding: 14px 16px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cwv-cell.cwv-excellent {
  background-color: #d1fae5;
  color: #065f46;
}

.cwv-cell.cwv-très-bon {
  background-color: #a7f3d0;
  color: #047857;
}

.cwv-cell.cwv-bon {
  background-color: #fef3c7;
  color: #92400e;
}

.cwv-cell.cwv-médiocre {
  background-color: #fed7aa;
  color: #9a3412;
}

.cwv-cell.cwv-mauvais {
  background-color: #fee2e2;
  color: #991b1b;
}

/* Data source alert */
.serp-cwv-data-source-alert {
  margin-top: 16px;
  margin-bottom: 8px;
}

.data-source-alert-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 6px;
  font-size: 13px;
  color: #6b7280;
}

.data-source-alert-content i {
  font-size: 14px;
  color: #9ca3af;
}

/* Analysis */
.serp-cwv-analysis {
  margin-top: 30px;
  margin-bottom: 30px;
}

.analysis-container {
  padding: 10px;
}

.analysis-title {
  margin: 0 0 14px 0;
  font-size: 20px;
  font-weight: 600;
  color: #000;
}

.analysis-conclusion {
  background: #fff;
  margin-bottom: 5px;
}

.conclusion-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.conclusion-header i {
  font-size: 20px;
  color: #7B7DFE;
}

.conclusion-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.conclusion-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #374151;
}

.analysis-evidence,
.analysis-examples,
.analysis-counter-examples,
.analysis-recommendations {
  margin-bottom: 24px;
}

.analysis-evidence h4,
.analysis-examples h4,
.analysis-counter-examples h4,
.analysis-recommendations h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

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

.evidence-list li {
  padding: 12px 16px;
  margin-bottom: 8px;
  background: #fff;
  border-radius: 6px;
  border-left: 3px solid #667eea;
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
}

.example-item,
.counter-example-item {
  padding: 12px 16px;
  margin-bottom: 12px;
  background: #fff;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.example-item {
  border-left: 3px solid #24C789;
}

.counter-example-item {
  border-left: 3px solid #FC554F;
}

.example-item strong,
.counter-example-item strong {
  color: #000;
  display: block;
  margin-bottom: 4px;
}

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

.recommendations-list li {
  padding: 12px 16px;
  margin-bottom: 8px;
  background: #fff;
  border-radius: 6px;
  border-left: 3px solid #F6A228;
  font-size: 14px;
  line-height: 1.5;
  color: #374151;
}

.recommendations-list li:before {
  content: '→ ';
  color: #F6A228;
  font-weight: bold;
  margin-right: 6px;
}

.analysis-empty {
  text-align: center;
  color: #6b7280;
  font-style: italic;
  padding: 20px;
  background: #f9fafb;
  border-radius: 8px;
}

/* Correlations */
.serp-cwv-correlations {
  margin-top: 30px;
}

.correlations-grid {
  background: #f9fafb;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.correlations-grid h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: #000;
}

.correlations-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-start;
}

.correlation-item {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all 0.2s ease;
  min-width: 150px;
  flex: 0 0 auto;
}

.correlation-item:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.correlation-metric {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.correlation-value {
  font-size: 28px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

.correlation-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Correlation colors */
.correlation-value.strong,
.correlation-label.strong {
  color: #24C789;
}

.correlation-value.moderate,
.correlation-label.moderate {
  color: #F6A228;
}

.correlation-value.weak,
.correlation-label.weak {
  color: #FC554F;
}

.correlation-value.very-weak,
.correlation-label.very-weak {
  color: #9ca3af;
}

.no-correlation {
  text-align: center;
  color: #6b7280;
  font-style: italic;
  padding: 20px;
}

/* Search History */
.serp-cwv-history {
  margin-top: 40px;
  padding: 20px;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

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

.history-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.clear-history-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Poppins', sans-serif;
}

.clear-history-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.history-select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  color: #000;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.history-select:focus {
  outline: none;
  border-color: #667eea;
}

.history-select option {
  padding: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .serp-cwv-form {
    flex-direction: column;
    align-items: stretch;
  }

  .serp-cwv-form input[type="text"],
  .serp-cwv-form select {
    max-width: none;
    width: 100%;
  }

  .serp-cwv-chart-header {
    flex-direction: column;
    align-items: stretch;
  }

  .serp-cwv-table {
    font-size: 12px;
  }

  .serp-cwv-table th,
  .serp-cwv-table td {
    padding: 10px 8px;
  }

  .correlations-list {
    grid-template-columns: 1fr;
  }
}

