/* Search functionality styles */

/* Ensure proper box sizing for all search elements */
.search-page *,
.search-page *::before,
.search-page *::after {
  box-sizing: border-box;
}

/* General search form styling */
.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  max-width: 100%;
  overflow: hidden; /* Prevents any potential overflow */
}

.search-form input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 6px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
  min-width: 0; /* Allows flex item to shrink below content size */
}

.search-form input[type="text"]:focus {
  border-color: #0052d9;
  box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

.search-form button {
  background-color: #0052d9;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  box-sizing: border-box;
  white-space: nowrap; /* Prevents button text from wrapping */
}

.search-form button:hover {
  background-color: #0256cc;
}

/* Search page container */
.search-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 15px;
  box-sizing: border-box;
}

.search-page h1 {
  margin-bottom: 30px;
  color: #0052d9;
  font-size: 2rem;
  font-weight: 400;
}

/* Search results styling */
.search-result {
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.search-result:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.search-result h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
}

.search-result h3 a {
  color: #0052d9;
  text-decoration: none;
}

.search-result h3 a:hover {
  text-decoration: none;
}

.search-result .date {
  color: #6a737d;
  font-size: 14px;
  margin-bottom: 8px;
}

.search-result .excerpt {
  color: #24292e;
  line-height: 1.5;
}

.no-results {
  text-align: center;
  color: #6a737d;
  font-style: italic;
  margin-top: 40px;
  padding: 40px;
  background: #f8f9fa;
  border-radius: 8px;
}

/* Responsive design */
@media (max-width: 768px) {
  .search-page {
    padding: 15px 10px;
  }

  .search-form {
    flex-direction: column;
    gap: 12px;
  }

  .search-form input[type="text"],
  .search-form button {
    width: 100%;
    box-sizing: border-box;
  }

  .search-result {
    padding: 15px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .search-page {
    padding: 10px 8px;
  }

  .search-page h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
  }

  .search-form input[type="text"],
  .search-form button {
    padding: 10px 12px;
    font-size: 14px;
  }

  .search-result {
    padding: 12px;
    margin-bottom: 12px;
  }

  .search-result h3 {
    font-size: 18px;
  }
}

/* Search highlighting */
.search-highlight {
  background-color: #fff3cd;
  padding: 1px 3px;
  border-radius: 3px;
}

/* Animation for search results */
.search-result {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
