/* ========================================
   HOMEPAGE SPECIFIC STYLES
   ======================================== */

/* Google-style Header - Seamless */
.google-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  background: transparent;
  padding: 8px 20px;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
}

.home-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  color: #374151;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.home-link:hover {
  background: #f3f4f6;
}

.apps-dropdown {
  position: relative;
}

.apps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  color: #5f6368;
  transition: background 0.2s ease;
}

.apps-btn:hover {
  background: #f1f3f4;
}

.apps-dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: white;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 16px;
  min-width: 320px;
  display: none;
  z-index: 1001;
}

.apps-dropdown-content.show {
  display: block;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: #5f6368;
  transition: background 0.2s ease;
  font-size: 12px;
}

.app-item:hover {
  background: #f8f9fa;
}

.app-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Checkbox Filter Container */
.checkbox-filter-container {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  position: relative;
  z-index: 10;
}

.filter-header {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9fafb;
  border-radius: 8px;
  transition: background 0.2s ease;
  user-select: none;
}

.filter-header:hover {
  background: #f3f4f6;
}

.filter-label {
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

.selected-count {
  font-size: 12px;
  color: #6b7280;
  background: #e5e7eb;
  padding: 2px 8px;
  border-radius: 12px;
}

.dropdown-arrow {
  font-size: 12px;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.filter-header.open .dropdown-arrow {
  transform: rotate(180deg);
}

.filter-dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border-top: 1px solid #e5e7eb;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  border: 1px solid #e1e5e9;
}

.filter-dropdown-content.show {
  max-height: 200px;
  overflow-y: auto;
}

.checkbox-list {
  padding: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
  min-height: 44px;
  border-bottom: 1px solid #f3f4f6;
}

.checkbox-item:hover {
  background: #f3f4f6;
}

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

.checkbox-item input[type="checkbox"] {
  margin-right: 12px;
  transform: scale(1.2);
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.checkbox-item label {
  cursor: pointer;
  flex-grow: 1;
  font-size: 14px;
  color: #374151;
  line-height: 1.4;
  margin: 0;
}

.checkbox-item.all-option {
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 4px;
  font-weight: 500;
  background: #f8fafc;
}

/* Retro Loading Animation - Only the Loading Bar */
.retro-loading-container {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  margin: 5px 0;
}

.retro-loading-container.active {
  display: flex;
}

.simple-loading-bar {
  width: 300px;
  height: 20px;
  background: #f0f0f0;
  border: 2px inset #d0d0d0;
  border-radius: 2px;
  padding: 2px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a90e2, #67b3f0, #4a90e2);
  background-size: 60px 100%;
  animation: loadingBarFlow 1.5s linear infinite;
  border-radius: 1px;
  width: 100%;
}

@keyframes loadingBarFlow {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Filter Section */
.search-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 500px;
  margin: 0 auto;
  padding: 16px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e1e5e9;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-row {
  position: relative;
  width: 100%;
  margin-bottom: 8px;
}

.filter-row:last-of-type {
  margin-bottom: 0;
} /* Google-style Header - Seamless */
.google-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  background: transparent;
  padding: 8px 20px;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
}

.home-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  color: #374151;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.home-link:hover {
  background: #f3f4f6;
}

.apps-dropdown {
  position: relative;
}

.apps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  color: #5f6368;
  transition: background 0.2s ease;
}

.apps-btn:hover {
  background: #f1f3f4;
}

.apps-dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: white;
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 16px;
  min-width: 320px;
  display: none;
  z-index: 1001;
}

.apps-dropdown-content.show {
  display: block;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: #3c4043;
  transition: background 0.2s ease;
}

.app-item:hover {
  background: #f8f9fa;
}

.app-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.app-icon.mba-icon {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-radius: 8px;
  padding: 4px 10px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.35);
  font-weight: 600;
  line-height: 1;
  min-width: 42px; /* fixed badge width for 1 / 2 */
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
}

.app-icon.bba-icon {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: 8px;
  padding: 4px 10px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.35);
  font-weight: 600;
  line-height: 1;
  min-width: 42px; /* fixed badge width for 1-8 */
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
}

.app-label {
  font-size: 12px;
  text-align: center;
  font-weight: 400;
  line-height: 1.2;
}

/* Search Engine Style Overrides */
.main-search-section {
  text-align: center;
  padding: 60px 20px 60px; /* Reduced top padding since header is not fixed */
  max-width: 600px;
  margin: 0 auto;
}

