/* ========================================
   SEARCH FUNCTIONALITY
   Desktop and mobile search components
   ======================================== */

/* === DESKTOP SEARCH OVERLAY === */
.desktop-search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.desktop-search-overlay.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === SEARCH CONTAINER === */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.search-toggle-btn:hover {
  background: var(--bg-hover);
}

.search-icon {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
  transition: transform 0.3s ease;
}

.search-box {
  width: 0;
  opacity: 0;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}

.search-container.expanded .search-box {
  width: 280px !important;
  opacity: 1 !important;
  padding: 0.625rem 1rem !important;
  margin-left: 0.5rem !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  font-size: 0.95rem !important;
}

.search-container.expanded .search-box:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-container.expanded .search-icon {
  transform: rotate(90deg);
}

/* === DROPDOWN === */
#dropdown, .dropdown-content {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 350px;
  max-width: 450px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 1002;
  display: none;
  /* Prevent overflow on smaller screens */
  max-width: min(450px, calc(100vw - 2rem));
}

/* Responsive dropdown positioning */
@media (max-width: 1400px) {
  #dropdown, .dropdown-content {
    max-width: min(400px, calc(100vw - 3rem));
  }
}

@media (max-width: 1200px) {
  #dropdown, .dropdown-content {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    max-width: min(400px, calc(100vw - 2rem));
  }
}

@media (max-width: 968px) {
  #dropdown, .dropdown-content {
    right: 0;
    left: auto;
    transform: none;
    min-width: 280px;
    max-width: min(350px, calc(100vw - 1.5rem));
  }
}

@media (max-width: 768px) {
  #dropdown, .dropdown-content {
    left: 0;
    right: 0;
    transform: none;
    min-width: auto;
    max-width: none;
    width: 100%;
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-decoration: none;
  color: var(--text-primary);
  gap: 1rem;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: var(--bg-hover);
}

.dropdown-item .platform-name {
  flex: 1;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === STATUS INDICATORS === */
.status-indicator {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.3px;
  color: white;
}

.status-indicator.operational {
  background: rgba(72, 187, 120, 0.15);
  color: #68d391;
}

.status-indicator.outage {
  background: rgba(239, 68, 68, 0.15);
  color: #fc8181;
}

.status-indicator.possible-issue {
  background: rgba(245, 158, 11, 0.15);
  color: #f6ad55;
}
