/* ==========================================================================
   GLOBAL TMDB SEARCH BAR & DROPDOWN STYLING
   ========================================================================== */

/* Search Section Container */
.global-search-section {
  width: 100%;
  background: transparent;
  margin: 0;
  padding: 0 0 2rem 0;
  display: flex;
  justify-content: center;
}

.global-search-bar {
  width: 100%;
  max-width: 420px;
  position: relative;
  margin: 2rem 0 0 0;
}

/* Search Input */
.global-search-input {
  width: 100%;
  padding: 0.85em 1em;
  font-size: 1.15em;
  border-radius: 9px;
  border: 1.5px solid #ddd;
  background: var(--color-white, #fff);
  box-shadow: 0 1px 6px #0001;
  margin-bottom: 0;
  outline: none;
  transition: border 0.2s;
  box-sizing: border-box;
}

.global-search-input:focus {
  border: 1.5px solid #007BFF;
}

.global-search-input::placeholder {
  color: #888;
  opacity: 1;
}

/* Dark Mode Input */
body.dark-mode .global-search-input {
  background: #232325;
  color: #fff;
  border: 1.5px solid #333;
}

body.dark-mode .global-search-input::placeholder {
  color: #aaa;
  opacity: 1;
}

/* Search Results Dropdown */
.global-search-results {
  position: absolute;
  left: 0; 
  right: 0; 
  top: 110%;
  background: var(--color-white, #fff);
  border-radius: 9px;
  box-shadow: 0 4px 18px #0002;
  z-index: 100;
  margin-top: 0.25rem;
  max-height: 330px;
  overflow-y: auto;
  min-width: 0;
}

body.dark-mode .global-search-results {
  background: #222;
  color: #fff;
}

/* Search Result Items */
.global-search-result {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.5em 1em;
  cursor: pointer;
  transition: background .13s;
  font-size: 1.08em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.global-search-result:last-child {
  border-bottom: none;
}

.global-search-result:hover, 
.global-search-result:focus {
  background: #f3f8ff;
  color: #0056b3;
}

body.dark-mode .global-search-result:hover, 
body.dark-mode .global-search-result:focus {
  background: #191e2d;
  color: #85aaff;
}

/* Search Result Images */
.global-search-result-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
  box-shadow: 0 1px 6px #0002;
  flex-shrink: 0;
}

.global-search-result-poster {
  width: 36px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  background: #eee;
  box-shadow: 0 1px 6px #0002;
  flex-shrink: 0;
}

/* Search Result Text */
.global-search-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.global-search-result-name,
.global-search-result-title {
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-search-result-known-for {
  font-size: 0.9em;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.global-search-result-year {
  font-size: .99em;
  color: #888;
  margin-left: .23em;
}

.global-search-result-type {
  font-size: 0.8em;
  color: #007BFF;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.dark-mode .global-search-result-type {
  color: #85aaff;
}

/* Loading and No Results States */
.global-search-loading, 
.global-search-no-results {
  padding: 0.6em 1em;
  font-size: 1.02em;
  color: #666;
  text-align: center;
}

body.dark-mode .global-search-loading,
body.dark-mode .global-search-no-results {
  color: #aaa;
}

/* Responsive Design */
@media (max-width: 768px) {
  .global-search-bar {
    max-width: 100%;
    margin: 1rem 0 0 0;
  }
  
  .global-search-input {
    font-size: 1.1em;
    padding: 0.75em 0.9em;
  }
  
  .global-search-results {
    max-height: 280px;
  }
  
  .global-search-result {
    padding: 0.4em 0.8em;
    font-size: 1em;
  }
}

@media (max-width: 480px) {
  .global-search-section {
    padding: 0 0 1.5rem 0;
  }
  
  .global-search-bar {
    margin: 0.5rem 0 0 0;
  }
  
  .global-search-input {
    font-size: 1em;
    padding: 0.7em 0.8em;
  }
  
  .global-search-result-photo {
    width: 32px;
    height: 32px;
  }
  
  .global-search-result-poster {
    width: 32px;
    height: 48px;
  }
}

/* Focus styles for accessibility */
.global-search-input:focus-visible {
  outline: 2px solid #007BFF;
  outline-offset: 2px;
}

.global-search-result:focus-visible {
  outline: 2px solid #007BFF;
  outline-offset: -2px;
}

body.dark-mode .global-search-input:focus-visible {
  outline-color: #85aaff;
}

body.dark-mode .global-search-result:focus-visible {
  outline-color: #85aaff;
} 