/* ========================================
   SISTEMA DE BUSCA - SENAC ES
   Estilos para modal e página de resultados
   ======================================== */

:root {
  --senac-primary: #0052f1;
  --senac-dark-blue: #034b88;
  --senac-orange: #f29222;
  --senac-light-blue: #3ea5da;
}

/* ========================================
   MODAL DE BUSCA
   ======================================== */

.search-modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.search-modal-content .modal-header {
  padding: 1.5rem 1.5rem 1rem;
}

.search-modal-content .modal-header h5 {
  color: var(--senac-primary);
  font-weight: 600;
  font-size: 1.25rem;
}

.search-modal-input-wrapper input {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 0.85rem 9rem 0.85rem 1.25rem;
  font-size: 1.05rem;
  transition: all 0.3s ease;
}

.search-modal-input-wrapper input:focus {
  border-color: var(--senac-primary);
  box-shadow: 0 0 0 4px rgba(0, 82, 241, 0.1);
  outline: none;
}

.btn-search-modal {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--senac-primary) 0%, var(--senac-light-blue) 100%);
  border: none;
  color: white;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 82, 241, 0.2);
}

.btn-search-modal:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 82, 241, 0.3);
}

.btn-search-modal:active {
  transform: translateY(-50%) scale(0.98);
}

.btn-search-modal i {
  font-size: 1.1rem;
}

/* Sugestões do Modal */
.modal-suggestions {
  max-height: 250px;
  overflow-y: auto;
  border-radius: 8px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: 0.25rem;
}

.suggestion-item:hover {
  background: linear-gradient(135deg, rgba(0, 82, 241, 0.05) 0%, rgba(62, 165, 218, 0.05) 100%);
  transform: translateX(5px);
}

.suggestion-item i {
  color: var(--senac-primary);
  font-size: 1.1rem;
}

.suggestion-text strong {
  color: var(--senac-primary);
  font-weight: 600;
}

/* Resultados Rápidos no Modal */
.quick-result-item {
  display: block;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border: 1px solid #e0e0e0;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.quick-result-item:hover {
  border-color: var(--senac-primary);
  box-shadow: 0 2px 8px rgba(0, 82, 241, 0.1);
  transform: translateY(-2px);
}

