/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #201c23;
  color: #e8eaed;
  line-height: 1.5;
}

a {
  color: #8ab4f8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header and search form */
.search-header {
  padding: 16px 0 4px 0;
  border-bottom: 1px solid #3c4043;
  position: relative;
}

.search-form {
  width: 100%;
}

.search-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.search-input {
  flex: 1;
  padding: 10px 16px;
  font-size: 16px;
  border: 1px solid #5f6368;
  border-radius: 24px;
  background-color: #202124;
  color: #e8eaed;
  height: 44px;
}

.search-input:focus {
  outline: none;
  border-color: #8ab4f8;
  box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.2);
}

.search-button {
  background: transparent;
  color: #e8eaed;
  border: none;
  padding: 10px 16px;
  margin-left: 8px;
  cursor: pointer;
  display: none; /* Hide button to match image */
}

/* Logo */
.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: bold;
  color: #e8eaed;
  margin-right: 20px;
}

.logo:hover {
  text-decoration: none;
}

.logo span {
  font-size: 24px;
  margin-right: 8px;
}

/* Navigation tabs */
.nav-tabs {
  display: flex;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #3c4043;
}

.nav-tab {
  padding: 12px 16px;
  font-size: 14px;
  color: #bdc1c6;
  cursor: pointer;
  position: relative;
}

.nav-tab.active {
  color: #8ab4f8;
  font-weight: 500;
}

.nav-tab.active:after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: #8ab4f8;
}

/* Options row */
.options-row {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 14px;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  width: 100%;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.option-group {
  display: flex;
  align-items: center;
}

.option-group label {
  margin-right: 8px;
  font-size: 14px;
  color: #9aa0a6;
}

.option-select {
  background-color: transparent;
  color: #e8eaed;
  border: none;
  font-size: 14px;
  padding: 4px 8px;
  cursor: pointer;
}

/* Toggle switch for privacy */
.privacy-toggle {
  display: flex;
  align-items: center;
}

.toggle-container {
  display: flex;
  align-items: center;
}

.toggle-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.toggle-checkbox {
  display: none;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 18px;
  background-color: #5f6368;
  border-radius: 18px;
  margin-right: 8px;
  transition: all 0.3s;
}

.toggle-switch:before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: white;
  top: 2px;
  left: 2px;
  transition: all 0.3s;
}

.toggle-checkbox:checked + .toggle-switch {
  background-color: #34a853;
}

.toggle-text {
  font-size: 14px;
  color: #9aa0a6;
}

/* Results container */
.results-container {
  padding: 20px 0;
}

.results-container h2 {
  padding-bottom: 20px;
}

/* Individual result styling */
.result {
  margin-bottom: 28px;
  max-width: 650px;
}

.result:last-child {
  margin-bottom: 0;
}

.result h3 {
  font-size: 20px;
  font-weight: normal;
  margin-bottom: 5px;
  line-height: 1.3;
}

.result-meta {
  display: flex;
  align-items: center;
  margin-bottom: 3px;
}

.result-favicon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border-radius: 50%;
}

.result .url {
  color: #9aa0a6;
  font-size: 14px;
}

.result .description {
  color: #bdc1c6;
  font-size: 14px;
  line-height: 1.4;
}

/* Error and no results states */
.error, .no-results {
  padding: 20px;
  background-color: #202124;
  border-radius: 8px;
  color: #f28b82;
  margin: 20px 0;
}

.no-results {
  color: #bdc1c6;
}

/* Footer */
footer {
  border-top: 1px solid #3c4043;
  padding: 20px 0;
  font-size: 14px;
  color: #9aa0a6;
  text-align: center;
  line-height: 2;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .search-row {
    flex-direction: column;
  }

  .search-input {
    width: 100%;
  }

  .search-button {
    margin-left: 0;
    margin-top: 12px;
    width: 100%;
  }

  .options-row::-webkit-scrollbar {
    height: 4px;
  }

  .options-row::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
  }

  .option-group {
    flex-shrink: 0;
    margin-right: 16px;
    margin-bottom: 0;
    width: auto;
  }

  .option-group:last-child {
    margin-right: 8px; /* Add some space at the end of scrollable area */
  }
}

/* Badge for ads */
.ad-badge {
  display: inline-block;
  font-size: 12px;
  color: #ffffff;
  background-color: #3c4043;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

.spellcheck-suggestions {
  display: inline-flex;
  background-color: #303134;
  border: 1px solid #3c4043;
  border-radius: 8px;
  padding: 10px 15px;
  margin-bottom: 20px;
  font-size: 14px;
}

.spellcheck-suggestions p {
  margin: 0;
  color: #bdc1c6;
}

.spellcheck-suggestions a {
  color: #8ab4f8;
  text-decoration: none;
  font-weight: 500;
}

.spellcheck-suggestions a:hover {
  text-decoration: underline;
  opacity: 1;
}

/* Legal Pages Styling */
.legal-container {
  max-width: 800px;
  margin: 30px auto;
  padding: 20px;
  border-radius: 8px;
}

.legal-container h1 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #e8eaed;
  border-bottom: 1px solid #3c4043;
  padding-bottom: 15px;
}

