
/* Import theme system */
@import url('theme.css');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

:root {
  --primary-green: #2e7d32;
  --secondary-green: #4caf50;
  --accent-green: #66bb6a;
  --light-green: #e8f5e8;
  --dark-green: #1b5e20;
  --text-dark: #1e2f1e;
  --text-medium: #2f622f;
  --background: #f9f9f9;
  --white: #ffffff;
  --shadow-light: rgba(0, 0, 0, 0.05);
  --shadow-medium: rgba(0, 0, 0, 0.1);
  --shadow-dark: rgba(0, 0, 0, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 12px;
  --border-radius-large: 20px;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-secondary, #f9f9f9);
  color: var(--text-primary, #333);
  line-height: 1.6;
  min-height: 100vh;
}

main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* HEADER */
header.header {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
  padding: 2.5rem 0;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  position: relative;
  z-index: 2;
}

.header-content {
  text-align: center;
  max-width: 1000px;
  margin: 0 auto;
}

.header-content h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin: 0;
}

.header-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0.5rem 0 1rem;
}

.header-content > div {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Theme Toggle + Back Button */
.theme-toggle, .back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(6px);
  text-decoration: none;
}

.theme-toggle {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.35);
  transform: translateY(-2px);
}

.theme-toggle i {
  font-size: 1rem;
}

.theme-toggle .moon-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.2);
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: inline;
}

.back-button {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
}

.back-button:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

/* ENHANCED SEARCH & FILTER */
.search-container {
  margin: 2rem auto;
  text-align: center;
  max-width: 1000px;
  padding: 0 1rem;
}

.search-bar {
  margin-bottom: 2rem;
}

.search-input-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 1.1rem;
  z-index: 2;
}

.search-input {
  width: 100%;
  padding: 16px 20px 16px 50px;
  border-radius: 25px;
  border: 2px solid #e0e0e0;
  font-size: 1rem;
  outline: none;
  background: var(--bg-primary, white);
  color: var(--text-primary, #333);
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--secondary-green);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.2);
  transform: translateY(-2px);
}

.clear-search {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.clear-search:hover {
  background: rgba(0,0,0,0.1);
  color: #666;
}

/* Filter Controls */
.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: end;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-primary, white);
  border-radius: var(--border-radius-large);
  box-shadow: 0 4px 15px var(--shadow-light);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 150px;
}

