/* ==================== */
/* RESPONSIVE STYLES */
/* ==================== */
@media (max-width: 2048px) {
  .search-results {
    max-width: 100%;
  }

  .results-nav {
    margin-left: 0;
  }

  .image-grid {
    width: 95vw;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 1024px) {
  .results-nav {
    margin-left: 0;
  }

  .image-grid {
    width: 92vw;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 941px) {
  .header {
    height: 60px;
    padding: 10px 16px;
  }

  .profile-icon {
    margin: 0;
    margin-top: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-self: center;
  }

  .main-content {
    padding: 20px;
  }

  .logo-text {
    font-size: 48px;
  }

  .results-logo-container {
    width: 100%;
    text-align: center;
  }

  .results-logo-container img {
    margin: 0;
  }

  .results-search-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .search-container {
    max-width: 100%;
  }

  .search-box-wrapper {
    height: 50px;
    padding: 0 16px;
  }

  .buttons {
    gap: 12px;
  }

  .search-btn {
    height: 44px;
    line-height: 44px;
    font-size: 15px;
    min-width: 120px;
  }

  .results-header {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: auto;
    padding: 16px;
  }

  .debug-mode-btn {
    margin-top: 10px;
  }

  .results-logo {
    font-size: 24px;
    margin-bottom: 16px;
  }

  .results-search-container {
    margin-right: 0;
    max-width: 100%;
    width: 100%;
  }

  .results-nav {
    width: 100%;
    overflow-x: auto;
    padding: 0;
    margin-top: 16px;
    display: flex;
    justify-content: center;
  }

  .nav-item {
    white-space: nowrap;
    margin-right: 20px;
    padding: 0 6px 10px 6px;
  }

  .image-grid {
    width: 95vw;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  #image-sidebar {
    width: 100%;
    border-radius: 20px 20px 0 0;
    height: 80vh;
    bottom: 0;
    top: auto;
    transform: translateY(100%);
  }

  #image-sidebar.visible {
    transform: translateY(0);
  }

  .footer {
    margin-top: 20px;
  }

  .footer-top,
  .footer-bottom {
    padding: 16px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
  }

  .footer-link {
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 8px 12px;
  }

  .header a {
    margin-left: 8px;
    font-size: 13px;
    padding: 6px;
  }

  .main-content {
    padding: 16px;
  }

  .logo-text {
    font-size: 40px;
  }

  .search-box-wrapper {
    height: 46px;
    padding: 0 12px;
  }

  .search-box {
    font-size: 16px;
  }

  .buttons {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .search-btn {
    width: 100%;
  }

  .voice-search-icon,
  .camera-search-icon {
    padding: 0 6px;
  }

  .result-title {
    font-size: 20px;
  }

  .result-description {
    font-size: 14px;
  }

  .pagination {
    gap: 10px;
  }

  .pagination button {
    padding: 0 10px;
  }

  .image-grid {
    width: 90vw;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    padding: 12px;
  }

  .footer-top,
  .footer-bottom {
    padding: 12px;
    font-size: 13px;
  }

  .footer-link {
    font-size: 13px;
  }
}

@media (max-width: 386px) {
  .search-box {
    font-size: 16px;
    width: 20px;
  }

  .buttons {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .search-btn {
    width: 100%;
  }

  .voice-search-icon,
  .camera-search-icon {
    padding: 0 6px;
    width: 30px;
  }

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

  .result-description {
    font-size: 14px;
  }

  .pagination {
    gap: 10px;
  }

  .pagination button {
    padding: 0 10px;
  }

  .image-grid {
    width: 90vw;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    padding: 12px;
  }

  .footer-top,
  .footer-bottom {
    padding: 12px;
    font-size: 13px;
  }

  .footer-link {
    font-size: 13px;
  }
}

@media (max-width: 533px) {
  .results-nav {
    display: flex;
    justify-content: flex-start;
    padding: 0px 0px;
  }
}

/* Knowledge Card Responsive Adjustments */
@media (max-width: 1200px) {
  #knowledge-card {
    width: 400px;
  }

  .search-results {
    margin-left: 0;
    max-width: 100%;
  }

  .results-nav {
    display: flex;
    justify-self: flex-start;
    padding: 0px 30px;
  }
}

@media (max-width: 1000px) {
  #knowledge-card {
    position: relative;
    width: 100%;
    margin: 20px 0;
    right: auto;
    top: 0;
  }

  .results-section {
    flex-direction: column-reverse;
    margin: 0;
  }
}

@media (max-width: 941px) {
  .entity-image-container {
    width: 100px;
    height: 100px;
  }

  .entity-title-container h2 {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .knowledge-card-header {
    flex-direction: row;
  }

  .entity-image-container {
    height: auto;
    aspect-ratio: 1;
  }
}