.legal-container h2 {
  font-size: 22px;
  margin-top: 30px;
  margin-bottom: 15px;
  color: #e8eaed;
}

.legal-container h3 {
  font-size: 18px;
  margin-top: 20px;
  margin-bottom: 10px;
  color: #bdc1c6;
}

.legal-container p {
  margin-bottom: 15px;
  line-height: 1.6;
  color: #bdc1c6;
}

.legal-container ul {
  margin-bottom: 20px;
  margin-left: 20px;
}

.legal-container li {
  margin-bottom: 8px;
  line-height: 1.5;
  color: #bdc1c6;
}

.legal-container address {
  margin: 20px 0;
  font-style: normal;
  line-height: 1.6;
  background-color: #303134;
  padding: 15px;
  border-radius: 5px;
  border-left: 3px solid #3c4043;
  color: #bdc1c6;
}

.help-section, .about-section {
  margin-bottom: 30px;
  border-bottom: 1px solid #eee;
  padding-bottom: 20px;
}

.help-item, .about-feature {
  margin-bottom: 20px;
  padding-left: 15px;
}

.company-info {
  margin-top: 15px;
  font-size: 12px;
  color: #777;
  text-align: center;
}

/* Make legal pages responsive */
@media (max-width: 768px) {
  .legal-container {
    padding: 15px;
    margin: 20px auto;
  }

  .legal-container h1 {
    font-size: 24px;
  }

  .legal-container h2 {
    font-size: 20px;
  }

  .legal-container h3 {
    font-size: 16px;
  }
}

/* Fix for footer links to work with folder structure */
.footer-links a {
  padding: 0 8px;
  position: relative;
}

.footer-links a:not(:last-child)::after {
  content: '|';
  position: absolute;
  right: -3px;
  color: #3c4043;
}

/* Authentication styles */
.auth-controls {
  margin-left: 15px;
  display: flex;
  align-items: center;
}

.login-button {
  background-color: #8ab4f8;
  color: #202124;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s;
}

.login-button:hover {
  background-color: #a3c4f9;
  text-decoration: none;
}

.user-dropdown {
  position: relative;
  cursor: pointer;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 4px;
  background-color: #303134;
  transition: background-color 0.2s;
}

.user-info:hover {
  background-color: #3c4043;
}

.username {
  font-size: 14px;
  font-weight: 500;
  color: #e8eaed;
}

.dropdown-arrow {
  font-size: 10px;
  color: #9aa0a6;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  background-color: #303134;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  min-width: 120px;
  margin-top: 5px;
  display: none;
}

.user-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 10px 15px;
  font-size: 14px;
  color: #e8eaed;
  text-decoration: none;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background-color: #3c4043;
  text-decoration: none;
}

/* Image search results */
.image-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.image-result {
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
}

.image-link {
  color: #e8eaed;
  text-decoration: none;
  display: block;
}

.image-link:hover {
  text-decoration: none;
}

.image-container {
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-radius: 8px;
  background-color: #2d2d2d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.image-result:hover .image-container img {
  transform: scale(1.05);
}

.image-title {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.image-source {
  margin-top: 4px;
  font-size: 12px;
  color: #9aa0a6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .image-results {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .image-container {
    height: 120px;
  }
}

/* Adjust navigation tabs for links */
.nav-tab a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.nav-tab a:hover {
  text-decoration: none;
}

/* Image preview in main search */
.image-preview-section {
  margin-bottom: 24px;
  border-radius: 8px;
  padding-bottom: 16px;
}

.image-preview-header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.image-preview-header h3 {
  font-size: 16px;
  font-weight: 500;
  color: #e8eaed;
}

.more-images {
  font-size: 13px;
  color: #8ab4f8;
}

.image-preview-results {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 8px;
}

.image-preview-results::-webkit-scrollbar {
  height: 4px;
}

.image-preview-results::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.image-preview-item {
  flex: 0 0 120px;
}

.image-preview-container {
  width: 120px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #2d2d2d;
  transition: transform 0.2s;
}

.image-preview-container:hover {
  transform: scale(1.05);
}

.image-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .image-preview-results {
    gap: 6px;
  }

  .image-preview-item {
    flex: 0 0 100px;
  }

  .image-preview-container {
    width: 100px;
    height: 75px;
  }
}
