:root {
  --primary-color: #0dc1c1; /* New Brand Color */
  --primary-dark: #13a2a2; /* Darker shade for hover/active states */
  --secondary-color: #64748b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --light-bg: #f8fafc;
  --dark-text: #1e293b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--dark-text);
  background-color: #ffffff;
  font-size: 16px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Header */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.98);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--primary-color) !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand:hover {
  color: var(--primary-dark) !important;
}

.nav-link {
  font-weight: 500;
  color: var(--dark-text) !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-color) !important;
  background-color: rgba(4, 164, 165, 0.1); /* Using new primary color with transparency */
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 50%, #026b6c 100%); /* Adjusted gradient */
  color: white;
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="a" cx="50%" cy="50%" r="50%"><stop offset="0%" stop-color="white" stop-opacity="0.1"/><stop offset="100%" stop-color="white" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="200" r="100" fill="url(%23a)"/><circle cx="800" cy="300" r="150" fill="url(%23a)"/><circle cx="400" cy="700" r="120" fill="url(%23a)"/></svg>');
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  margin-bottom: 3rem;
  opacity: 0.95;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* Search Bar */
.search-container {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

.search-form {
  background: white;
  border-radius: 16px;
  padding: 8px;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-input {
  flex: 1;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  border-radius: 12px;
  outline: none;
  color: var(--dark-text);
}

.search-input::placeholder {
  color: #9ca3af;
}

.location-input {
  width: 200px;
  border: none;
  padding: 1rem;
  font-size: 1rem;
  border-radius: 12px;
  outline: none;
  color: var(--dark-text);
  border-left: 1px solid var(--border-color);
}

.search-btn {
  background: var(--primary-color);
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Stats Section */
.stats-section {
  background: white;
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
}

.stat-item {
  padding: 1.5rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-color);
  display: block;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--secondary-color);
  font-weight: 500;
  font-size: 1rem;
}

/* Category Grid */
.categories-section {
  padding: 5rem 0;
  background: var(--light-bg);
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--dark-text);
}

.section-subtitle {
  text-align: center;
  font-size: 1.2rem;
  color: var(--secondary-color);
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.category-card {
  background: white;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  text-decoration: none;
  color: inherit;
  border-color: rgba(4, 164, 165, 0.2); /* Using new primary color with transparency */
}

.category-card:hover::before {
  transform: scaleX(1);
}

.category-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  display: block;
  transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
  transform: scale(1.1);
}

.category-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--dark-text);
}

.category-description {
  color: var(--secondary-color);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.category-count {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(4, 164, 165, 0.1); /* Using new primary color with transparency */
  color: var(--primary-color);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Featured Listings */
.featured-section {
  padding: 5rem 0;
  background: white;
}

.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.listing-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  position: relative;
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.listing-image {
 width: 100%;
  height: 220px;
  /* CHANGE THIS LINE from 'cover' to 'contain' */
  object-fit: contain; 
  
  /* Optional: Add a subtle background color for the empty space */
  background-color: #f8f9fa; 
}

.listing-card:hover .listing-image {
  transform: scale(2.05);
}

.listing-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--warning-color);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
}

.listing-content {
  padding: 2rem;
}

.listing-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--dark-text);
  line-height: 1.3;
}

.listing-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--secondary-color);
}

.listing-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.listing-description {
  color: var(--secondary-color);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.listing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.listing-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--secondary-color);
}

.rating-stars {
  color: #fbbf24;
}

/* Testimonials */
.testimonials-section {
  padding: 5rem 0;
  background: var(--light-bg);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.testimonial-card {
  background: white;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  text-align: center;
  position: relative;
}

.testimonial-quote {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--dark-text);
  margin-bottom: 2rem;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.testimonial-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial-info h4 {
  font-weight: 600;
  color: var(--dark-text);
  margin-bottom: 0.25rem;
}

.testimonial-info p {
  color: var(--secondary-color);
  font-size: 0.9rem;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--dark-text) 0%, #374151 100%);
  color: white;
  padding: 5rem 0;
  text-align: center;
}

.cta-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  line-height: 1;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  color: white;
  text-decoration: none;
}

.btn-outline-primary {
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  background-color: transparent;
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-outline:hover {
  background: white;
  color: var(--dark-text);
  text-decoration: none;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* Modal Styles */
.modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 2rem 2rem 1rem;
  border-radius: 16px 16px 0 0;
}

.modal-body {
  padding: 2rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-text);
}

.nav-tabs {
  border: none;
  margin-bottom: 2rem;
}

.nav-tabs .nav-link {
  border: none;
  color: var(--secondary-color);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  margin-right: 0.5rem;
}

.nav-tabs .nav-link.active {
  background: var(--primary-color);
  color: white;
}

.form-control {
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(4, 164, 165, 0.1); /* Using new primary color with transparency */
  outline: none;
}

.form-label {
  font-weight: 600;
  color: var(--dark-text);
  margin-bottom: 0.5rem;
  display: block;
}

/* Footer */
.footer {
  background: var(--dark-text);
  color: white;
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h5 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
}

.footer-section p,
.footer-section a {
  color: #d1d5db;
  text-decoration: none;
  line-height: 1.6;
}

.footer-section a:hover {
  color: white;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 2rem;
  text-align: center;
  color: #9ca3af;
}

/* Admin Panel Specific Styles */
.admin-sidebar {
  background: var(--light-bg);
  min-height: 100vh;
  padding: 2rem 1rem;
  transition: all 0.3s ease;
}