.search-engine-logo {
  font-size: 4rem;
  margin-bottom: 10px;
}

.search-engine-title {
  font-size: 2.5rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 40px;
}

.main-search-box {
  position: relative;
  max-width: 500px;
  margin: 0 auto 30px;
}

.main-search-input {
  width: 100%;
  padding: 15px 50px 15px 20px;
  font-size: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 24px;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.main-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 18px;
}

.search-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
  align-items: center;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Checkbox Filter Container */
.checkbox-filter-container {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  position: relative;
  z-index: 10; /* Added z-index to ensure dropdown appears above other elements */
}

.filter-header {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9fafb;
  border-radius: 8px;
  transition: background 0.2s ease;
  user-select: none;
}

.filter-header:hover {
  background: #f3f4f6;
}

.filter-label {
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

.selected-count {
  font-size: 12px;
  color: #6b7280;
  background: #e5e7eb;
  padding: 2px 8px;
  border-radius: 12px;
}

.dropdown-arrow {
  font-size: 12px;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.filter-header.open .dropdown-arrow {
  transform: rotate(180deg);
}

.filter-dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border-top: 1px solid #e5e7eb;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  border: 1px solid #e1e5e9;
}

.filter-dropdown-content.show {
  max-height: 200px;
  overflow-y: auto;
}

.checkbox-list {
  padding: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
  min-height: 44px; /* Better touch target for mobile */
  border-bottom: 1px solid #f3f4f6;
}

.checkbox-item:hover {
  background: #f3f4f6;
}

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

.checkbox-item input[type="checkbox"] {
  margin-right: 12px;
  transform: scale(1.2); /* Larger for easier clicking */
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.checkbox-item label {
  cursor: pointer;
  flex-grow: 1;
  font-size: 14px;
  color: #374151;
  line-height: 1.4;
  margin: 0; /* Remove default margins */
}

.checkbox-item.all-option {
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 4px;
  font-weight: 500;
  background: #f8fafc;
}

/* Filter Section - Clean & Streamlined */
.search-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-item {
  position: relative;
  width: 100%;
}

.filter-button {
  width: 100%;
  padding: 12px 16px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: #374151;
}

.filter-button:hover {
  border-color: #3b82f6;
  box-shadow: 0 1px 6px rgba(59, 130, 246, 0.15);
}

.filter-button.active {
  border-color: #3b82f6;
  background: #f8faff;
  box-shadow: 0 1px 6px rgba(59, 130, 246, 0.15);
}

.filter-button-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-weight: 500;
  color: #374151;
}

.filter-count {
  font-size: 11px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 10px;
}

.filter-arrow {
  transition: transform 0.2s ease;
  color: #6b7280;
  font-size: 12px;
}

.filter-button.active .filter-arrow {
  transform: rotate(180deg);
}

.filter-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 2px;
  display: none;
}

.filter-dropdown-content.show {
  display: block;
}

.filter-option {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f1f3f4;
}

.filter-option:last-child {
  border-bottom: none;
}

.filter-option:hover {
  background: #f8f9fa;
}

.filter-option input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.1);
  cursor: pointer;
}

.filter-option label {
  cursor: pointer;
  flex: 1;
  font-size: 13px;
  color: #374151;
}

.search-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px auto 30px;
  max-width: 500px;
  padding: 10px 15px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 14px;
  color: #6b7280;
}

/* Advanced Options Toggle - Google-like */
.options-toggle {
  margin-top: 20px;
  text-align: center;
}

.options-toggle-btn {
  background: none;
  border: none;
  color: #1a73e8;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.2s ease;
  font-weight: 500;
  position: relative;
  outline: none;
}

.options-toggle-btn:hover {
  background: rgba(26, 115, 232, 0.08);
  text-decoration: none;
}

.options-toggle-btn:focus {
  background: rgba(26, 115, 232, 0.12);
}

