/* Theme Colors - Red and Green */
.text-red {
  color: #dc2626 !important;
}

.text-green {
  color: #22c55e !important;
}

.border-green {
  border-color: #22c55e !important;
}

/* Override Bootstrap Blue Colors */
.text-primary {
  color: #22c55e !important;
}

.bg-primary {
  background-color: #22c55e !important;
}

.border-primary {
  border-color: #22c55e !important;
}

.btn-primary {
  background-color: #22c55e !important;
  border-color: #22c55e !important;
  color: white !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #16a34a !important;
  border-color: #16a34a !important;
  color: white !important;
}

/* Header Styles */
header {
  border-bottom: 1px solid #e5e5e5;
  background-color: #ffffff !important;
  z-index: 1000;
  position: relative;
}

/* Dropdown Z-index Fix */
.mega-dropdown {
  z-index: 9999 !important;
}

.dropdown-menu {
  z-index: 9999 !important;
}

/* Logo Styles */
header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
}

/* Navigation Styles */
.navbar-nav .nav-link {
  color: #374151;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

/* Dropdown Styles */
.dropdown-toggle {
  border: none;
  background: transparent;
  color: #374151;
  font-weight: 500;
}

.dropdown-toggle:hover {
  color: #22c55e;
}

.dropdown-menu {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 0;
}

.dropdown-item {
  color: #374151;
  font-weight: 400;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.dropdown-item:hover {
  background-color: #f3f4f6;
  color: #22c55e;
}

/* Location Button */
.btn-outline-secondary {
  border-color: #d1d5db;
  color: #6b7280;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
  border-color: #9ca3af;
  background-color: #f9fafb;
  color: #1f2937;
}

/* Mega Dropdown Styles */
.mega-dropdown {
  min-width: 800px;
  max-width: 900px;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
}

.mega-dropdown .dropdown-header {
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding: 0;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.mega-dropdown .dropdown-item {
  color: #6b7280;
  font-size: 13px;
  padding: 0.4rem 0;
  border: none;
  background: none;
  transition: all 0.2s ease;
}

.mega-dropdown .dropdown-item:hover {
  color: #22c55e;
  background-color: transparent;
  padding-left: 0.5rem;
}

/* Main Content */
main {
  background-color: #f4f4f4;
  min-height: 100vh;
}

/* Filters Sidebar */
.filters-sidebar {
  position: sticky;
  top: 20px;
  height: fit-content;
  max-height: none;
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

.filter-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 16px;
}

.filter-section {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.filter-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.selected-filters .badge {
  font-size: 11px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.selected-filters .badge:hover {
  background-color: #dc3545 !important;
}

.clear-filters {
  font-size: 12px;
  text-decoration: none;
}

.clear-filters:hover {
  text-decoration: underline;
}

/* New Car Card Styles */
.car-card {
  border: 2px solid #00a20b6b;
  border-radius: 20px;
  padding: 20px;
  background: white;
  position: relative;
  height: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.car-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(144, 238, 144, 0.3);
  border-color: #7dd87d;
}

.car-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
}

.heart-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  background: white;
  border: 2px solid rgba(196, 195, 195, 0.553);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.heart-icon i {
  color: #00a20b;
  font-size: 18px;
}

.car-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

.car-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #666;
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.price {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin-bottom: 15px;
}

.location {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #888;
  font-size: 14px;
  margin-top: auto;
}

.location i {
  color: #00a20b;
}

.container-custom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Auth Button Styles */
#desktop-my-ads-btn,
#desktop-logout-btn {
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 6px;
}

#desktop-my-ads-btn:hover,
#desktop-logout-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  text-decoration: none !important;
}

#desktop-logout-btn:hover {
  color: #dc3545 !important;
}

#mobile-my-ads-btn:hover,
#mobile-logout-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Footer Styles */
footer {
  background-color: #2c2c2c !important;
}

footer h6 {
  color: #ffffff;
  font-size: 14px;
  margin-bottom: 1rem;
}

footer ul li {
  margin-bottom: 0.5rem;
}

footer ul li a {
  font-size: 13px;
  color: #cccccc !important;
  transition: color 0.3s ease;
}

footer ul li a:hover {
  color: #ffffff !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .filters-sidebar {
    position: static;
    max-height: none;
    margin-bottom: 2rem;
  }

  .mega-dropdown {
    min-width: 300px;
    max-width: 350px;
  }
}

/* Additional Filter Styles */
.price-select,
.form-select {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 32px 8px 12px; /* Increased right padding from 12px to 32px to prevent text/arrow collision */
  font-size: 12px;
  color: #6b7280;
  background-color: #f9fafb;
  font-weight: 500;
  transition: border-color 0.3s ease;
}

.price-select:focus,
.form-select:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
  background-color: white;
  outline: none;
}

/* Quick Select Buttons */
.quick-select-section {
  margin-top: 16px;
}

.quick-select-title {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 12px;
}

.quick-select-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-select-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.quick-select-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.quick-select-btn.active {
  background: #dbeafe;
  border-color: #22c55e;
  color: #16a34a;
}

.form-control {
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 14px;
  color: #374151;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
  outline: none;
}

.form-control::placeholder {
  color: #9ca3af;
}

.input-group .btn {
  border-left: none;
  border-radius: 0 0.5rem 0.5rem 0;
}

