/**
 * Tech Detector Styles - Estilos do Analisador de Tecnologia
 */

/* Container Principal */
#tech-detector {
  display: none;
  padding: 20px;
  background: var(--bg-secondary, #f5f5f5);
  min-height: calc(100vh - 60px);
}

/* Input Section */
.tech-input-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.tech-input-header {
  text-align: center;
  margin-bottom: 40px;
}

.tech-input-header i {
  font-size: 3rem;
  background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tech-input-header h2 {
  color: var(--text-primary, #333);
  margin: 15px 0 10px;
  font-size: 1.8rem;
}

.tech-input-header p {
  color: var(--text-secondary, #666);
  font-size: 1rem;
}

/* URL Input Form */
.tech-input-form {
  margin-bottom: 30px;
}

.tech-url-input {
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px 15px;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.tech-url-input:focus-within {
  border-color: #4361ee;
  box-shadow: 0 4px 20px rgba(67, 97, 238, 0.15);
}

.tech-url-input i {
  color: #9ca3af;
  font-size: 1.2rem;
}

.tech-url-input input {
  flex: 1;
  border: none;
  font-size: 1rem;
  outline: none;
  padding: 12px 0;
  background: transparent;
}

/* Analysis Options */
.tech-analysis-options {
  display: flex;
  gap: 12px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.tech-analysis-options .btn-analyze {
  flex: 1;
  min-width: 180px;
  background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s;
  font-size: 0.95rem;
}

.tech-analysis-options .btn-analyze:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.tech-analysis-options .btn-analyze.btn-deep {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.tech-analysis-options .btn-analyze.btn-deep:hover {
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.deep-scan-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9ca3af;
  font-size: 0.85rem;
  margin-top: 15px;
  padding: 10px;
  background: rgba(67, 97, 238, 0.05);
  border-radius: 8px;
}

.deep-scan-info i {
  color: #4361ee;
}

/* Features Grid */
.tech-features {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin: 30px 0;
}

.tech-features .feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tech-features .feature i {
  font-size: 1.5rem;
  color: #4361ee;
}

.tech-features .feature span {
  font-size: 0.85rem;
  color: #6b7280;
}

.tech-my-projects {
  text-align: center;
  margin-top: 30px;
}

.tech-my-projects .btn-secondary {
  background: white;
  border: 2px solid #4361ee;
  color: #4361ee;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.tech-my-projects .btn-secondary:hover {
  background: #4361ee;
  color: white;
}

/* Loading */
.tech-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 20px;
}

.tech-loading .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e5e7eb;
  border-top-color: #4361ee;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.tech-loading p {
  color: #6b7280;
  font-size: 1rem;
}

/* Analysis Results */
.tech-analysis-result {
  max-width: 1000px;
  margin: 0 auto;
}

.tech-result-header {
  background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 25px;
  color: white;
}

.tech-url-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.tech-url-info i {
  font-size: 1.2rem;
}

.tech-url-info a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.tech-stats {
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
}

.tech-stats span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  opacity: 0.9;
}

.tech-actions {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.tech-actions button {
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.tech-actions .btn-save-project {
  background: #10b981;
  color: white;
  border: none;
}

.tech-actions .btn-save-project:hover {
  background: #059669;
}

.tech-actions .btn-new-analysis {
  background: white;
  color: #4361ee;
  border: 2px solid #4361ee;
}

.tech-actions .btn-new-analysis:hover {
  background: #4361ee;
  color: white;
}

/* Category Groups */
.tech-category-group {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tech-category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 12px;
  margin-bottom: 15px;
}

.tech-category-header span:first-of-type {
  font-weight: 600;
  color: #1f2937;
}

.tech-category-header .tech-count {
  background: #f3f4f6;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  color: #6b7280;
}

.tech-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
}

/* Tech Card */
.tech-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
}

.tech-card:hover {
  border-color: #4361ee;
  box-shadow: 0 2px 8px rgba(67, 97, 238, 0.1);
}

.tech-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tech-icon i {
  font-size: 1.2rem;
  color: #4361ee;
}

.tech-info {
  flex: 1;
}

.tech-info h4 {
  margin: 0 0 5px;
  font-size: 0.9rem;
  color: #1f2937;
}

.tech-confidence {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  position: relative;
  display: flex;
  align-items: center;
}

.tech-confidence .confidence-bar {
  height: 100%;
  border-radius: 2px;
  background: #10b981;
  transition: width 0.3s;
}

.tech-confidence.high .confidence-bar {
  background: #10b981;
}
.tech-confidence.medium .confidence-bar {
  background: #f59e0b;
}
.tech-confidence.low .confidence-bar {
  background: #ef4444;
}

.tech-confidence span {
  position: absolute;
  right: 0;
  top: -16px;
  font-size: 0.7rem;
  color: #9ca3af;
}

.tech-website {
  color: #9ca3af;
  font-size: 0.9rem;
  padding: 5px;
}

.tech-website:hover {
  color: #4361ee;
}

/* Projects */
.tech-projects-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.tech-projects-header h2 {
  margin: 0;
  color: white !important;
}

.tech-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.tech-project-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

.tech-project-card .project-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 10px;
}

.tech-project-card h3 {
  margin: 0;
  color: #1f2937;
}

.tech-project-card .project-count {
  background: #e0e7ff;
  color: #4338ca;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.tech-project-card .project-desc {
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0 0 10px;
}

.tech-project-card .project-meta {
  color: #9ca3af;
  font-size: 0.8rem;
  margin-bottom: 15px;
}

.tech-project-card .project-actions {
  display: flex;
  gap: 10px;
}

.tech-project-card .btn-view {
  flex: 1;
  background: #4361ee;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.tech-project-card .btn-delete {
  background: #fef2f2;
  color: #ef4444;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

/* Empty State */
.tech-empty-state {
  text-align: center;
  padding: 60px 20px;
}

.tech-empty-state i {
  font-size: 4rem;
  color: #d1d5db;
  margin-bottom: 20px;
}

.tech-empty-state h3 {
  color: #374151;
  margin-bottom: 10px;
}

.tech-empty-state p {
  color: #6b7280;
  margin-bottom: 20px;
}

/* Project Detail */
.tech-project-detail {
  max-width: 900px;
  margin: 0 auto;
}

.tech-project-detail .btn-back {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 15px;
}

.tech-analyses-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.tech-analysis-item {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tech-analysis-item .analysis-header h4 {
  margin: 0 0 5px;
  color: #1f2937;
}

.tech-analysis-item .analysis-header a {
  color: #4361ee;
  font-size: 0.85rem;
}

.tech-analysis-item .analysis-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tech-badge {
  background: #f3f4f6;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tech-badge i {
  font-size: 0.75rem;
  color: #4361ee;
}

.tech-analysis-item .more {
  color: #9ca3af;
  font-size: 0.8rem;
}

.tech-analysis-item .analysis-date {
  color: #9ca3af;
  font-size: 0.8rem;
}

/* Modal */
.tech-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.tech-modal-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.tech-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.tech-modal-header h3 {
  margin: 0;
  color: #1f2937;
}

.tech-modal-header .btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #9ca3af;
}

.tech-modal-body {
  padding: 20px;
}

.tech-modal-body .form-group {
  margin-bottom: 20px;
}

.tech-modal-body label {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-weight: 500;
}

.tech-modal-body input,
.tech-modal-body select {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
}

.tech-modal-body input:focus,
.tech-modal-body select:focus {
  border-color: #4361ee;
  outline: none;
}

.tech-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid #e5e7eb;
}

.tech-modal-footer .btn-cancel {
  background: white;
  border: 2px solid #e5e7eb;
  color: #6b7280;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}

.tech-modal-footer .btn-save {
  background: #4361ee;
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Version Badge */
.tech-version {
  display: inline-block;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 5px;
  vertical-align: middle;
  letter-spacing: 0.3px;
}

/* Implied Tech Card */
.tech-card-implied {
  border-style: dashed !important;
  border-color: #c4b5fd !important;
  background: #faf5ff !important;
  opacity: 0.92;
}

.tech-card-implied .tech-icon {
  background: #ede9fe;
}

.tech-card-implied .tech-icon i {
  color: #7c3aed;
}

/* Implied By Badge */
.tech-implied-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: #d97706;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 8px;
  margin-bottom: 4px;
  font-weight: 500;
}

.tech-implied-badge i {
  font-size: 0.6rem;
}

/* DB Version Badge */
.tech-db-badge {
  background: rgba(255, 255, 255, 0.2) !important;
  padding: 3px 10px !important;
  border-radius: 12px;
  font-size: 0.78rem !important;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Dark Mode */
[data-theme="dark"] #tech-detector {
  background: var(--bg-secondary, #1a1a2e);
}

[data-theme="dark"] .tech-input-header h2 {
  color: #fff;
}

[data-theme="dark"] .tech-url-input {
  background: #2d2d3d;
  border-color: #3d3d4d;
}

[data-theme="dark"] .tech-url-input input {
  color: #fff;
}

[data-theme="dark"] .tech-features .feature {
  background: #2d2d3d;
}

[data-theme="dark"] .tech-category-group,
[data-theme="dark"] .tech-project-card,
[data-theme="dark"] .tech-analysis-item,
[data-theme="dark"] .tech-modal-content {
  background: #2d2d3d;
  border-color: #3d3d4d;
}

[data-theme="dark"] .tech-card {
  background: #1a1a2e;
  border-color: #3d3d4d;
}

[data-theme="dark"] .tech-card-implied {
  background: #2a1f3d !important;
  border-color: #6d28d9 !important;
}

[data-theme="dark"] .tech-card-implied .tech-icon {
  background: #3b2a5e;
}

[data-theme="dark"] .tech-implied-badge {
  background: #422006;
  color: #fbbf24;
}

[data-theme="dark"] .tech-category-header span:first-of-type,
[data-theme="dark"] .tech-project-card h3,
[data-theme="dark"] .tech-info h4 {
  color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
  .tech-url-input {
    flex-wrap: wrap;
  }

  .tech-url-input input {
    width: 100%;
  }

  .tech-url-input .btn-analyze {
    width: 100%;
    justify-content: center;
  }

  .tech-items-grid {
    grid-template-columns: 1fr;
  }

  .tech-projects-grid {
    grid-template-columns: 1fr;
  }
}

/* Projetos na página inicial */
.tech-saved-projects {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid #e5e7eb;
}

.tech-projects-grid-home {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
}

.tech-project-card-mini {
  background: white;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s;
}

.tech-project-card-mini:hover {
  border-color: #4361ee;
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.15);
  transform: translateY(-2px);
}

.project-header-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.project-header-mini h4 {
  margin: 0;
  font-size: 0.95rem;
  color: #1f2937;
}

.project-count-mini {
  background: #e0e7ff;
  color: #4338ca;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
}

.project-meta-mini {
  color: #9ca3af;
  font-size: 0.8rem;
}

.project-meta-mini i {
  margin-right: 4px;
}

/* Dark Mode para projetos na página inicial */
[data-theme="dark"] .tech-saved-projects {
  border-top-color: #3d3d4d;
}

[data-theme="dark"] .tech-project-card-mini {
  background: #2d2d3d;
  border-color: #3d3d4d;
}

[data-theme="dark"] .project-header-mini h4 {
  color: #fff;
}