.options-toggle-btn::after {
  content: "";
  margin-left: 0;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.options-toggle-btn .accordion-icon {
  margin-left: 8px;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.options-toggle-btn.active .accordion-icon {
  transform: rotate(180deg);
}

.advanced-options {
  margin-top: 20px;
  display: none;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: none;
  animation: slideDown 0.2s ease-out;
}

.advanced-options.show {
  display: block;
}

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

.options-section {
  margin-bottom: 20px;
}

.options-section:last-child {
  margin-bottom: 0;
}

.options-section-title {
  font-size: 14px;
  font-weight: 500;
  color: #3c4043;
  margin-bottom: 12px;
  display: block;
}

.search-stats-subtle {
  font-size: 13px;
  color: #5f6368;
  margin-bottom: 0;
  text-align: center;
  padding: 8px 0;
  background: transparent;
  border-radius: 0;
}

.cache-reset-link {
  color: #1a73e8;
  text-decoration: none;
  font-size: 13px;
  margin-left: 8px;
  transition: color 0.2s ease;
  font-weight: 500;
}

.cache-reset-link:hover {
  color: #1557b0;
  text-decoration: underline;
}

.apply-filters-btn-subtle {
  background: #1a73e8;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-top: 8px;
  outline: none;
  font-family: inherit;
  width: 100%;
}

.apply-filters-btn-subtle:hover {
  background: #1557b0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.apply-filters-btn-subtle:focus {
  background: #1557b0;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.apply-filters-btn-subtle:active {
  background: #1347a0;
}

.search-stats {
  flex: 1;
}

.cache-btn,
.apply-filters-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-top: 16px;
  width: 100%;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.apply-filters-btn:hover {
  background: #2563eb;
  box-shadow: 0 1px 6px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  color: #3c4043;
  min-width: 140px;
  width: 100%;
  margin: 0;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.filter-select:hover {
  border-color: #1a73e8;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.1);
}

.filter-select:focus {
  border-color: #1a73e8;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.2);
}

.filter-select option {
  background: #ffffff;
  color: #3c4043;
  padding: 8px;
}

.search-results-container {
  margin: 40px auto;
  max-width: 800px;
  display: none;
}

.search-results-container.visible {
  display: block;
}

.quick-access-section {
  margin: 60px auto;
  max-width: 1000px;
  padding: 0 20px;
}

.quick-access-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 30px;
}

.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.quick-access-card {
  display: flex;
  align-items: center;
  padding: 20px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  color: #374151;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quick-access-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.quick-access-icon {
  font-size: 2rem;
  margin-right: 15px;
}

.quick-access-text {
  font-weight: 500;
}

.results-status {
  text-align: center;
  margin: 20px 0;
  font-size: 14px;
  color: #6b7280;
}

/* Hide sidebar on index page */
.sidebar {
  display: none !important;
}

/* Adjust main content when sidebar is hidden */
body {
  margin-left: 0 !important;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
  .main-search-section {
    padding: 50px 15px 40px; /* Adjusted for mobile with less top padding */
  }

  .search-engine-title {
    font-size: 2rem;
  }

  .main-search-input {
    font-size: 16px;
    padding: 12px 45px 12px 15px;
  }

  .main-search-input::placeholder {
    font-size: 14px;
  }

  .apps-dropdown-content {
    min-width: 280px;
    right: -10px;
  }

  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-right {
    gap: 10px;
  }

  .home-link {
    padding: 6px 8px;
    font-size: 13px;
  }

  .advanced-options {
    margin: 20px 0 0;
    padding: 0;
    max-width: none;
  }

  .search-filters {
    flex-direction: column;
    gap: 12px;
    align-items: center;
    max-width: none;
    width: 100%;
  }

  .filter-row {
    width: 100%;
  }

  .filter-select {
    width: 100%;
    max-width: 300px;
    min-width: auto;
  }

  .apply-filters-btn-subtle {
    width: 100%;
    max-width: 300px;
    margin-left: 0;
    margin-top: 8px;
  }

  .options-toggle-btn {
    padding: 10px 20px;
    font-size: 15px;
  }
}

/* Results section styling */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: #f9fafb;
  border-radius: 8px;
}

.accordion-controls {
  display: flex;
  gap: 10px;
}

.control-btn {
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.control-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* Result Controls Dropdown */
.result-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 15px;
  padding: 15px;
  background: #f9fafb;
  border-radius: 8px;
}

.controls-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  padding: 8px 16px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-toggle:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: white;
  min-width: 180px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border: 1px solid #d1d5db;
  border-radius: 6px;
  z-index: 1000;
  padding: 4px 0;
}

.dropdown-content.show {
  display: block;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  font-size: 13px;
  text-align: left;
  border: none;
  background: none;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.2s;
}

.dropdown-item:hover {
  background: #f3f4f6;
}

.dropdown-item:active {
  background: #e5e7eb;
}
