/* ==========================================================================
   KDM GLOBAL LIVE SEARCH SYSTEM - KING OF DIGITAL MARKETING
   ========================================================================== */

/* 1. Header Trigger Button (Desktop & Mobile) */
.kdm-v2-search-trigger {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  padding: 5px 12px !important;
  border-radius: 20px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  outline: none !important;
  margin-right: 4px !important;
  line-height: 1 !important;
  backdrop-filter: blur(4px) !important;
}

.kdm-v2-search-trigger:hover,
.kdm-v2-search-trigger:focus {
  background: rgba(255, 255, 255, 0.25) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25) !important;
}

.kdm-v2-search-trigger i {
  font-size: 12px !important;
}

.kdm-v2-search-kbd {
  background: rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 4px !important;
  padding: 2px 5px !important;
  font-size: 10px !important;
  font-family: inherit !important;
  font-weight: 800 !important;
  color: #e2e8f0 !important;
  letter-spacing: 0.5px !important;
}

/* Mobile Search Icon in Header */
.kdm-v2-mobile-search-btn {
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 8px !important;
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  font-size: 15px !important;
  cursor: pointer !important;
  margin-right: 8px !important;
  transition: all 0.2s ease !important;
}

.kdm-v2-mobile-search-btn:hover {
  background: #0077b6 !important;
  color: #ffffff !important;
  border-color: #0077b6 !important;
}

@media (max-width: 991px) {
  .kdm-v2-mobile-search-btn {
    display: inline-flex !important;
  }
}

/* 2. Fullscreen Search Modal Backdrop */
.kdm-search-modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(15, 23, 42, 0.78) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 9999999 !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 60px 16px 20px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.25s ease, visibility 0.25s ease !important;
  box-sizing: border-box !important;
}

.kdm-search-modal-backdrop.kdm-search-open {
  opacity: 1 !important;
  visibility: visible !important;
}

/* 3. Search Modal Dialog Container */
.kdm-search-dialog {
  background: #ffffff !important;
  width: 100% !important;
  max-width: 720px !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
  overflow: hidden !important;
  transform: translateY(-20px) scale(0.98) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: calc(100vh - 100px) !important;
  box-sizing: border-box !important;
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif !important;
}

.kdm-search-modal-backdrop.kdm-search-open .kdm-search-dialog {
  transform: translateY(0) scale(1) !important;
}

/* 4. Modal Header & Input Bar */
.kdm-search-header {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  padding: 16px 20px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  gap: 14px !important;
}

.kdm-search-input-icon {
  font-size: 20px !important;
  color: #0077b6 !important;
  flex-shrink: 0 !important;
}

.kdm-search-input {
  flex: 1 !important;
  border: none !important;
  outline: none !important;
  font-size: 17px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  font-family: inherit !important;
}

.kdm-search-input::placeholder {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

.kdm-search-clear-btn {
  background: #f1f5f9 !important;
  border: none !important;
  color: #64748b !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 12px !important;
  transition: all 0.2s ease !important;
}

.kdm-search-clear-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

.kdm-search-close-badge {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  user-select: none !important;
}

.kdm-search-close-badge:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* 5. Filter Category Tabs */
.kdm-search-tabs {
  display: flex !important;
  gap: 6px !important;
  padding: 10px 20px !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #f1f5f9 !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}

.kdm-search-tabs::-webkit-scrollbar {
  display: none !important;
}

.kdm-search-tab {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #64748b !important;
  padding: 5px 12px !important;
  border-radius: 20px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
  outline: none !important;
}

.kdm-search-tab:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

.kdm-search-tab.active {
  background: #0077b6 !important;
  color: #ffffff !important;
  border-color: #0077b6 !important;
  box-shadow: 0 2px 6px rgba(0, 119, 182, 0.3) !important;
}

/* 6. Modal Body & Results Container */
.kdm-search-body {
  padding: 14px 20px !important;
  overflow-y: auto !important;
  flex: 1 !important;
  min-height: 240px !important;
  max-height: 480px !important;
}

/* Quick Suggestion Chips Box (Shown when search is empty) */
.kdm-search-suggestions {
  margin-bottom: 20px !important;
}

.kdm-search-suggestions-title {
  font-size: 12px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  color: #94a3b8 !important;
  margin-bottom: 10px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.kdm-search-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.kdm-search-chip {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
  padding: 6px 14px !important;
  border-radius: 20px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  text-decoration: none !important;
}

.kdm-search-chip:hover {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border-color: #bae6fd !important;
  transform: translateY(-1px) !important;
}

/* Search Results Items */
.kdm-search-results-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.kdm-search-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 16px !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  border: 1px solid #f1f5f9 !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  gap: 12px !important;
}

.kdm-search-item:hover,
.kdm-search-item.kdm-item-selected {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
  transform: translateX(4px) !important;
}

.kdm-search-item.kdm-item-selected {
  background: #e0f2fe !important;
  border-color: #7dd3fc !important;
}

.kdm-search-item-left {
  flex: 1 !important;
  min-width: 0 !important;
}

.kdm-search-item-title-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 4px !important;
  flex-wrap: wrap !important;
}

.kdm-search-item-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  line-height: 1.3 !important;
}