.quick-result-item h6 {
  color: var(--senac-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.quick-result-item mark {
  background-color: rgba(242, 146, 34, 0.3);
  padding: 2px 4px;
  border-radius: 3px;
}

.result-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-right: 1rem;
  flex-shrink: 0;
}

.result-icon i {
  font-size: 1.2rem;
}

.result-icon.type-course {
  background: rgba(0, 82, 241, 0.1);
  color: var(--senac-primary);
}

.result-icon.type-news {
  background: rgba(242, 146, 34, 0.1);
  color: var(--senac-orange);
}

.result-icon.type-static {
  background: rgba(62, 165, 218, 0.1);
  color: var(--senac-light-blue);
}

.result-icon.type-licitacao {
  background: rgba(3, 75, 136, 0.1);
  color: var(--senac-dark-blue);
}

.result-icon.type-service {
  background: rgba(242, 146, 34, 0.1);
  color: var(--senac-orange);
}

/* Tags Populares */
.popular-tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin: 0.25rem;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.popular-tag:hover {
  background: var(--senac-primary);
  color: white;
  border-color: var(--senac-primary);
}

.modal-footer kbd {
  background: #f8f9fa;
  color: #333;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

/* ========================================
   PÁGINA DE RESULTADOS
   ======================================== */

.search-banner {
  background: linear-gradient(135deg, var(--senac-primary) 0%, var(--senac-light-blue) 100%);
  color: white;
  padding: 2rem 0;
}

.search-banner h1 {
  color: white;
  font-weight: 700;
  font-size: 2.5rem;
}

.search-banner h1 i {
  margin-right: 1rem;
}

.search-box-main {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.search-box-main input {
  border: none;
  border-radius: 50px;
  padding: 1rem 150px 1rem 2rem;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-box-main input:focus {
  outline: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-search {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--senac-orange);
  border: none;
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-search:hover {
  background: #d17b15;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px;
  margin-top: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

#popularSearches {
  color: rgba(255, 255, 255, 0.9);
}

#popularSearches .popular-tag {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

#popularSearches .popular-tag:hover {
  background: white;
  color: var(--senac-primary);
}

/* Filtros */
.search-filters {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 20px;
}

.filter-title {
  color: var(--senac-primary);
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.filter-title i {
  margin-right: 0.5rem;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group h6 {
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.filter-options {
  max-height: 200px;
  overflow-y: auto;
}

.filter-options::-webkit-scrollbar {
  width: 6px;
}

.filter-options::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.filter-options::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.filter-options::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.form-check {
  margin-bottom: 0.75rem;
}

.form-check-input:checked {
  background-color: var(--senac-primary);
  border-color: var(--senac-primary);
}

.form-check-input:focus {
  border-color: var(--senac-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 82, 241, 0.25);
}

.form-check-label {
  cursor: pointer;
  user-select: none;
}

/* Info de Busca */
.search-info {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-info h5 {
  color: #333;
  font-size: 1.1rem;
}

.search-info strong {
  color: var(--senac-primary);
}

/* Cards de Resultado */
.search-result-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.search-result-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.result-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.result-type-badge.type-course {
  background: rgba(0, 82, 241, 0.1);
  color: var(--senac-primary);
}

.result-type-badge.type-news {
  background: rgba(242, 146, 34, 0.1);
  color: var(--senac-orange);
}

.result-type-badge.type-static {
  background: rgba(62, 165, 218, 0.1);
  color: var(--senac-light-blue);
}

.result-type-badge.type-licitacao {
  background: rgba(3, 75, 136, 0.1);
  color: var(--senac-dark-blue);
}

.result-type-badge.type-service {
  background: rgba(242, 146, 34, 0.1);
  color: var(--senac-orange);
}

.result-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.result-title a {
  color: var(--senac-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.result-title a:hover {
  color: var(--senac-dark-blue);
  text-decoration: underline;
}

.result-description {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.result-description mark {
  background-color: rgba(242, 146, 34, 0.3);
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 600;
}

.result-meta {
  font-size: 0.9rem;
}

.result-meta a {
  color: var(--senac-primary);
  text-decoration: none;
}

.result-meta a:hover {
  text-decoration: underline;
}

/* Estados Vazios */
.empty-state {
  padding: 4rem 2rem;
}

.empty-state i {
  font-size: 4rem;
  color: #ccc;
}

.empty-state h4 {
  color: #666;
  margin-top: 1.5rem;
}

.empty-state p {
  color: #999;
}

/* Paginação */
.pagination {
  gap: 0.5rem;
}

.page-item .page-link {
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  color: var(--senac-primary);
  padding: 0.5rem 0.75rem;
  transition: all 0.3s ease;
}

.page-item .page-link:hover {
  background: var(--senac-primary);
  color: white;
  border-color: var(--senac-primary);
}

.page-item.active .page-link {
  background: var(--senac-primary);
  border-color: var(--senac-primary);
  font-weight: 600;
}

.page-item.disabled .page-link {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading */
#searchLoading {
  padding: 3rem;
}

/* Responsividade */
@media (max-width: 992px) {
  .search-filters {
    position: static;
    margin-bottom: 2rem;
  }

  .search-banner h1 {
    font-size: 2rem;
  }

  .search-box-main input {
    padding-right: 120px;
  }

  .btn-search {
    padding: 0.6rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .search-banner h1 {
    font-size: 1.75rem;
  }

  .search-box-main input {
    padding: 0.85rem 1.5rem;
    padding-right: 60px;
  }

  .btn-search {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .result-title {
    font-size: 1.2rem;
  }

  .search-result-card {
    padding: 1rem;
  }

  .filter-group {
    margin-bottom: 1rem;
  }
}

/* Animações */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-result-card {
  animation: fadeInUp 0.3s ease-out;
}

/* Acessibilidade */
.search-icon {
  position: relative;
  color: inherit;
  transition: all 0.3s ease;
}

.search-icon:hover {
  opacity: 0.8;
}

.search-icon:focus {
  outline: 2px solid var(--senac-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Print */
@media print {
  .search-filters,
  .search-banner,
  #searchPagination,
  .btn-search {
    display: none !important;
  }

  .search-result-card {
    box-shadow: none !important;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
}
