/* Google Search Results Page Styles */
.dark-theme {
  background-color: #202124;
  color: #e8eaed;
}

/* Header Styles */
.search-header {
  background-color: #202124;
  border-bottom: 1px solid #3c4043;
  position: sticky;
  top: 0;
  z-index: 100;
}

.search-header-content {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 12px 20px;
  max-width: none;
}



.search-logo {
  width: 120px;
  height: 30px;
  cursor: pointer;
}

.search-bar-container {
  flex: 1;
  max-width: 692px;
  margin: 0 auto; /* Center the search bar within its grid area */
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background-color: #303134;
  border: 1px solid #5f6368;
  border-radius: 24px;
  height: 44px;
  padding: 0 16px;
  position: relative;
}

.search-input-wrapper:hover {
  background-color: #303134;
  box-shadow: 0 2px 5px 1px rgba(64, 60, 67, 0.16);
}

.search-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e8eaed;
  font-size: 16px;
  padding: 0 8px;
}

/* Enhanced Search Icons Styling */
.search-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 4px;
}

.search-icons .icon-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  color: #9aa0a6;
}

.search-icons .icon-button:hover {
  background-color: rgba(232, 234, 237, 0.08);
  color: #e8eaed;
}

.search-icons .icon-button:active {
  background-color: rgba(232, 234, 237, 0.12);
}

.search-icons .material-symbols-outlined {
  font-size: 20px;
  font-weight: 400;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
}

.search-icons .clear-icon .material-symbols-outlined {
  font-size: 18px;
}

.search-icons .mic-icon .material-symbols-outlined {
  color: #4285f4;
}

.search-icons .camera-icon .material-symbols-outlined {
  color: #34a853;
}

.search-icons .search-icon {
  background-color: #8ab4f8;
  color: #202124;
  margin-left: 4px;
}

.search-icons .search-icon:hover {
  background-color: #93baf9;
  color: #202124;
}

.divider {
  width: 1px;
  height: 24px;
  background-color: #5f6368;
  margin: 0 8px;
  flex-shrink: 0;
}

/* Enhanced Header Right Positioning */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  position: relative;
}

/* Enhanced Apps Menu Button */
.apps-menu {
  position: relative;
}

.apps-menu button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
}

.apps-menu button:hover {
  background-color: rgba(232, 234, 237, 0.08);
}

.apps-menu button:active {
  background-color: rgba(232, 234, 237, 0.12);
}

