/* Modern Cars Page Styling */

/* Compact Filter Section */
.compact-filter-section {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 15px 0;
  position: sticky;

  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.compact-filter-card {
  background: white;
  border-radius: 12px;
  padding: 15px;
  border: 1px solid #e5e7eb;
}

.filter-form-horizontal {
  width: 100%;
}

.filter-row {
  display: flex;
  align-items: end;
  gap: 15px;
  flex-wrap: wrap;
}

.filter-item {
  flex: 1;
  min-width: 150px;
}

.filter-item label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.compact-filter-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  padding-right: 28px;
}

.compact-filter-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.filter-actions {
  flex: 0 0 auto;
}

.btn-compact-search {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-compact-search:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Mobile Filter */
.mobile-filter-toggle {
  display: none;
  margin-top: 10px;
}

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

.btn-mobile-filter:hover {
  background: #e5e7eb;
}

.mobile-filter-dropdown {
  display: none;
  margin-top: 10px;
  padding: 15px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

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

.mobile-filter-grid {
  display: grid;
  gap: 10px;
}

/* Desktop Hide Mobile Elements */
@media (min-width: 768px) {
  .mobile-filter-toggle,
  .mobile-filter-dropdown {
    display: none !important;
  }
}

/* Mobile Show Only Mobile Elements */
@media (max-width: 767px) {
  .filter-row {
    display: none;
  }
  
  .mobile-filter-toggle {
    display: block;
  }
  
  .compact-filter-section {
    position: relative;
  }
}

.modern-filter-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Desktop One-Line Filter */
.desktop-filter-row {
  align-items: center;
  gap: 15px;
  flex-wrap: nowrap;
}

.filter-item {
  flex: 1;
  min-width: 140px;
}

.filter-control-inline {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background: white;
  color: #374151;
}

.filter-control-inline:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-filter-search-inline,
.btn-filter-reset-inline {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.btn-filter-search-inline {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
}

.btn-filter-search-inline:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

.btn-filter-reset-inline {
  background: transparent;
  color: #6b7280;
  border: 2px solid #e5e7eb;
}

.btn-filter-reset-inline:hover {
  border-color: #9ca3af;
  color: #374151;
}

/* Mobile Filter Dropdown */
.mobile-filter-dropdown {
  width: 100%;
}

.mobile-filter-toggle {
  width: 100%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.mobile-filter-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

.mobile-filter-panel {
  margin-top: 15px;
  padding: 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
}

.mobile-filter-panel .filter-group {
  margin-bottom: 15px;
}

.mobile-filter-panel .filter-group label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mobile-filter-panel .filter-control {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background: white;
}

.mobile-filter-panel .filter-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.mobile-filter-panel .filter-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.mobile-filter-panel .btn-filter-search {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  font-size: 0.9rem;
}

.mobile-filter-panel .btn-filter-search:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

.mobile-filter-panel .btn-filter-reset {
  background: transparent;
  color: #6b7280;
  border: 2px solid #e5e7eb;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.mobile-filter-panel .btn-filter-reset:hover {
  border-color: #9ca3af;
  color: #374151;
}

.filter-group {
  margin-bottom: 15px;
}

.filter-group label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background: white;
}

.filter-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-buttons {
  display: flex;
  gap: 12px;
  margin-top: 15px;
}

.btn-filter-search {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
  font-size: 0.85rem;
}

.btn-filter-search:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-filter-reset {
  background: transparent;
  color: #6b7280;
  border: 2px solid #e5e7eb;
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85rem;
}

.btn-filter-reset:hover {
  border-color: #9ca3af;
  color: #374151;
}

/* Quick Filters */
.quick-filters {
  margin-top: 15px;
}

.quick-filters-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quick-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-filter-tag {
  background: #f3f4f6;
  color: #374151;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.quick-filter-tag:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

.quick-filter-tag.active {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border-color: #3b82f6;
}

/* Car Grid */
.modern-cars-grid {
  margin-top: 20px;
}

/* Fix Bootstrap Grid Layout Issues */
.modern-cars-grid .row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -15px;
  margin-right: -15px;
}

.modern-cars-grid .row > [class*="col-"] {
  display: flex;
  flex-direction: column;
  padding-left: 15px;
  padding-right: 15px;
  margin-bottom: 30px;
}

/* Ensure all cards have equal height */
.modern-cars-grid .modern-car-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.modern-cars-grid .car-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.modern-cars-grid .car-actions {
  margin-top: auto;
  padding-top: 15px;
}

.cars-section-header {
  text-align: center;
  margin-bottom: 25px;
}

.cars-count-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 6px 16px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 10px;
}

.cars-section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.cars-section-subtitle {
  color: #6b7280;
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Modern Car Cards */
.modern-car-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 1px solid #f3f4f6;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.modern-car-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.car-image-container {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

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

.modern-car-card:hover .car-image {
  transform: scale(1.05);
}

.availability-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.availability-badge.available {
  background: #10b981;
  color: white;
}

.availability-badge.booked {
  background: #ef4444;
  color: white;
}

.availability-badge.available-soon {
  background: #f59e0b;
  color: white;
}

.car-details {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.car-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 15px;
}

.car-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.car-feature {
  display: flex;
  align-items: center;
  color: #6b7280;
  font-size: 0.9rem;
}

.car-feature i {
  width: 20px;
  color: #3b82f6;
  margin-right: 8px;
}

.car-pricing {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: #f8fafc;
  border-radius: 12px;
}

.price-main {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
}

.price-duration {
  color: #6b7280;
  font-size: 0.9rem;
}

.car-notes {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: #92400e;
}

.car-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.btn-book-now {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-book-now i {
  font-size: 16px;
  margin-right: 0 !important;
}

.btn-book-now:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
  color: white;
  text-decoration: none;
  background: linear-gradient(135deg, #2563eb, #1e40af);
}

.btn-car-booked {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: not-allowed;
  flex: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-car-booked i {
  font-size: 16px;
  margin-right: 0 !important;
}

.btn-view-details {
  background: transparent;
  color: #6b7280;
  border: 2px solid #e5e7eb;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-view-details:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  text-decoration: none;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 80px 20px;
  background: white;
  border-radius: 20px;
  margin: 40px 0;
}

.no-results-icon {
  font-size: 4rem;
  color: #d1d5db;
  margin-bottom: 20px;
}

.no-results-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 10px;
}

.no-results-subtitle {
  color: #6b7280;
  margin-bottom: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modern-filter-section {
    padding: 20px 0;
  }
  
  .filter-title {
    font-size: 1.5rem;
  }
  
  .modern-filter-card {
    padding: 15px;
  }
  
  .filter-group {
    margin-bottom: 12px;
  }
  
  .filter-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  .quick-filter-tags {
    justify-content: center;
  }
  
  .car-features {
    grid-template-columns: 1fr;
  }
  
  .car-pricing {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .car-actions {
    flex-direction: column;
  }
  
  /* Fix grid on mobile */
  .modern-cars-grid .row > [class*="col-"] {
    margin-bottom: 20px;
  }
}

@media (max-width: 576px) {
  .modern-filter-section {
    padding: 15px 0;
  }
  
  .filter-title {
    font-size: 1.3rem;
  }
  
  .cars-section-title {
    font-size: 1.5rem;
  }
  
  .car-details {
    padding: 20px;
  }
}

/* Additional Grid Fixes for Cross-Browser Compatibility */
@media (min-width: 992px) {
  .modern-cars-grid .row {
    display: flex;
    flex-wrap: wrap;
  }
  
  .modern-cars-grid .col-lg-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
  
  /* Ensure the last row aligns properly */
  .modern-cars-grid .col-lg-4:nth-child(3n+1) {
    clear: left;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .modern-cars-grid .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  /* Clear every 2nd item on tablet */
  .modern-cars-grid .col-md-6:nth-child(2n+1) {
    clear: left;
  }
}

/* Fallback for older browsers */
@supports not (display: flex) {
  .modern-cars-grid .modern-car-card {
    min-height: 500px;
  }
}

/* Medium and Small Screens - Book Now Button Responsive */
@media (max-width: 991.98px) {
  .btn-book-now,
  .btn-car-booked {
    width: 60% !important;
    max-width: 220px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
    flex: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
  }
  
  .btn-book-now i,
  .btn-car-booked i {
    font-size: 16px !important;
  }
  
  .car-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }
}

/* Loading Animation */
.loading-spinner {
  text-align: center;
  padding: 40px;
}

.spinner {
  border: 4px solid #f3f4f6;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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