.admin-sidebar .navbar-brand {
  font-size: 1.5rem;
}

.admin-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--dark-text);
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: background 0.3s ease, color 0.3s ease;
}

.admin-nav-link:hover,
.admin-nav-link.active {
  background: var(--primary-color);
  color: white;
  text-decoration: none;
}

.stats-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem; /* Adjusted padding for smaller screens */
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem; /* Added margin for stacking */
}

.stats-number {
  font-size: 2rem; /* Adjusted font size */
  font-weight: 700;
  color: var(--primary-color);
}

.stats-label {
  color: var(--secondary-color);
  font-weight: 600;
  font-size: 0.9rem; /* Adjusted font size */
}

/* Responsive Design */
@media (max-width: 991.98px) {
  /* Medium devices (tablets, 768px and up) */
  .navbar-collapse {
    background-color: rgba(255, 255, 255, 0.98);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    border-top: 1px solid var(--border-color);
  }

  .navbar-nav {
    flex-direction: column;
  }

  .nav-item {
    width: 100%;
    text-align: center;
  }

  .nav-link {
    padding: 0.75rem 1rem !important;
  }

  .hero-section {
    padding: 3rem 0;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero-subtitle {
    font-size: clamp(1rem, 4vw, 1.2rem);
    margin-bottom: 2rem;
  }

  .search-form {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .search-input,
  .location-input,
  .search-btn {
    width: 100%;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
  }

  .location-input {
    border-left: none;
    border-top: 1px solid var(--border-color);
  }

  .search-btn {
    padding: 0.8rem 1.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
  }

  .categories-section,
  .featured-section,
  .testimonials-section,
  .cta-section {
    padding: 3rem 0;
  }

  .section-title,
  .cta-title {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .section-subtitle,
  .cta-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .category-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
  }

  .category-card {
    padding: 1.5rem;
  }

  .category-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }

  .category-title {
    font-size: 1.2rem;
  }

  .listings-grid {
    grid-template-columns: 1fr; /* Single column for listings */
    gap: 1.5rem;
  }

  .listing-card .listing-image {
    height: 180px;
  }

  .listing-content {
    padding: 1.5rem;
  }

  .listing-title {
    font-size: 1.1rem;
  }

  .listing-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .testimonial-card {
    padding: 1.5rem;
  }

  .testimonial-quote {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn-lg {
    width: 100%;
    max-width: 280px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }

  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-content {
    border-radius: 8px;
  }

  .modal-header,
  .modal-body {
    padding: 1.5rem;
  }

  /* Admin Panel Responsiveness */
  #wrapper {
    display: flex;
    width: 100%;
    transition: all 0.3s ease;
  }

  #sidebar-wrapper {
    min-width: 0;
    width: 0;
    overflow-x: hidden;
    position: fixed;
    height: 100%;
    z-index: 1030; /* Above navbar */
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  }

  #wrapper.toggled #sidebar-wrapper {
    width: 250px;
  }

  #page-content-wrapper {
    min-width: 100vw;
    margin-left: 0;
  }

  #wrapper.toggled #page-content-wrapper {
    margin-left: 250px;
  }

  #menu-toggle {
    display: block;
    margin-left: 1rem;
  }

  .admin-sidebar {
    padding: 1rem 0.5rem;
  }

  .admin-nav-link {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }

  .card-header h5 {
    font-size: 1.1rem;
  }

  .table-responsive {
    overflow-x: auto;
  }
}

@media (max-width: 575.98px) {
  /* Small devices (phones, less than 576px) */
  body {
    font-size: 15px;
  }

  .hero-section {
    padding: 2rem 0;
  }

  .hero-title {
    font-size: clamp(1.8rem, 10vw, 2.5rem);
  }

  .hero-subtitle {
    font-size: clamp(0.9rem, 4vw, 1.1rem);
  }

  .search-form {
    padding: 0.5rem;
  }

  .search-input,
  .location-input,
  .search-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .stats-grid {
    grid-template-columns: 1fr; /* Stack stats vertically */
  }

  .stats-card {
    padding: 1rem;
  }

  .stats-number {
    font-size: 2rem;
  }

  .section-title,
  .cta-title {
    font-size: 1.8rem;
  }

  .section-subtitle,
  .cta-subtitle {
    font-size: 0.9rem;
  }

  .category-grid {
    grid-template-columns: 1fr; /* Single column for categories */
    gap: 1rem;
  }

  .category-card {
    padding: 1rem;
  }

  .category-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .category-title {
    font-size: 1.1rem;
  }

  .listing-card .listing-image {
    height: 150px;
  }

  .listing-content {
    padding: 1rem;
  }

  .listing-title {
    font-size: 1rem;
  }

  .listing-meta {
    font-size: 0.8rem;
  }

  .listing-description {
    font-size: 0.85rem;
  }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .btn-lg {
    padding: 0.75rem 1.2rem;
    font-size: 1rem;
  }

  .modal-header,
  .modal-body {
    padding: 1rem;
  }

  .modal-title {
    font-size: 1.2rem;
  }

  .nav-tabs .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .footer-content {
    grid-template-columns: 1fr; /* Stack footer sections */
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }

  /* Admin Panel Specific */
  .p-4 {
    padding: 1rem !important;
  }

  .card-header {
    padding: 0.75rem 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  .table-responsive table {
    font-size: 0.8rem;
  }

  .table-responsive th,
  .table-responsive td {
    padding: 0.5rem;
  }
}

/* Loading animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Utility classes */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