.apps-menu img {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.apps-menu button:hover img {
  opacity: 1;
}

.profile-avatar {
  cursor: pointer;
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.avatar-circle:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

/* Navigation Tabs */
.search-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid #3c4043;
}

.nav-items {
  display: flex;
  align-items: center;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  color: #bdc1c6;
  text-decoration: none;
  font-size: 14px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.nav-item:hover {
  color: #e8eaed;
}

.nav-item.active {
  color: #8ab4f8;
  border-bottom-color: #8ab4f8;
}

/* Enhanced Navigation Icons */
.nav-item .material-symbols-outlined {
  font-size: 18px;
  font-weight: 400;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 18;
  margin-right: 6px;
}

.nav-item.active .material-symbols-outlined {
  color: #8ab4f8;
}

.nav-item .material-symbols-outlined {
  font-size: 18px;
}

.nav-right {
  display: flex;
}

/* Main Content */
.search-results-main {
  display: flex;
  justify-content: flex-start;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.results-container {
  display: flex;
  gap: 40px;
  width: 100%;
}

.results-container.single-column {
  display: block;
  max-width: 600px;
  margin: 0;
}

.search-results-column {
  flex: 1;
  max-width: 600px;
}

.results-info {
  color: #9aa0a6;
  font-size: 14px;
  margin-bottom: 20px;
}

/* Search Results */
.search-result {
  margin-bottom: 32px;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

/* Result Icons Enhancement */
.result-favicon {
  width: 18px;
  height: 18px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-url-info {
  flex: 1;
}

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

.result-breadcrumb {
  color: #9aa0a6;
  font-size: 12px;
  line-height: 16px;
}

.result-menu {
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
}

.result-menu:hover {
  background-color: rgba(232, 234, 237, 0.08);
}

.result-menu .material-symbols-outlined {
  font-size: 16px;
  font-weight: 400;
  color: #9aa0a6;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 16;
}

.result-menu:hover .material-symbols-outlined {
  color: #e8eaed;
}

.result-menu .material-symbols-outlined {
  color: #9aa0a6;
  font-size: 16px;
}

.result-title {
  margin: 0 0 4px 0;
  font-size: 20px;
  line-height: 26px;
  font-weight: 400;
}

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

.result-title a:hover {
  text-decoration: underline;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
  .search-results-main {
    padding: 16px;
  }

  .results-container.single-column {
    width: 100%;
  }
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 768px) {
  .search-header-content {
    padding: 8px 12px;
    flex-wrap: nowrap;
    gap: 8px;
  }



  .search-logo {
    width: 80px;
    height: 24px;
  }

  .search-bar-container {
    flex: 1;
    margin-right: 8px;
    min-width: 0; /* Allow shrinking */
  }

  .search-input-wrapper {
    height: 40px;
    padding: 0 12px;
    border-radius: 20px;
  }

  .search-input-wrapper input {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0 4px;
  }

  .search-icons {
    gap: 4px;
  }

  .search-icons .material-symbols-outlined {
    font-size: 18px;
    padding: 6px;
  }

  .divider {
    height: 16px;
    margin: 0 2px;
  }

  .header-right {
    gap: 8px;
    flex-shrink: 0;
  }

  .apps-menu img {
    width: 18px;
    height: 18px;
    padding: 6px;
  }

  .avatar-circle {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  /* Mobile Navigation */
  .search-nav {
    padding: 0 12px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }

  .search-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .nav-items {
    min-width: max-content;
    gap: 4px;
  }

  .nav-item {
    padding: 12px 16px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .nav-item .material-symbols-outlined {
    font-size: 16px;
  }

  /* Mobile Search Results */
  .search-results-main {
    padding: 12px;
  }

  .results-container.single-column {
    width: 100%;
  }

  .results-info {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .search-result {
    margin-bottom: 24px;
  }

  .result-header {
    gap: 8px;
    flex-wrap: wrap;
  }

  .result-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    margin-left: 0;
    margin-top: 4px;
  }

  .result-title {
    font-size: 18px;
    line-height: 24px;
  }

  .result-description {
    font-size: 13px;
    line-height: 20px;
  }

  /* Mobile Search Suggestions */
  .search-suggestions {
    border-radius: 0 0 8px 8px;
    max-height: 250px;
  }

  .suggestion-item {
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .suggestion-item .material-symbols-outlined {
    font-size: 16px;
  }

  /* Mobile Error Modal */
  .error-content {
    margin: 16px;
    padding: 24px 20px;
  }

  .error-icon {
    font-size: 40px;
  }

  .error-content h3 {
    font-size: 18px;
  }

  /* Mobile Skeleton Loading */
  .skeleton-result {
    margin-bottom: 24px;
  }

  .skeleton-header {
    gap: 8px;
  }

  .skeleton-url {
    width: 150px;
    height: 12px;
  }

  .skeleton-title {
    height: 18px;
  }

  .skeleton-description {
    height: 13px;
  }

  /* Mobile Touch Improvements */
  @media (max-width: 768px) {
    .search-result:hover {
      background: rgba(255, 255, 255, 0.02);
      border-radius: 8px;
    }
  }

  /* Fix for very small screens */
  @media (max-width: 480px) {
    .search-header-content {
      padding: 6px 8px;
    }

    .search-logo {
      width: 70px;
      height: 21px;
    }

    .search-input-wrapper {
      height: 36px;
      padding: 0 10px;
    }

    .search-icons .material-symbols-outlined {
      font-size: 16px;
      padding: 4px;
    }

    .header-right {
      gap: 4px;
    }

    .avatar-circle {
      width: 24px;
      height: 24px;
      font-size: 11px;
    }

    .apps-menu img {
      width: 16px;
      height: 16px;
      padding: 4px;
    }
  }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .search-header-content {
    padding: 6px 12px;
  }

  .search-input-wrapper {
    height: 36px;
  }

  .nav-item {
    padding: 8px 12px;
  }
}

/* High DPI Mobile Displays */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
  .search-logo,
  .apps-menu img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Loading and Animation Styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(32, 33, 36, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #3c4043;
  border-top: 4px solid #8ab4f8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Skeleton Loading */
.skeleton-container {
  display: none;
}

.skeleton-result {
  margin-bottom: 32px;
  animation: pulse 1.5s ease-in-out infinite;
}

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

.skeleton-favicon {
  width: 18px;
  height: 18px;
  background: #3c4043;
  border-radius: 3px;
}

.skeleton-url {
  width: 200px;
  height: 14px;
  background: #3c4043;
  border-radius: 3px;
}

.skeleton-title {
  width: 80%;
  height: 20px;
  background: #3c4043;
  border-radius: 3px;
  margin-bottom: 8px;
}

.skeleton-description {
  width: 100%;
  height: 14px;
  background: #3c4043;
  border-radius: 3px;
  margin-bottom: 4px;
}

.skeleton-description.short {
  width: 60%;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Search Suggestions */
.search-input-wrapper {
  position: relative;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #303134;
  border: 1px solid #5f6368;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.search-suggestions.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  color: #e8eaed;
  border-bottom: 1px solid #3c4043;
}

.suggestion-item:hover {
  background: #3c4043;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item .material-symbols-outlined {
  color: #9aa0a6;
  font-size: 18px;
}

/* Result Animations */
.search-result {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s ease;
}

.result-hidden {
  opacity: 0;
  transform: translateY(20px);
}

.result-appear {
  opacity: 1;
  transform: translateY(0);
}

/* Enhanced Result Styling */
.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.result-time {
  color: #9aa0a6;
  font-size: 12px;
}

.result-category {
  background: #3c4043;
  color: #8ab4f8;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
}

/* Error Modal */
.error-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.error-modal.hidden {
  display: none;
}

.error-content {
  background: #303134;
  padding: 32px;
  border-radius: 8px;
  text-align: center;
  max-width: 400px;
  margin: 20px;
}

.error-icon {
  font-size: 48px;
  color: #ea4335;
  margin-bottom: 16px;
}

.error-content h3 {
  color: #e8eaed;
  margin-bottom: 12px;
  font-size: 20px;
}

.error-content p {
  color: #9aa0a6;
  margin-bottom: 24px;
  line-height: 1.5;
}

.retry-button {
  background: #8ab4f8;
  color: #202124;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.retry-button:hover {
  background: #93baf9;
}

/* No Results State */
.no-results {
  text-align: center;
  padding: 60px 20px;
}

.no-results.hidden {
  display: none;
}

.no-results-content .material-symbols-outlined {
  font-size: 64px;
  color: #5f6368;
  margin-bottom: 24px;
}

.no-results-content h3 {
  color: #e8eaed;
  font-size: 24px;
  margin-bottom: 12px;
}

.no-results-content p {
  color: #9aa0a6;
  margin-bottom: 32px;
}

.suggestions {
  text-align: left;
  max-width: 400px;
  margin: 0 auto;
}

.suggestions p {
  color: #e8eaed;
  font-weight: 500;
  margin-bottom: 12px;
}

.suggestions ul {
  color: #9aa0a6;
  line-height: 1.6;
}

/* Completely Static Search Results - No Movement on Hover */
.search-result {
  margin-bottom: 32px;
  /* Remove all hover effects that cause movement */
}

.search-result:hover {
  background: transparent !important;
  transform: none !important;
}
/* Enhanced Hover Effects */
.search-result:hover {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 8px;
  margin: 8px;
  transition: all 0.2s ease;
}
/* Only allow text color changes on hover */
.result-title a:hover {
  text-decoration: underline;
  color: #93baf9;
}

.result-menu:hover {
  background-color: rgba(232, 234, 237, 0.08);
}

.result-menu:hover .material-symbols-outlined {
  color: #e8eaed;
}

/* Mobile Enhancements */
@media (max-width: 768px) {
  .result-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .search-suggestions {
    border-radius: 0 0 4px 4px;
  }

  .suggestion-item {
    padding: 16px;
  }

  .error-content {
    margin: 16px;
    padding: 24px;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  .search-result,
  .search-suggestions,
  .loading-spinner {
    animation: none;
    transition: none;
  }
}

/* Focus States */
.search-input-wrapper:focus-within {
  box-shadow: 0 2px 8px rgba(138, 180, 248, 0.3);
}

.nav-item:focus,
.suggestion-item:focus,
.retry-button:focus {
  outline: 2px solid #8ab4f8;
  outline-offset: 2px;
}
