/* Search Modal Styles */
.search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

.search-modal.active {
  display: block;
}

.search-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.search-modal-content {
  position: relative;
  max-width: 680px;
  margin: 80px auto 0;
  background: #0a0e27;
  border: 2px solid #2a2f4a;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: slideDown 0.3s ease;
}

/* Terminal Header */
.search-modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(180deg, #1e2442 0%, #151932 100%);
  border-bottom: 1px solid #2a2f4a;
  z-index: 10;
}

/* Terminal Window Controls */
.search-modal-content::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  width: 12px;
  height: 12px;
  background: #ff5f56;
  border-radius: 50%;
  box-shadow:
    18px 0 0 #ffbd2e,
    36px 0 0 #27c93f;
  z-index: 11;
}

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

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  padding-top: 52px;
  border-bottom: 1px solid #2a2f4a;
  background: rgba(10, 14, 39, 0.5);
  position: relative;
  z-index: 1;
}

.search-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-icon {
  color: #e5f088;
  font-size: 1.1rem;
}

/* Terminal prompt indicator */
.search-input-wrapper::before {
  content: '$';
  color: #e5f088;
  font-family: 'Fira Code', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e5f088;
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  padding: 0;
  letter-spacing: 0.01em;
}

.search-input::placeholder {
  color: rgba(229, 240, 136, 0.3);
  font-family: 'Fira Code', monospace;
}

.search-kbd {
  padding: 0.25rem 0.5rem;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 4px;
  color: #60a5fa;
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  font-weight: 500;
}

.search-close {
  background: none;
  border: none;
  color: rgba(228, 228, 231, 0.6);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.search-close:hover {
  color: #e4e4e7;
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem 0;
  background: #0a0e27;
}

.search-results::-webkit-scrollbar {
  width: 8px;
}

.search-results::-webkit-scrollbar-track {
  background: rgba(96, 165, 250, 0.05);
}

.search-results::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.2);
  border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: rgba(96, 165, 250, 0.3);
}

.search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  color: rgba(228, 228, 231, 0.4);
}

.search-empty i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.search-empty p {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
}

/* Recent Content Header */
.search-recent-header {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(228, 228, 231, 0.4);
  padding: 0.75rem 1.25rem 0.5rem;
}

/* Search Result Items */
.search-result-item {
  display: block;
  padding: 1.25rem 1.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 1px solid rgba(96, 165, 250, 0.15);
  text-decoration: none;
  background: transparent;
}

.search-result-item:first-child {
  padding-top: 0.75rem;
}

.search-result-item:last-child {
  border-bottom: none;
  padding-bottom: 0.75rem;
}

.search-result-item:hover,
.search-result-item.active {
  background: rgba(96, 165, 250, 0.06);
}

.search-result-path {
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-result-type {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa !important;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.search-result-url {
  color: #e5f088 !important;
  opacity: 0.8;
}

.search-external-icon {
  color: rgba(228, 228, 231, 0.4) !important;
  font-size: 0.7rem;
  margin-left: 0.25rem;
}

.search-result-title {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #e4e4e7 !important;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.search-result-description {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: rgba(228, 228, 231, 0.5) !important;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid #2a2f4a;
  background: #151932;
}

.search-footer-left,
.search-footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-footer kbd {
  padding: 0.25rem 0.5rem;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 4px;
  color: #60a5fa;
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
}

.search-footer span {
  color: rgba(228, 228, 231, 0.5);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
}

.search-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  color: rgba(228, 228, 231, 0.4);
}

.search-no-results i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.search-no-results p {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
}

/* Light mode styles */
[data-theme="light"] .search-modal-content {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
}

[data-theme="light"] .search-modal-content::before {
  background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
  border-bottom-color: #94a3b8;
}

[data-theme="light"] .search-modal-content::after {
  background: #ff5f56;
  box-shadow:
    18px 0 0 #ffbd2e,
    36px 0 0 #27c93f;
}

[data-theme="light"] .search-header {
  border-bottom-color: #cbd5e1;
  background: rgba(248, 250, 252, 0.8);
}

[data-theme="light"] .search-icon {
  color: #16a34a;
}

[data-theme="light"] .search-input-wrapper::before {
  color: #16a34a;
}

[data-theme="light"] .search-input {
  color: #16a34a;
}

[data-theme="light"] .search-input::placeholder {
  color: rgba(15, 23, 42, 0.4);
}

[data-theme="light"] .search-results {
  background: #f8fafc;
}

[data-theme="light"] .search-close {
  color: rgba(26, 26, 26, 0.6);
}

[data-theme="light"] .search-close:hover {
  color: #1a1a1a;
}

[data-theme="light"] .search-result-item {
  border-bottom-color: rgba(14, 116, 218, 0.12);
}

[data-theme="light"] .search-result-item:hover,
[data-theme="light"] .search-result-item.active {
  background: rgba(14, 116, 218, 0.06);
}

[data-theme="light"] .search-result-type {
  background: rgba(14, 116, 218, 0.15);
  color: #0e74da !important;
}

[data-theme="light"] .search-result-url {
  color: #16a34a !important;
  opacity: 0.9;
}

[data-theme="light"] .search-external-icon {
  color: rgba(26, 26, 26, 0.4) !important;
}

[data-theme="light"] .search-result-title {
  color: #1a1a1a !important;
}

[data-theme="light"] .search-result-description {
  color: rgba(26, 26, 26, 0.6) !important;
}

[data-theme="light"] .search-recent-header {
  color: rgba(26, 26, 26, 0.4);
}

[data-theme="light"] .search-footer {
  border-top-color: #cbd5e1;
  background: #e2e8f0;
}

@media (max-width: 768px) {
  .search-modal-content {
    margin: 20px 16px 0;
    max-width: none;
  }

  .search-results {
    max-height: 300px;
  }

  .search-input {
    font-size: 1rem;
  }
}