.filter-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select {
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: var(--bg-secondary, #f8f9fa);
  color: var(--text-primary, #333);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-select:focus {
  border-color: var(--secondary-green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.reset-filters {
  padding: 10px 20px;
  background: linear-gradient(135deg, #ff7043, #ff5722);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  height: fit-content;
}

.reset-filters:hover {
  background: linear-gradient(135deg, #f4511e, #e64a19);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 112, 67, 0.3);
}

/* Results Summary */
.results-summary {
  text-align: center;
  margin-bottom: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--light-green);
  border-radius: 25px;
  color: var(--dark-green);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-block;
}

/* DEALER SECTIONS*/
.section {
  margin: 3rem 0;
  transition: all 0.3s ease;
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--primary-green);
}

.section-icon {
  font-size: 1.4rem;
}

.dealer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.dealer-card {
  background: var(--bg-primary, white);
  border-radius: var(--border-radius-large);
  padding: 2rem;
  box-shadow: 0 6px 20px var(--shadow-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(76, 175, 80, 0.1);
  position: relative;
  overflow: hidden;
}

.dealer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary-green), var(--accent-green));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.dealer-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px var(--shadow-medium);
  border-color: var(--secondary-green);
}

.dealer-card:hover::before {
  transform: scaleX(1);
}

.dealer-name {
  margin: 0 0 0.6rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-green);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dealer-details {
  margin-bottom: 1.5rem;
}

.dealer-info {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-secondary, rgba(248, 249, 250, 0.8));
  border-radius: var(--border-radius);
  border-left: 3px solid var(--accent-green);
}

.location-icon {
  color: var(--secondary-green);
  font-size: 1.1rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.address {
  font-size: 0.95rem;
  color: var(--text-primary, #333);
  line-height: 1.4;
}

.dealer-services {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(76, 175, 80, 0.05);
  border-radius: var(--border-radius);
  border-left: 3px solid var(--primary-green);
}

.service-icon {
  color: var(--primary-green);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.dealer-services span {
  font-size: 0.95rem;
  color: var(--text-medium);
  font-weight: 500;
}

.dealer-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.contact-btn {
  flex: 1;
  min-width: 120px;
  padding: 12px 16px;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.contact-btn.primary {
  background: linear-gradient(135deg, var(--secondary-green), var(--accent-green));
  color: white;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.25);
}

.contact-btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.35);
}

.contact-btn.secondary {
  background: transparent;
  color: var(--primary-green);
  border: 2px solid var(--primary-green);
}

.contact-btn.secondary:hover {
  background: var(--primary-green);
  color: white;
  transform: translateY(-2px);
}

/* NO RESULTS*/
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  margin: 2rem 0;
}

.no-results-content {
  background: var(--bg-primary, white);
  padding: 3rem 2rem;
  border-radius: var(--border-radius-large);
  box-shadow: 0 8px 25px var(--shadow-light);
  border: 2px dashed #ddd;
  max-width: 500px;
  margin: 0 auto;
}

.no-results i {
  font-size: 4rem;
  color: #ccc;
  margin-bottom: 1.5rem;
}

.no-results h3 {
  color: var(--text-medium);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.no-results p {
  color: var(--text-secondary, #666);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.reset-filters-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--secondary-green), var(--accent-green));
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.reset-filters-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.3);
}

/* MODAL*/
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: var(--bg-primary, white);
  margin: 5% auto;
  padding: 0;
  border-radius: var(--border-radius-large);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  background: linear-gradient(135deg, var(--secondary-green), var(--accent-green));
  color: white;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 2rem;
  max-height: 60vh;
  overflow-y: auto;
}

/* RESPONSIVE DESIGN*/
@media (max-width: 768px) {
  .filter-controls {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .filter-group {
    width: 100%;
    min-width: unset;
  }
  
  .dealer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .dealer-card {
    padding: 1.5rem;
  }
  
  .dealer-actions {
    flex-direction: column;
  }
  
  .contact-btn {
    min-width: unset;
  }
  
  .search-input {
    padding: 14px 18px 14px 45px;
  }
  
  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
  
  .modal-body {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .header-content h1 {
    font-size: 1.8rem;
  }
  
  .header-content > div {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .search-container {
    margin: 1rem auto;
    padding: 0 0.5rem;
  }
  
  .dealer-card {
    padding: 1.25rem;
  }
  
  .dealer-name {
    font-size: 1.1rem;
  }
}

/* ANIMATIONS */
.dealer-card {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: slideInFromBottom 0.8s ease-out;
}

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Filter transition effects */
.dealer-card.filtered-out {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.dealer-card.filtered-in {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* FOOTER (you already had, refined a bit) */
.site-footer {
  background: linear-gradient(135deg,#2e7d32,#66bb6a);
  color:#fff;
  margin-top:auto;
  padding: 2.5rem 1.5rem;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

/* MODAL STYLES */
.dealer-detail-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.dealer-detail-section:last-of-type {
  border-bottom: none;
  margin-bottom: 2rem;
}

.dealer-detail-section h4 {
  color: var(--primary-green);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dealer-detail-section p {
  color: var(--text-primary, #333);
  line-height: 1.5;
  margin: 0;
}

.dealer-detail-section a {
  color: var(--secondary-green);
  text-decoration: none;
  font-weight: 600;
}

.dealer-detail-section a:hover {
  text-decoration: underline;
}

.services-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.services-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: var(--text-primary, #333);
}

.services-list li i {
  color: var(--secondary-green);
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-btn {
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  justify-content: center;
}

.modal-btn.primary {
  background: linear-gradient(135deg, var(--secondary-green), var(--accent-green));
  color: white;
}

.modal-btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.3);
}

.modal-btn.secondary {
  background: transparent;
  color: var(--text-medium);
  border: 2px solid #ddd;
}

.modal-btn.secondary:hover {
  background: #f8f9fa;
  border-color: var(--secondary-green);
  color: var(--primary-green);
}
/* Floating Chatbot Button */
#chatbotBtn {
  position: fixed;
  bottom: 100px; /* 20px above scroll-to-top button */
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #4caf50; /* greenish theme */
  color: #fff;
  font-size: 28px;
  text-align: center;
  line-height: 60px;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  z-index: 1100; /* above scroll-to-top button */
}

#chatbotBtn:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 22px rgba(0,0,0,0.35);
  background-color: #43a047; /* slightly darker green on hover */
}

/* Mobile responsiveness: hide on very small screens */
@media (max-width: 400px) {
  #chatbotBtn {
    display: none;
  }
}