.form-range {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.form-range::-webkit-slider-track {
  background: #e5e7eb;
  height: 4px;
  border-radius: 2px;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: #22c55e;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  cursor: pointer;
}

.form-range::-moz-range-track {
  background: #e5e7eb;
  height: 4px;
  border-radius: 2px;
  border: none;
}

.form-range::-moz-range-thumb {
  background: #22c55e;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Loading State */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.loading::after {
  content: "";
  width: 40px;
  height: 40px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid #22c55e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* No Results State */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: #6b7280;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 2rem 0;
}

.no-results h5 {
  margin-bottom: 1rem;
  color: #374151;
  font-size: 1.5rem;
  font-weight: 600;
}

.no-results p {
  font-size: 1rem;
  margin-bottom: 0;
}

/* Body Type Grid */
.body-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.body-type-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.body-type-item:hover {
  border-color: #22c55e;
  background-color: #eff6ff;
}

.body-type-item.selected {
  border-color: #22c55e !important;
  background-color: #dde7ff !important;
}

.body-type-icon {
  margin-bottom: 0.5rem;
  color: #6b7280;
}

.body-type-item.selected .body-type-icon {
  color: white;
}

.body-type-item span {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}

/* Fuel Type Buttons */
.fuel-type-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fuel-type-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 1.5rem;
  background: white;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.fuel-type-btn:hover {
  border-color: #22c55e;
  color: #22c55e;
}

.fuel-type-btn.active,
.fuel-type-btn.selected {
  background-color: #22c55e !important;
  border-color: #22c55e !important;
  color: white !important;
}

/* Color Grid */
.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.color-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.3s ease;
}

.color-item:hover {
  background-color: #f3f4f6;
}

.color-item.selected {
  background-color: #eff6ff;
}

.color-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-bottom: 0.25rem;
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
}

.color-item.selected .color-circle {
  border-color: #22c55e !important;
  border-width: 3px !important;
}

.color-item span {
  font-size: 11px;
  font-weight: 500;
  color: #374151;
  text-align: center;
}

/* Transmission Buttons */
.transmission-buttons {
  display: flex;
  gap: 0.5rem;
}

.transmission-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 1.5rem;
  background: white;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.transmission-btn:hover {
  border-color: #22c55e;
  color: #22c55e;
}

.transmission-btn.active,
.transmission-btn.selected {
  background-color: #22c55e !important;
  border-color: #22c55e !important;
  color: white !important;
}

/* Enhanced Responsive Design */

/* Large screens (1200px and up) */
@media (min-width: 1200px) {
  .container-custom {
    max-width: 1400px;
    padding: 50px 30px;
  }

  .car-card {
    padding: 25px;
  }

  .car-image {
    height: 220px;
  }
}

/* Medium screens (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .container-custom {
    padding: 40px 25px;
  }

  .car-card {
    padding: 22px;
  }
}

/* Tablet screens (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .filters-sidebar {
    margin-bottom: 2rem;
  }

  .car-card {
    padding: 20px;
  }

  .car-image {
    height: 180px;
  }

  .car-title {
    font-size: 18px;
  }

  .price {
    font-size: 22px;
  }
}

/* Mobile screens (576px to 767px) */
@media (max-width: 767px) {
  .filters-sidebar {
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    padding: 20px;
  }

  .body-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .color-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .container-custom {
    padding: 30px 15px;
  }

  .car-card {
    padding: 18px;
    margin-bottom: 1rem;
  }

  .car-image {
    height: 160px;
  }

  .car-title {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .car-specs {
    gap: 10px;
    margin-bottom: 15px;
  }

  .spec-item {
    font-size: 12px;
    padding: 4px 8px !important;
  }

  .price {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .location {
    font-size: 12px;
  }

  .heart-icon {
    width: 35px;
    height: 35px;
    top: 12px;
    right: 12px;
  }

  .heart-icon i {
    font-size: 16px;
  }
}

/* Small mobile screens (up to 575px) */
@media (max-width: 575px) {
  .container-custom {
    padding: 20px 10px;
  }

  .car-card {
    padding: 15px;
  }

  .car-image {
    height: 140px;
  }

  .car-title {
    font-size: 15px;
    margin-bottom: 10px;
  }

  .car-specs {
    gap: 8px;
    margin-bottom: 12px;
  }

  .spec-item {
    font-size: 11px;
    padding: 3px 6px !important;
  }

  .price {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .location {
    font-size: 11px;
  }

  .heart-icon {
    width: 32px;
    height: 32px;
    top: 10px;
    right: 10px;
  }

  .heart-icon i {
    font-size: 14px;
  }

  .body-type-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .color-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* Extra small screens (up to 400px) */
@media (max-width: 400px) {
  .container-custom {
    padding: 15px 8px;
  }

  .car-card {
    padding: 12px;
  }

  .car-image {
    height: 120px;
  }

  .car-title {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .car-specs {
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
  }

  .spec-item {
    font-size: 10px;
    padding: 2px 5px !important;
  }

  .price {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .location {
    font-size: 10px;
  }

  .heart-icon {
    width: 30px;
    height: 30px;
    top: 8px;
    right: 8px;
  }

  .heart-icon i {
    font-size: 12px;
  }

  .body-type-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .color-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}
