/**
 * Intelligent Live Solcellesøgning Styling
 * Scoped styling for live search dropdowns, widgets og overlays
 */

.vs-search-widget-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.vs-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.vs-search-prefix-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: #64748b;
  pointer-events: none;
}

.vs-live-search-input {
  width: 100%;
  padding: 12px 38px 12px 40px !important;
  font-size: 15px !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  outline: none !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.vs-live-search-input:focus {
  border-color: #16a34a !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15) !important;
}

/* Dropdown Overlay */
.vs-search-dropdown-overlay {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 380px;
  max-width: 580px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);
  z-index: 999999;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f8fafc;
}

/* Loading State */
.vs-search-loading {
  padding: 20px 24px;
  font-size: 14px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 10px;
}

.vs-search-spinner-inline {
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: #16a34a;
  border-radius: 50%;
  animation: vs-search-spin 0.6s linear infinite;
  display: inline-block;
}

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

/* Categories */
.vs-search-category {
  border-bottom: 1px solid #f1f5f9;
  padding: 8px 0;
}

.vs-search-category:last-child {
  border-bottom: none;
}

.vs-category-header {
  padding: 6px 18px 4px 18px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

/* Result Items */
.vs-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none !important;
}

.vs-search-item:hover,
.vs-search-item.vs-item-active {
  background: #f0fdf4;
}

.vs-item-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  background: #f8fafc;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vs-search-item:hover .vs-item-icon,
.vs-search-item.vs-item-active .vs-item-icon {
  background: #dcfce7;
}

.vs-item-content {
  flex: 1;
  min-width: 0;
}

.vs-item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.vs-item-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-item-badge {
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  flex-shrink: 0;
}

.vs-cat-actions .vs-item-badge {
  background: #0284c7;
  color: #ffffff;
}

.vs-item-desc {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-item-arrow {
  font-size: 16px;
  color: #94a3b8;
  transition: transform 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.vs-search-item:hover .vs-item-arrow,
.vs-search-item.vs-item-active .vs-item-arrow {
  color: #16a34a;
  transform: translateX(3px);
}

/* Dropdown Footer */
.vs-search-footer {
  padding: 10px 18px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  font-size: 13px;
  color: #475569;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vs-search-footer-link {
  color: #16a34a !important;
  font-weight: 700;
  text-decoration: none;
}

.vs-search-footer-link:hover {
  text-decoration: underline;
}

/* Empty State */
.vs-search-empty {
  padding: 24px 20px;
  text-align: center;
}

.vs-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.vs-empty-title {
  font-size: 15px;
  color: #0f172a;
  margin-bottom: 6px;
}

.vs-empty-text {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 16px 0;
}

.vs-empty-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.vs-empty-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none !important;
  transition: all 0.15s ease;
}

.vs-empty-btn-calc {
  background: #16a34a;
  color: #ffffff !important;
}

.vs-empty-btn-calc:hover {
  background: #15803d;
}

.vs-empty-btn-phone {
  background: #f1f5f9;
  color: #334155 !important;
  border: 1px solid #cbd5e1;
}

.vs-empty-btn-phone:hover {
  background: #e2e8f0;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .vs-search-dropdown-overlay {
    position: fixed;
    top: 70px;
    left: 10px;
    right: 10px;
    min-width: unset;
    max-width: unset;
    width: auto;
  }
}