.kdm-search-badge {
  font-size: 10px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  padding: 2px 8px !important;
  border-radius: 4px !important;
  letter-spacing: 0.5px !important;
}

.kdm-badge-service { background: #e0f2fe !important; color: #0284c7 !important; }
.kdm-badge-industry { background: #fef3c7 !important; color: #d97706 !important; }
.kdm-badge-location { background: #ede9fe !important; color: #7c3aed !important; }
.kdm-badge-course { background: #dcfce7 !important; color: #16a34a !important; }
.kdm-badge-package { background: #ffedd5 !important; color: #ea580c !important; }
.kdm-badge-resource { background: #f1f5f9 !important; color: #475569 !important; }
.kdm-badge-blog { background: #fce7f3 !important; color: #db2777 !important; }

.kdm-search-item-desc {
  font-size: 12px !important;
  color: #64748b !important;
  line-height: 1.4 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.kdm-search-item-arrow {
  color: #94a3b8 !important;
  font-size: 14px !important;
  transition: transform 0.2s ease, color 0.2s ease !important;
  flex-shrink: 0 !important;
}

.kdm-search-item:hover .kdm-search-item-arrow,
.kdm-search-item.kdm-item-selected .kdm-search-item-arrow {
  color: #0077b6 !important;
  transform: translateX(3px) !important;
}

/* Highlighted matching keywords */
.kdm-search-highlight {
  background: #fef08a !important;
  color: #854d0e !important;
  font-weight: 800 !important;
  border-radius: 2px !important;
  padding: 0 2px !important;
}

/* Empty / No Results State */
.kdm-search-empty {
  text-align: center !important;
  padding: 40px 20px !important;
  color: #64748b !important;
}

.kdm-search-empty-icon {
  font-size: 42px !important;
  color: #cbd5e1 !important;
  margin-bottom: 12px !important;
}

.kdm-search-empty h4 {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  margin-bottom: 6px !important;
}

.kdm-search-empty p {
  font-size: 13px !important;
  color: #64748b !important;
  margin-bottom: 20px !important;
}

/* 7. Modal Footer / Help Bar */
.kdm-search-footer {
  padding: 12px 20px !important;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  font-size: 12px !important;
  color: #64748b !important;
}

.kdm-search-footer-shortcuts {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.kdm-search-footer-shortcuts span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.kdm-search-footer-shortcuts kbd {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 4px !important;
  padding: 1px 5px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #334155 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}

.kdm-search-footer-contact {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.kdm-search-footer-contact a {
  color: #0077b6 !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.kdm-search-footer-contact a:hover {
  text-decoration: underline !important;
}

@media (max-width: 640px) {
  .kdm-search-modal-backdrop {
    padding: 20px 10px !important;
  }
  .kdm-search-footer-shortcuts {
    display: none !important;
  }
  .kdm-search-footer {
    justify-content: center !important;
  }
}
