/* Search Modal Styles - vrporngoon.com */

/* CSS Variables - adjust to match your site theme */
:root {
  --search-bg: #0a0a0a;
  --search-surface: #141414;
  --search-border: #2a2a2a;
  --search-text: #e5e5e5;
  --search-text-muted: #888;
  --search-accent: #ff6b6b;
  --search-accent-soft: rgba(255, 107, 107, 0.15);
  --search-highlight: #ffeb3b;
  --search-radius: 12px;
  --search-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

/* Modal Overlay */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.search-modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Main Container */
.search-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  min-height: 70vh;
  margin: 0 1.5rem;
  background: var(--search-surface);
  border: 1px solid var(--search-border);
  border-radius: var(--search-radius);
  box-shadow: var(--search-shadow);
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(-10px);
  transition: transform 0.2s ease;
}

.search-modal[aria-hidden="false"] .search-container {
  transform: scale(1) translateY(0);
}

/* Search Header */
.search-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--search-border);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--search-bg);
  border: 1px solid var(--search-border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.15s ease;
}

.search-input-wrapper:focus-within {
  border-color: var(--search-accent);
}

.search-icon {
  flex-shrink: 0;
  color: var(--search-text-muted);
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--search-text);
  font-size: 1.5rem;
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--search-text-muted);
}

.search-esc {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem;
  background: var(--search-border);
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--search-text-muted);
  font-family: inherit;
}

/* Search Body */
.search-body {
  flex: 1;
  min-height: 400px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.search-results {
  padding: 1.5rem;
}

/* Search Tips (initial state) */
.search-tips {
  padding: 3rem 1.5rem;
  text-align: center;
}

.search-tip-title {
  font-size: 1rem;
  color: var(--search-text-muted);
  margin-bottom: 1rem;
}

.search-tip-list {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
  color: var(--search-text-muted);
}

.search-tip-list kbd {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--search-border);
  border-radius: 3px;
  font-size: 0.85rem;
  font-family: inherit;
  margin-right: 0.25rem;
}

/* Loading State */
.search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--search-text-muted);
}

.search-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--search-border);
  border-top-color: var(--search-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.search-empty {
  padding: 2rem;
  text-align: center;
  color: var(--search-text-muted);
}

.search-empty-hint {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

/* Results List */
.search-result-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-result-item {
  display: block;
}

.search-result-link {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--search-text);
  transition: background 0.1s ease;
}

.search-result-link:hover,
.search-result-item[aria-selected="true"] .search-result-link {
  background: var(--search-accent-soft);
}

.search-result-thumb {
  width: 140px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--search-border);
}

.search-result-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  font-size: 1.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.35rem;
}

.search-result-title mark {
  background: var(--search-highlight);
  color: #000;
  border-radius: 2px;
  padding: 0 2px;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  color: var(--search-text-muted);
}

.search-result-studio {
  color: var(--search-accent);
}

.search-result-score {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.search-result-score::before {
  content: "★";
  color: var(--search-accent);
}

.search-result-performers {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search Footer */
.search-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--search-border);
  font-size: 0.85rem;
  color: var(--search-text-muted);
}

.search-powered a {
  color: var(--search-accent);
  text-decoration: none;
}

.search-powered a:hover {
  text-decoration: underline;
}

/* Nav Search Button */
.nav-search-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--search-surface);
  border: 1px solid var(--search-border);
  border-radius: 8px;
  color: var(--search-text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.nav-search-btn:hover {
  border-color: var(--search-accent);
  color: var(--search-text);
}

.nav-search-btn svg {
  width: 16px;
  height: 16px;
}

.search-hint {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  background: var(--search-border);
  border-radius: 4px;
}

/* Mobile Adjustments */
@media (max-width: 640px) {
  .search-modal {
    padding-top: 0;
    align-items: flex-start;
  }
  
  .search-container {
    max-height: 100vh;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    border: none;
  }
  
  .search-hint {
    display: none;
  }
  
  .search-result-link {
    grid-template-columns: 60px 1fr;
  }
  
  .search-result-thumb {
    width: 60px;
    height: 34px;
  }
  
  .search-tip-list {
    flex-direction: column;
    gap: 0.5rem;
  }
}
