/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #5F6368;
  background-color: #FFFFFF;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Styles */
.main-header {
  background: #FFFFFF;
  color: #2B2F33;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #E8FBF4;
  max-height: 120px;
  overflow: visible;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  padding-left: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  margin-right: auto;
  margin-left: -2rem;
  padding-left: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-link {
  display: inline-block;
  text-decoration: none;
  line-height: 0;
}

.logo-image {
  height: 200px;
  width: auto;
  display: block;
  transition: opacity 0.3s ease;
  margin-top: -40px;
  margin-bottom: -40px;
}

.logo-image:hover {
  opacity: 0.9;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2B2F33;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.nav-link {
  color: #2B2F33;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  transition: color 0.3s;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: #4FD1A5;
  border-bottom-color: #4FD1A5;
}

.home-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.home-icon {
  width: 20px;
  height: 20px;
  color: #2B2F33;
  transition: color 0.15s ease-out, transform 0.15s ease-out;
}

.home-icon-link:hover .home-icon {
  color: #4FD1A5;
  transform: translateY(-2px);
}

.nav-login {
  color: #5F6368;
  font-weight: 400;
}

.nav-login:hover {
  color: #4FD1A5;
  border-bottom-color: transparent;
}

/* Messages Icon */
.messages-icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.messages-icon {
  width: 20px;
  height: 20px;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.messages-badge {
  background-color: #EF4444;
  color: white;
  border-radius: 10px;
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  position: absolute;
  top: 0;
  right: 0;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  transform: translate(50%, -50%);
  z-index: 2;
}

.btn-place-ad {
  padding: 0;
  background-color: #22C55E;
  color: #FFFFFF;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: all 0.3s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 100px;
  padding: 0 1.25rem;
  box-sizing: border-box;
  line-height: 1;
  margin-top: 1rem;
}

.btn-place-ad {
  transition: background-color 0.15s ease-out, transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.btn-place-ad:hover {
  background-color: #16A34A;
  color: #FFFFFF;
  text-decoration: none;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

/* Dropdown Menu */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem;
  height: 40px;
  min-width: 100px;
  box-sizing: border-box;
  border-radius: 6px;
  transition: background-color 0.08s cubic-bezier(0.4, 0, 0.2, 1), color 0.08s cubic-bezier(0.4, 0, 0.2, 1);
  color: #2B2F33;
  white-space: nowrap;
  line-height: 1;
  margin-top: -0.5rem;
}

.dropdown-toggle:hover {
  background-color: #F7F9FB;
}

.header-avatar-container {
  display: flex;
  align-items: center;
}

.header-avatar,
.header-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.header-avatar-placeholder {
  background-color: #D1FAE5;
  color: #22C55E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.header-greeting {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #2B2F33;
}

.dropdown-arrow {
  font-size: 0.75rem;
  color: #2B2F33;
  margin-left: 0.25rem;
}

.dropdown-menu {
  display: block;
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  background: white;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  padding: 0.5rem 0;
  z-index: 1000;
  list-style: none;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.08s cubic-bezier(0.4, 0, 0.2, 1), transform 0.08s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.08s;
  pointer-events: none;
  visibility: hidden;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.08s cubic-bezier(0.4, 0, 0.2, 1), transform 0.08s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

.dropdown:hover .dropdown-toggle {
  color: #4FD1A5;
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #2B2F33;
  text-decoration: none;
  transition: background-color 0.08s cubic-bezier(0.4, 0, 0.2, 1), color 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-item:hover {
  background-color: #E8FBF4;
  color: #2FA37A;
}

.dropdown-divider {
  height: 1px;
  margin: 0.5rem 0;
  background-color: #e0e0e0;
  border: none;
}

/* Main Content */
.main-content {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.listings-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.listings-header {
  margin-bottom: 2rem;
}

.listings-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #2B2F33;
  margin-bottom: 0.5rem;
}

.listings-subtitle {
  font-size: 1rem;
  color: #5F6368;
  margin: 0;
}

/* Hero Section */
.hero-section {
  background: #F7F9FB;
  color: #2B2F33;
  padding: 4rem 0;
  text-align: center;
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(2px);
}

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

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero-title {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: #FFFFFF;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.auth-buttons-hero {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.btn-hero {
  padding: 0.875rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s;
  display: inline-block;
}

.btn-login {
  background-color: transparent;
  color: #2B2F33;
  border: 2px solid #E0E0E0;
}

.btn-login:hover {
  background-color: #E8FBF4;
  border-color: #4FD1A5;
  color: #4FD1A5;
  transform: translateY(-2px);
}

.btn-signup-hero {
  background-color: #4FD1A5;
  color: white;
  border: 2px solid #4FD1A5;
}

.btn-signup-hero:hover {
  background-color: #2FA37A;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 209, 165, 0.3);
}

.search-box {
  margin-top: 2rem;
}

.search-form {
  width: 100%;
}

.search-input-group {
  display: flex;
  gap: 0.75rem;
  max-width: 800px;
  margin: 0 auto;
  background: white;
  padding: 0.75rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-input {
  flex: 1;
  padding: 1.125rem 1.25rem;
  border: none;
  border-radius: 4px;
  font-size: 1.125rem;
  outline: none;
}

.location-input {
  max-width: 220px;
}

.search-button {
  padding: 1.125rem 2.5rem;
  background-color: #4FD1A5;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}

.search-button {
  transition: background-color 0.15s ease-out, transform 0.15s ease-out;
}

.search-button:hover {
  background-color: #2FA37A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47, 163, 122, 0.3);
}

/* Car Filter Section */
.car-filter-section {
  padding: 1.5rem 0;
  background: #F7F9FB;
}

.car-filter-box {
  max-width: 900px;
  margin: 0 auto;
  background: #FFFFFF;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.car-filter-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2B2F33;
  margin-bottom: 1.25rem;
  text-align: center;
}

.car-filter-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.car-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem;
  margin-bottom: 0;
}

.car-filter-form .form-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.car-filter-field {
  display: flex;
  flex-direction: column;
}

.car-filter-field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #5F6368;
  margin-bottom: 0.375rem;
}

.car-filter-input,
.car-filter-select {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid #E0E0E0;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #2B2F33;
  background: #FFFFFF;
  transition: border-color 0.3s;
}

.car-filter-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235F6368' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  padding-right: 2rem;
}

/* Style for select elements in forms - compact for Post Ad form */
.form-select,
select.form-select,
select[name*="make"],
select[name*="model"],
select[name*="year"] {
  width: 100%;
  padding: 0.4375rem 1.875rem 0.4375rem 0.6875rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.8125rem;
  color: #2B2F33;
  background: #FFFFFF;
  transition: border-color 0.3s;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%235F6368' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6875rem center;
  background-size: 10px;
  line-height: 1.3;
}

.form-select:focus,
select.form-select:focus,
select[name*="make"]:focus,
select[name*="model"]:focus,
select[name*="year"]:focus {
  outline: none;
  border-color: #4FD1A5;
  box-shadow: 0 0 0 2px #E8FBF4;
}

.car-filter-input:focus,
.car-filter-select:focus {
  outline: none;
  border-color: #4FD1A5;
}

.car-filter-input::placeholder {
  color: #9CA3AF;
}

.car-filter-button {
  padding: 0.875rem 1.5rem;
  background: #4FD1A5;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}


.car-filter-button {
  transition: background 0.15s ease-out, transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.car-filter-button:hover {
  background: #2FA37A;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(47, 163, 122, 0.3);
}

.btn-clear-car-filters {
  padding: 0.75rem 1.5rem;
  background: white;
  color: #2B2F33;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-out;
  display: inline-block;
  margin-left: 1rem;
}

.btn-clear-car-filters:hover {
  background: #F7F9FB;
  border-color: #4FD1A5;
  color: #22C55E;
  transform: translateY(-1px);
}

/* Vehicle Type Filter Section */
.vehicle-type-filter-section {
  padding: 2rem 0;
  background: #F7F9FB;
  border-bottom: 1px solid #e0e0e0;
}

.vehicle-type-filter-box {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.vehicle-type-filter-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2B2F33;
  margin-bottom: 1.5rem;
  text-align: center;
}

.vehicle-type-filter-form {
  width: 100%;
}

.vehicle-type-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.vehicle-type-option {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease-out;
  position: relative;
}

.vehicle-type-option:hover {
  border-color: #4FD1A5;
  background: #F0FDF4;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 209, 165, 0.2);
}

.vehicle-type-option.active {
  border-color: #22C55E;
  background: #D1FAE5;
}

.vehicle-type-option input[type="radio"] {
  margin-right: 0.75rem;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #22C55E;
}

.vehicle-type-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.vehicle-type-icon {
  font-size: 2rem;
  line-height: 1;
}

.vehicle-type-label {
  font-weight: 500;
  color: #2B2F33;
  font-size: 0.9375rem;
  text-align: center;
}

.vehicle-type-option.active .vehicle-type-label {
  color: #16A34A;
  font-weight: 600;
}

.vehicle-type-count {
  color: #5F6368;
  font-size: 0.75rem;
}

.vehicle-type-option.active .vehicle-type-count {
  color: #16A34A;
}

.vehicle-type-filter-form .form-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}

.btn-clear-vehicle-filters {
  padding: 0.75rem 1.5rem;
  background: white;
  color: #2B2F33;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s ease-out;
}

.btn-clear-vehicle-filters:hover {
  background: #F7F9FB;
  border-color: #4FD1A5;
  color: #22C55E;
  transform: translateY(-1px);
}

/* Category Filter Section (for Browse page) */
.category-filter-section {
  padding: 2rem 0;
  background: #F7F9FB;
  border-bottom: 1px solid #e0e0e0;
}

.category-filter-box {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.category-filter-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2B2F33;
  margin-bottom: 1.5rem;
  text-align: center;
}

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

.category-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.category-filter-option {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease-out;
  position: relative;
}

.category-filter-option:hover {
  border-color: #4FD1A5;
  background: #F0FDF4;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 209, 165, 0.2);
}

.category-filter-option.active {
  border-color: #22C55E;
  background: #D1FAE5;
}

.category-filter-option input[type="radio"] {
  margin-right: 0.75rem;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #22C55E;
}

.category-filter-label {
  flex: 1;
  font-weight: 500;
  color: #2B2F33;
  font-size: 0.9375rem;
}

.category-filter-option.active .category-filter-label {
  color: #16A34A;
  font-weight: 600;
}

.category-count {
  color: #5F6368;
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

.category-filter-option.active .category-count {
  color: #16A34A;
}

.category-filter-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn-clear-filter {
  padding: 0.75rem 1.5rem;
  background: white;
  color: #2B2F33;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s ease-out;
}

.btn-clear-filter:hover {
  background: #F7F9FB;
  border-color: #4FD1A5;
  color: #22C55E;
  transform: translateY(-1px);
}

.btn-apply-filter {
  padding: 0.75rem 1.5rem;
  background: #22C55E;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-out;
}

.btn-apply-filter:hover {
  background: #16A34A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* Categories Section */
.categories-section {
  padding: 2rem 0;
  background: #FFFFFF;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #2B2F33;
  text-decoration: none;
  border-bottom: none;
}

.categories-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.category-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #2B2F33;
  transition: transform 0.15s ease-out, color 0.15s ease-out;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 12px;
}

.category-icon-item:hover {
  transform: translateY(-6px) scale(1.05);
  text-decoration: none;
  color: #22C55E;
}

.category-icon-large {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.1);
  transition: background 0.15s ease-out, transform 0.15s ease-out;
}

.category-icon-item:hover .category-icon-large {
  background: rgba(34, 197, 94, 0.2);
  transform: scale(1.1);
}

.category-icon-item span {
  font-size: 0.875rem;
  font-weight: 500;
  color: #2B2F33;
  transition: color 0.15s ease-out, font-weight 0.15s ease-out;
}

.category-icon-item:hover span {
  color: #22C55E;
  font-weight: 600;
}

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

.category-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  text-decoration: none !important;
  display: block;
  color: inherit;
}

.category-card:hover {
  border-color: #4FD1A5;
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(79, 209, 165, 0.2);
  text-decoration: none !important;
}

.category-card * {
  text-decoration: none !important;
  border-bottom: none !important;
}

.category-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.category-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #2B2F33;
  text-decoration: none !important;
  border-bottom: none !important;
}

.category-card p {
  color: #5F6368;
  font-size: 0.875rem;
  text-decoration: none !important;
  border-bottom: none !important;
}

/* Listings Section */
.listings-section {
  padding: 3rem 0;
}

.homepage-main-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.featured-listings-column {
  width: 100%;
}

.sell-box-column {
  width: 100%;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.sell-box {
  background: #FFFFFF;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 20px;
}

.sell-box-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2B2F33;
  margin-bottom: 1rem;
}

.sell-box-text {
  font-size: 0.9375rem;
  color: #5F6368;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.btn-place-ad {
  display: block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: #22C55E;
  color: white;
  text-align: center;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s;
  margin-bottom: 1.5rem;
}

.btn-place-ad {
  transition: background 0.15s ease-out, transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.btn-place-ad:hover {
  background: #16A34A;
  text-decoration: none;
  color: white;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

.sell-box-benefits {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #2B2F33;
}

.check-icon {
  color: #22C55E;
  font-weight: bold;
  font-size: 1rem;
}

.view-all-link {
  color: #22C55E;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
}

.view-all-link:hover {
  text-decoration: underline;
}

.view-all-link {
  color: #4FD1A5;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease-out, transform 0.15s ease-out;
  display: inline-block;
}

.view-all-link:hover {
  text-decoration: underline;
  color: #22C55E;
  transform: translateX(4px);
}

.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.listing-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.listing-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.listing-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  z-index: 1;
}

.listing-image {
  width: 100%;
  height: 200px;
  background: #f0f0f0;
  overflow: hidden;
  position: relative;
}

.listing-image-container {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.listing-image-container .listing-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-card-link .listing-image {
  position: relative;
}

.listing-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.favorite-heart-container {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 30;
  pointer-events: none;
}

.favorite-heart-btn {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  pointer-events: auto;
}

.favorite-heart-btn:hover {
  background: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.favorite-heart-btn svg {
  width: 20px;
  height: 20px;
  stroke: #5F6368;
  fill: none;
  transition: all 0.3s;
}

.favorite-heart-active svg {
  fill: #EF4444;
  stroke: #EF4444;
}

.favorite-heart-btn:hover svg {
  stroke: #EF4444;
}

.favorite-heart-active:hover svg {
  fill: #DC2626;
  stroke: #DC2626;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
  font-size: 3rem;
}

.listing-content {
  padding: 1.25rem;
}

.listing-title {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.listing-link {
  color: #2B2F33;
  text-decoration: none;
}

.listing-link:hover {
  color: #4FD1A5;
}

.listing-location {
  color: #5F6368;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.listing-specs {
  font-size: 0.8125rem;
  color: #5F6368;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.listing-specs span {
  color: #5F6368;
}

.listing-specs span:not(:last-child)::after {
  content: "•";
  margin-left: 0.5rem;
  color: #9CA3AF;
}

.listing-description {
  color: #5F6368;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

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

.listing-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #4FD1A5;
}

.btn-view {
  padding: 0.5rem 1rem;
  background-color: #4FD1A5;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.875rem;
  transition: background-color 0.3s;
}

.btn-view {
  transition: background-color 0.15s ease-out, transform 0.15s ease-out;
}

.btn-view:hover {
  background-color: #2FA37A;
  transform: scale(1.05);
}

.empty-state {
  text-align: center;
  padding: 3rem 0;
}

.empty-message {
  font-size: 1.125rem;
  color: #5F6368;
}

.link {
  color: #4FD1A5;
  text-decoration: none;
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
}

/* CTA Section */
.cta-section {
  background: #F7F9FB;
  color: #2B2F33;
  padding: 3rem 0;
  text-align: center;
}

.cta-section h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.cta-section p {
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

.btn-cta {
  display: inline-block;
  padding: 1.5rem 3.5rem;
  background-color: #4FD1A5;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 1.25rem;
  font-weight: 600;
  transition: background-color 0.3s, transform 0.3s;
}

.btn-cta {
  transition: background-color 0.15s ease-out, transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.btn-cta:hover {
  background-color: #2FA37A;
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 6px 20px rgba(47, 163, 122, 0.4);
}

/* Footer */
.main-footer {
  background-color: #1a1a1a;
  color: #e0e0e0;
  padding: 3rem 0 1.5rem;
  margin-top: auto;
  border-top: 1px solid #333;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.footer-logo-image {
  height: 32px;
  width: auto;
}

.footer-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin: 0;
}

.footer-description {
  color: #b0b0b0;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.footer-social {
  display: flex;
  gap: 1rem;
}

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

.social-link:hover {
  background: #22C55E;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.social-link svg {
  width: 20px;
  height: 20px;
}

.footer-heading {
  font-size: 1rem;
  font-weight: 600;
  color: white;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links li {
  margin: 0;
}

.footer-link {
  color: #b0b0b0;
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.15s ease-out, transform 0.15s ease-out;
  display: inline-block;
}

.footer-link:hover {
  color: #22C55E;
  transform: translateX(4px);
}

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copyright {
  color: #888;
  font-size: 0.875rem;
  margin: 0;
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  color: #888;
  font-size: 0.875rem;
}

.footer-bottom-links a {
  color: #888;
  text-decoration: none;
  transition: color 0.15s ease-out;
}

.footer-bottom-links a:hover {
  color: #22C55E;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-social {
    justify-content: flex-start;
  }
}

/* Alert Messages */
.alert {
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 4px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* Authentication Pages */
.auth-container {
  max-width: 450px;
  margin: 3rem auto;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h2 {
  font-size: 2rem;
  color: #2B2F33;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: #5F6368;
}

.auth-form .field {
  margin-bottom: 1.5rem;
}

.auth-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: #2B2F33;
  font-weight: 600;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"],
.auth-form input[type="tel"] {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.auth-form input:focus {
  outline: none;
  border-color: #4FD1A5;
}

.auth-form .actions {
  margin-top: 2rem;
}

.btn-auth {
  width: 100%;
  padding: 1rem;
  background: #4FD1A5;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 209, 165, 0.4);
  background: #2FA37A;
}

.auth-links {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.auth-links a {
  color: #22C55E;
  text-decoration: none;
  font-weight: 600;
}

.auth-links a:hover {
  text-decoration: underline;
}

.alert {
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 6px;
  border-left: 4px solid;
}

.alert-notice {
  background-color: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.alert-alert {
  background-color: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .search-input-group {
    flex-direction: column;
  }

  .location-input {
    max-width: 100%;
  }

  .header-container {
    flex-direction: column;
    gap: 1rem;
  }

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

  .listings-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

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

  .btn-hero {
    width: 100%;
    max-width: 300px;
  }

  .auth-container {
    margin: 2rem 1rem;
    padding: 1.5rem;
  }
}

/* Listing Detail Page */
.listing-detail {
  padding: 2rem 0;
  background: #f5f5f5;
  min-height: 100vh;
}

.listing-detail-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.listing-main-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 2rem;
  justify-content: space-between;
}

.listing-images-section {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.image-gallery-container {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  width: 100%;
}

.main-image {
  flex: 1;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  background: #f9fafb;
  border-radius: 8px;
  padding: 0.5rem;
}

.listing-main-image {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

/* Navigation buttons removed - using thumbnails only */
.image-nav-btn {
  display: none;
}

.thumbnail-images-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 110px;
  flex-shrink: 0;
}

.thumbnail-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s ease;
  display: block;
  background: #f9fafb;
}

.thumbnail-image:hover {
  border-color: #4FD1A5;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.thumbnail-image.thumbnail-active {
  border-color: #4FD1A5;
  border-width: 4px;
  box-shadow: 0 4px 12px rgba(79, 209, 165, 0.4);
}

.view-all-photos-thumbnail {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  cursor: pointer;
  border: 3px solid #e5e7eb;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.view-all-photos-thumbnail:hover {
  border-color: #4FD1A5;
  background: #f0fdf4;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(79, 209, 165, 0.2);
}

.view-all-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  text-align: center;
}

.view-all-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #4FD1A5;
}

.view-all-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
}

/* Legacy class for backward compatibility */
.thumbnail-images {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1rem;
  padding: 0.5rem;
}

/* Image Modal/Lightbox */
.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  overflow: auto;
}

.image-modal-content {
  margin: auto;
  display: block;
  width: auto;
  max-width: 90%;
  max-height: 90vh;
  margin-top: 5vh;
  object-fit: contain;
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  transition: color 0.3s;
}

.image-modal-close:hover,
.image-modal-close:focus {
  color: #bbb;
}

.image-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.3);
  color: white;
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 2.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  z-index: 10000;
}

.image-modal-nav:hover {
  background: rgba(255, 255, 255, 0.5);
}

.image-modal-prev {
  left: 30px;
}

.image-modal-next {
  right: 30px;
}

.image-placeholder-large {
  width: 100%;
  height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
  border-radius: 8px;
  font-size: 4rem;
  color: #999;
}

.image-placeholder-large p {
  margin-top: 1rem;
  font-size: 1rem;
  color: #666;
}

.listing-details-section {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Listing Details Below Images */
.listing-details-below-images {
  width: 100%;
}

.listing-details-below-images .listing-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #e5e7eb;
}

.listing-details-below-images .listing-detail-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.listing-details-below-images .listing-price-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #e5e7eb;
}

.listing-details-below-images .listing-price-large {
  font-size: 2rem;
  font-weight: 700;
  color: #000000;
}

.listing-details-below-images .listing-info {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.listing-details-below-images .info-item {
  font-size: 1rem;
  color: #374151;
}

.listing-details-below-images .info-item strong {
  color: #1f2937;
  font-weight: 600;
  margin-right: 0.5rem;
}

.listing-details-below-images .category-details {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #e5e7eb;
}

.listing-details-below-images .category-details h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.listing-images-section .listing-actions {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e5e7eb;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.listing-description-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 2px solid #e5e7eb;
}

.listing-description-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.listing-description-section .listing-description {
  font-size: 1rem;
  line-height: 1.7;
  color: #374151;
}

/* Seller Info Card */
.seller-info-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  width: 380px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  align-self: flex-start;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  margin-left: auto;
}

.seller-info-header {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed #e5e7eb;
}

.seller-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seller-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seller-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: #6b7280;
  background: #e5e7eb;
}

.seller-info-text {
  flex: 1;
}

.seller-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.seller-name {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.seller-verified {
  color: #22C55E;
  font-size: 1rem;
  font-weight: bold;
}

.seller-type-location {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0.25rem 0;
}

.seller-type-location .separator {
  margin: 0 0.5rem;
  color: #9ca3af;
}

.seller-verification {
  font-size: 0.75rem;
  color: #6b7280;
  margin: 0.25rem 0 0 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.verification-check {
  color: #22C55E;
  font-weight: bold;
}

.seller-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.seller-stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-icon {
  font-size: 1.25rem;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
}

.stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.seller-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.btn-seller-primary {
  width: 100%;
  padding: 0.625rem 1.25rem;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
  display: block;
}

.btn-seller-primary:hover {
  background: #2563eb;
}

.btn-seller-action {
  width: 100%;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #e5e7eb;
  background: white;
  color: #374151;
  display: block;
}

.btn-seller-action:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.seller-phone-display {
  padding: 0.625rem 0.75rem;
  background: #f9fafb;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #374151;
  border-top: 1px dashed #e5e7eb;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.seller-phone-display strong {
  color: #1f2937;
  font-weight: 600;
  margin-right: 0.5rem;
}

.phone-number-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.phone-number-link:hover {
  text-decoration: underline;
}

.seller-view-ads {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #e5e7eb;
  text-align: center;
}

.view-ads-link {
  color: #3b82f6;
  text-decoration: underline;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.view-ads-link:hover {
  color: #2563eb;
}

.listing-contact-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-contact-top {
  width: 100%;
  text-align: center;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
}

.seller-phone-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f7f9fb;
  border-radius: 6px;
  font-size: 1.1rem;
}

.seller-phone-top strong {
  color: #333;
  font-weight: 600;
}

.phone-link {
  color: #22C55E;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.phone-link:hover {
  color: #1db954;
  text-decoration: underline;
}

.listing-owner-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.listing-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.listing-detail-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #333;
}

.listing-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.category-badge {
  background: #667eea;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
}

.subcategory-badge {
  background: #22C55E;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
}

.listing-date {
  color: #666;
  font-size: 0.875rem;
}

.listing-price-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.listing-price-large {
  font-size: 1.25rem;
  font-weight: 600;
  color: #000000;
}

.listing-info {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
}

.listing-card .listing-info {
  padding: 1.25rem;
  margin-bottom: 0;
}

.info-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: center;
}

.info-item strong {
  color: #333;
  min-width: 100px;
}

.info-item span {
  color: #666;
}

.listing-description {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e0e0e0;
}

.listing-description h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
}

.listing-description p {
  color: #666;
  line-height: 1.8;
  white-space: pre-wrap;
}

.listing-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.category-details {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e0e0e0;
}

.category-details:last-child {
  border-bottom: none;
}

.category-details h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
}

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

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-item strong {
  color: #333;
  font-weight: 600;
}

.detail-item span {
  color: #666;
}

.features-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feature-badge {
  background: #E8FBF4;
  color: #2FA37A;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.btn-edit,
.btn-delete,
.btn-back {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-edit {
  background: #667eea;
  color: white;
}

.btn-edit:hover {
  background: #5568d3;
}

.btn-delete {
  background: #ff6b6b;
  color: white;
}

.btn-delete:hover {
  background: #ff5252;
}

.btn-back {
  background: #e0e0e0;
  color: #333;
}

.btn-back:hover {
  background: #d0d0d0;
}

.btn-contact {
  padding: 0.75rem 1.5rem;
  background: #22C55E;
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: inline-block;
}

.btn-contact:hover {
  background: #1db954;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-favorite {
  padding: 0.75rem 1.5rem;
  background: white;
  color: #2B2F33;
  border: 2px solid #E0E0E0;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-favorite:hover {
  background: #F7F9FB;
  border-color: #4FD1A5;
  color: #4FD1A5;
}

.btn-favorite svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.btn-favorite-active {
  background: #E8FBF4;
  border-color: #4FD1A5;
  color: #2FA37A;
}

.btn-favorite-active svg {
  fill: currentColor;
  stroke: none;
}

.btn-favorite-active:hover {
  background: #D1F2E5;
  border-color: #2FA37A;
  color: #1d8a5f;
}

.btn-remove-favorite {
  padding: 0.5rem 1rem;
  background: #EF4444;
  color: white;
  border: 1px solid #EF4444;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  cursor: pointer;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-remove-favorite:hover {
  background: #DC2626;
  border-color: #DC2626;
}

.btn-remove-favorite svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.listing-card-actions {
  padding: 1rem;
  border-top: 1px solid #E0E0E0;
  display: flex;
  justify-content: flex-end;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h2 {
  font-size: 1.5rem;
  color: #2B2F33;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: #5F6368;
  margin-bottom: 2rem;
}

/* New Listing Page Header */
.new-listing-page {
  padding: 2rem 0;
  background: #f5f5f5;
  min-height: 100vh;
}

.new-listing-header {
  max-width: 800px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  text-align: center;
}

.new-listing-header h1 {
  font-size: 2.5rem;
  color: #333;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.new-listing-header p {
  font-size: 1.125rem;
  color: #666;
}

.back-link-container {
  max-width: 800px;
  margin: 2rem auto 0;
  padding: 0 1.5rem;
  text-align: center;
}

.back-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.back-link:hover {
  color: #5568d3;
  text-decoration: underline;
}

/* Listing Form Styles */
.form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e0e0e0;
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #2B2F33;
}

.form-field {
  margin-bottom: 1.5rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #2B2F33;
}

.form-field input[type="text"],
.form-field input[type="number"],
.form-field textarea,
.form-field select,
.form-input {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: #4FD1A5;
}

.form-select {
  background: white;
  cursor: pointer;
}

.file-input {
  padding: 0.5rem;
  border: 2px dashed #e0e0e0;
  border-radius: 6px;
  width: 100%;
  cursor: pointer;
}

/* Professional Image Upload Zone */
.image-upload-zone {
  position: relative;
  width: 100%;
  min-height: 300px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
  z-index: 1;
}

.image-upload-zone:hover {
  border-color: #60A5FA;
  background: #f8fafc;
}

.image-upload-zone.drag-over {
  border-color: #60A5FA;
  background: #eff6ff;
  border-style: solid;
}

.image-upload-input-hidden {
  /* Styles applied via JavaScript */
}

.upload-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  pointer-events: auto;
  cursor: pointer;
}

.upload-icon {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-primary-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.upload-secondary-text {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 1rem 0;
}

.upload-info-text {
  font-size: 0.875rem;
  color: #9ca3af;
  margin: 0.5rem 0 0.25rem 0;
}

.upload-format-text {
  font-size: 0.75rem;
  color: #9ca3af;
  margin: 0;
}

.form-help {
  color: #5F6368;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.btn-lookup {
  padding: 0.75rem 1.5rem;
  background: #4FD1A5;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  white-space: nowrap;
}

.btn-lookup:hover {
  background: #2FA37A;
  transform: translateY(-1px);
}

.btn-lookup:disabled {
  background: #9CA3AF;
  cursor: not-allowed;
  transform: none;
}

.form-input {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-input:focus {
  outline: none;
  border-color: #4FD1A5;
}

.existing-images {
  margin-top: 1rem;
}

/* New select-based image ordering UI */
.image-thumbnails-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  visibility: visible !important;
  opacity: 1 !important;
  background: linear-gradient(to bottom, #ffffff, #f9fafb);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  min-height: 100px;
}

.existing-images {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.image-thumbnail-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  background: white;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.image-thumbnail-item:hover {
  border-color: #4FD1A5;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.new-image-placeholder {
  border: 2px dashed #4FD1A5 !important;
  background: #f0fdf4;
}

.new-image-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #4FD1A5;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 10;
  pointer-events: none;
}

.cover-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #22C55E;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 10;
  pointer-events: none;
}

.image-thumbnail-item.drag-insert-before {
  border-top: 3px solid #22C55E;
}

.image-thumbnail-item.drag-insert-after {
  border-bottom: 3px solid #22C55E;
}

.thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block !important;
  max-width: 100%;
  max-height: 100%;
  visibility: visible !important;
  opacity: 1 !important;
}

.remove-thumbnail-image {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239, 68, 68, 0.95);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
  pointer-events: auto !important;
  font-weight: bold;
}

.image-thumbnail-item:hover .remove-thumbnail-image {
  opacity: 1;
}

.remove-thumbnail-image:hover {
  background: rgba(220, 38, 38, 1);
  transform: scale(1.1);
}

.remove-thumbnail-image:active {
  transform: scale(0.95);
}

.image-order-selects {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.image-order-selects>.form-help {
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #374151;
  text-transform: none;
  letter-spacing: normal;
}

.order-selects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.order-select-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.order-select-item:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.order-select-item:has(.order-select:focus) {
  background: #ffffff;
  border-color: #4FD1A5;
  box-shadow: 0 0 0 3px rgba(79, 209, 165, 0.1);
}

.order-select-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  text-transform: none;
  letter-spacing: 0.3px;
  margin-bottom: 0.25rem;
}

.order-select-item:first-child .order-select-label {
  color: #4FD1A5;
  font-weight: 700;
}

.order-select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #1f2937;
  font-weight: 500;
}

.order-select:hover {
  border-color: #d1d5db;
  background: #ffffff;
}

.order-select:focus {
  outline: none;
  border-color: #4FD1A5;
  box-shadow: 0 0 0 3px rgba(79, 209, 165, 0.1);
  background: #ffffff;
}

.order-select option {
  padding: 0.5rem;
  font-size: 0.875rem;
}

.order-select option:disabled {
  color: #9ca3af;
  font-style: italic;
}

/* Responsive adjustments for image ordering */
@media (max-width: 768px) {
  .order-selects-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }

  .order-select-item {
    padding: 0.5rem;
  }

  .image-order-selects {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .order-selects-grid {
    grid-template-columns: 1fr;
  }

  .image-thumbnails-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
  }
}

.existing-images p {
  margin-bottom: 0.75rem;
  color: #5F6368;
}

.existing-images-grid,
#photos {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.existing-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
}

.existing-image {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid #e0e0e0;
  pointer-events: none;
  /* Prevent image from interfering with drag */
  user-select: none;
  -webkit-user-drag: none;
  -moz-user-select: none;
}

.existing-image-item,
.photo-item {
  position: relative;
  cursor: grab;
  pointer-events: auto !important;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  touch-action: none;
  /* Prevent touch scrolling during drag */
}

.existing-image-item:active,
.photo-item:active,
.image-thumbnail-item:active {
  cursor: grabbing;
}

.existing-image-item.dragging,
.image-thumbnail-item.dragging {
  opacity: 0.5;
  border-color: #667eea;
  transform: scale(1.05);
  z-index: 1000;
}

.existing-image-item.drag-over,
.image-thumbnail-item.drag-over {
  border-color: #22C55E;
  border-width: 3px;
  transform: scale(1.02);
}

.existing-image-item[draggable="true"],
.photo-item[draggable="true"] {
  cursor: grab;
}

.existing-image-item .remove-existing-image {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10;
}

.existing-image-item:hover .remove-existing-image {
  opacity: 1;
}

.existing-image-item .remove-existing-image:hover {
  background: rgba(220, 38, 38, 1);
}

/* Image Preview Container */
.image-preview-container {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f7f9fb;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

.image-preview-item {
  position: relative;
  cursor: grab;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e0e0e0;
  transition: all 0.3s;
  background: white;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-user-drag: element;
}

.image-preview-item:active {
  cursor: grabbing;
}

.image-preview-item:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-preview-item.dragging {
  opacity: 0.5;
  border-color: #667eea;
  transform: scale(1.05);
  cursor: grabbing;
  z-index: 1000;
}

.image-preview-item.drag-over {
  border-color: #22C55E;
  border-width: 3px;
  transform: scale(1.02);
}

.image-preview-item .preview-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  pointer-events: none !important;
  /* Prevent image from interfering with drag */
  user-select: none;
  -webkit-user-drag: none;
  -moz-user-select: none;
}

.image-preview-item .preview-overlay {
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, transparent 30%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px;
  opacity: 0;
  transition: opacity 0.3s;
  /* Allow drag events to pass through */
}

.image-preview-item:hover .preview-overlay {
  opacity: 1;
}

.preview-left,
.existing-image-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  /* Buttons inside should be clickable */
}

.preview-right,
.existing-image-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  /* Buttons inside should be clickable */
}

.main-badge,
.main-badge-existing {
  background: #22C55E;
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.set-main-image,
.set-main-existing-image {
  background: rgba(255, 215, 0, 0.9);
  color: #333;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  padding: 0;
}

.set-main-image:hover,
.set-main-existing-image:hover {
  background: rgba(255, 215, 0, 1);
  transform: scale(1.1);
}

.existing-image-item .existing-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, transparent 30%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none !important;
  /* Allow drag events to pass through */
}

.existing-image-item .existing-image-left,
.existing-image-item .existing-image-right {
  pointer-events: auto !important;
  /* Buttons inside should be clickable */
}

.existing-image-item button {
  pointer-events: auto !important;
  cursor: pointer;
}

.existing-image-item:hover .existing-image-overlay {
  opacity: 1;
}

.existing-image-item.dragging {
  opacity: 0.5;
  border: 2px solid #667eea;
  transform: scale(1.05);
  z-index: 1000;
  cursor: grabbing !important;
  pointer-events: auto;
}

.existing-image-item.drag-over {
  border: 3px solid #22C55E;
  transform: scale(1.02);
}

.main-badge-existing {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #22C55E;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 10;
  pointer-events: none;
}

.existing-image-item .existing-image,
.photo-item img {
  pointer-events: none !important;
  user-select: none;
  -webkit-user-drag: none;
  -moz-user-select: none;
  /* Prevent image from interfering with drag */
}

.image-preview-item .preview-number {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.image-preview-item .remove-preview-image {
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  pointer-events: auto;
  /* Ensure buttons are clickable */
  z-index: 10;
}

.image-preview-item .remove-preview-image:hover {
  background: rgba(220, 38, 38, 1);
}

.image-preview-item .set-main-image {
  pointer-events: auto;
  /* Ensure buttons are clickable */
  z-index: 10;
}

.form-errors {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 2rem;
  border-left: 4px solid #dc3545;
}

.form-errors h2 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.form-errors ul {
  margin-left: 1.5rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-submit {
  padding: 1rem 2rem;
  background: #22C55E;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
  background: #1db954;
}

.btn-cancel {
  padding: 1rem 2rem;
  background: #e0e0e0;
  color: #2B2F33;
  text-decoration: none;
  border-radius: 6px;
  font-size: 1.125rem;
  font-weight: 600;
  display: inline-block;
  transition: background-color 0.3s;
}

.btn-cancel:hover {
  background: #d0d0d0;
}

.listing-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* Messages Page */
.messages-page {
  padding: 2rem 0;
  background: #F7F9FB;
  min-height: 100vh;
}

.conversations-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.conversation-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
  border: 1px solid #e8e8e8;
}

.conversation-card.has-unread {
  border-left-color: #4FD1A5;
  background: linear-gradient(to right, #E8FBF4 0%, white 4%);
  box-shadow: 0 4px 12px rgba(79, 209, 165, 0.15);
  border-color: #E8FBF4;
}

.conversation-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  border-color: #bbf7d0;
}

.conversation-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.conversation-user-info {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex: 1;
}

.user-avatar-small {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #4FD1A5;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79, 209, 165, 0.3);
  border: 3px solid white;
}

.conversation-details {
  flex: 1;
}

.conversation-user-name {
  font-weight: 700;
  color: #2B2F33;
  font-size: 1.125rem;
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.unread-badge-small {
  background: #4FD1A5;
  color: white;
  padding: 0.25rem 0.625rem;
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(79, 209, 165, 0.3);
}

.conversation-listing {
  color: #5F6368;
  font-size: 0.875rem;
  font-weight: 500;
}

.conversation-time {
  color: #999;
  font-size: 0.8125rem;
  white-space: nowrap;
  font-weight: 500;
}

.conversation-preview {
  margin-top: 0.75rem;
}

.message-bubble-preview {
  background: #f0f0f0;
  border-radius: 16px;
  padding: 0.875rem 1.125rem;
  max-width: 75%;
  border: 1px solid #e8e8e8;
}

.message-bubble-preview.sent {
  background: linear-gradient(135deg, #e8f0fe 0%, #e3f2fd 100%);
  margin-left: auto;
  border-color: #c5d9f0;
}

.message-sender-preview {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.375rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.message-text-preview {
  color: #1a1a1a;
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 400;
}

.page-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  font-size: 2.5rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: #666;
  font-size: 1.125rem;
}

.btn-post-new {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: transform 0.3s, box-shadow 0.3s;
}

.btn-post-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.messages-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid #e0e0e0;
}

.tab-button {
  padding: 1rem 2rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #666;
  transition: all 0.3s;
}

.tab-button.active {
  color: #22C55E;
  border-bottom-color: #22C55E;
}

.tab-button:hover {
  color: #22C55E;
}

.messages-section {
  display: none;
}

.messages-section.active {
  display: block;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s;
}

.message-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message-card.unread {
  border-left: 4px solid #22C55E;
  background: #f0fdf4;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.message-sender {
  color: #111111;
  font-weight: 600;
}

.message-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.875rem;
  color: #111111;
  opacity: 0.7;
}

.unread-badge {
  background: #22C55E;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.read-status {
  color: #999;
}

.message-listing {
  margin-bottom: 0.75rem;
  color: #111111;
  opacity: 0.7;
}

.listing-link {
  color: #22C55E;
  text-decoration: none;
  font-weight: 600;
}

.listing-link:hover {
  text-decoration: underline;
  color: #1db954;
}

.seller-link {
  color: #22C55E;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.seller-link:hover {
  color: #1db954;
  text-decoration: underline;
}

/* Header Avatar */
.header-avatar-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #D1FAE5;
  color: #22C55E;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  height: 40px;
  min-width: 100px;
  padding: 0 1.25rem;
  box-sizing: border-box;
  border-radius: 6px;
  transition: background-color 0.1s ease, color 0.1s ease;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #2B2F33;
  white-space: nowrap;
}

.dropdown-toggle:hover {
  background-color: #F7F9FB;
}

.header-greeting {
  white-space: nowrap;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #2B2F33;
}

.dropdown-arrow {
  font-size: 0.75rem;
  margin-left: 0.25rem;
  color: #2B2F33;
}

/* Messages Icon in Header */
.messages-icon-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem !important;
}

.messages-icon {
  width: 18px;
  height: 18px;
  color: #2B2F33;
  transition: color 0.3s;
}

.messages-icon-link:hover .messages-icon {
  color: #4FD1A5;
}

.messages-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: #ff4444;
  color: white;
  border-radius: 10px;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Profile Picture Upload Section */
.profile-picture-section {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: #F7F9FB;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.profile-picture-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #2B2F33;
  margin-bottom: 1rem;
}

.profile-picture-container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.profile-picture-preview {
  flex-shrink: 0;
}

.profile-picture-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.profile-picture-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #4FD1A5;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.profile-picture-upload {
  flex: 1;
  min-width: 180px;
}

.file-input-hidden {
  display: none;
}

.file-input-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: #4FD1A5;
  color: white;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 6px rgba(79, 209, 165, 0.3);
  border: none;
  font-size: 0.9375rem;
}

.file-input-label:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(79, 209, 165, 0.4);
  background: #2FA37A;
}

.upload-icon {
  font-size: 1.125rem;
}

.upload-text {
  font-size: 0.9375rem;
}

.upload-hint {
  display: block;
  margin-top: 0.375rem;
  color: #5F6368;
  font-size: 0.8125rem;
}

@media (max-width: 768px) {
  .profile-picture-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-picture-upload {
    width: 100%;
  }
}

/* User Profile Page */
.user-profile-page {
  padding: 2rem 0;
  background: #F7F9FB;
  min-height: 100vh;
}

.profile-header {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 2rem;
  align-items: center;
}

.profile-avatar {
  flex-shrink: 0;
}

.avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #4FD1A5;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
}

.avatar-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar-image-small {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-info h1 {
  font-size: 2rem;
  color: #2B2F33;
  margin-bottom: 0.5rem;
}

.profile-name-rating {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.user-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stars {
  display: flex;
  gap: 2px;
}

.star {
  color: #ddd;
  font-size: 1.25rem;
  line-height: 1;
}

.star.filled {
  color: #FFD700;
}

.star.half {
  color: #FFD700;
  opacity: 0.5;
}

.rating-text {
  font-size: 0.9375rem;
  color: #5F6368;
  font-weight: 500;
}

.profile-location,
.profile-phone {
  color: #5F6368;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.profile-joined {
  color: #999;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.profile-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.stat-item {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  min-width: 150px;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #22C55E;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #111111;
  font-size: 0.875rem;
  opacity: 0.7;
}

/* Reviews Section */
.review-section,
.reviews-section {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.review-section h2,
.reviews-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #111111;
}

.review-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.review-rating {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.review-rating label {
  font-weight: 600;
  color: #2B2F33;
}

.star-rating {
  display: flex;
  gap: 4px;
  justify-content: flex-start;
}

.star-input {
  display: none;
}

.star-label {
  font-size: 2rem;
  color: #ddd;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
  display: inline-block;
}

/* Hover effect - fill stars from left to right */
.star-label:hover,
.star-label:hover~.star-label {
  color: #FFD700;
}

/* When a star is checked, fill it and all stars after it */
.star-input:checked~.star-label {
  color: #FFD700;
}

.star-input:checked+.star-label {
  color: #FFD700;
}

.review-comment-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.review-comment-field label {
  font-weight: 600;
  color: #2B2F33;
}

.review-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9375rem;
  resize: vertical;
  min-height: 100px;
}

.review-textarea:focus {
  outline: none;
  border-color: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.btn-submit-review {
  background-color: #22C55E;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  align-self: flex-start;
}

.btn-submit-review:hover {
  background-color: #16A34A;
}

.existing-review {
  padding: 1rem;
  background: #f5f5f5;
  border-radius: 6px;
  border-left: 4px solid #22C55E;
}

.existing-review p {
  margin-bottom: 0.5rem;
  color: #5F6368;
}

.review-display {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.review-comment {
  color: #2B2F33;
  line-height: 1.6;
  margin: 0;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.review-item {
  padding: 1.5rem;
  background: #f9f9f9;
  border-radius: 6px;
  border-left: 4px solid #22C55E;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reviewer-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reviewer-info strong {
  color: #2B2F33;
  font-size: 1rem;
}

.review-date {
  font-size: 0.8125rem;
  color: #5F6368;
}

.profile-listings {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-listings h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #111111;
}

.message-content {
  color: #111111;
  line-height: 1.6;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.message-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-view-message,
.btn-view-listing,
.btn-reply {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-view-message {
  background: #22C55E;
  color: white;
}

.btn-view-message:hover {
  background: #1db954;
}

.btn-view-listing {
  background: #e0e0e0;
  color: #111111;
}

.btn-view-listing:hover {
  background: #d0d0d0;
}

.btn-reply {
  background: #22C55E;
  color: white;
}

.btn-reply:hover {
  background: #1db954;
}

/* ========================================
   Modern Professional Chat System
   ======================================== */

/* Chat Page Container */
/* WhatsApp-style Layout */
.whatsapp-layout {
  display: flex;
  height: calc(100vh - 80px);
  min-height: 600px;
  background: #f0f2f5;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
}

/* Left Panel: Conversations */
.conversations-panel {
  width: 35%;
  min-width: 300px;
  max-width: 450px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e6e6e6;
}

.conversations-header {
  background: #f0f2f5;
  padding: 10px 16px;
  border-bottom: 1px solid #e6e6e6;
}

.conversations-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.conversations-title {
  font-size: 20px;
  font-weight: 600;
  color: #111b21;
}

.conversations-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #54656f;
  transition: background-color 0.2s;
}

.icon-button:hover {
  background-color: #e9edef;
}

.conversations-search {
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid #e6e6e6;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f0f2f5;
  border-radius: 8px;
  padding: 8px 12px;
}

.search-box svg {
  color: #54656f;
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: #111b21;
}

.search-box input::placeholder {
  color: #667781;
}

.conversations-list {
  flex: 1;
  overflow-y: auto;
  background: #ffffff;
}

.conversation-item-wrapper {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e6e6e6;
  position: relative;
}

.conversation-item-wrapper:hover {
  background-color: #f5f6f6;
}

.conversation-item-wrapper.active {
  background-color: #e9edef;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  flex: 1;
  cursor: pointer;
}

.delete-conversation-button {
  background: none;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  color: #667781;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background-color 0.2s;
  opacity: 0;
  margin-right: 8px;
}

.conversation-item-wrapper:hover .delete-conversation-button {
  opacity: 1;
}

.delete-conversation-button:hover {
  color: #e53e3e;
  background-color: #fee;
  border-radius: 4px;
}

.conversation-avatar {
  width: 49px;
  height: 49px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: #e1e4e8;
}

.conversation-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #54656f;
  background: #e1e4e8;
}

.conversation-info {
  flex: 1;
  min-width: 0;
}

.conversation-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.conversation-name {
  font-size: 17px;
  font-weight: 500;
  color: #111b21;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-time {
  font-size: 12px;
  color: #667781;
  white-space: nowrap;
  margin-left: 8px;
}

.conversation-listing-name {
  font-size: 13px;
  color: #667781;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conversation-preview {
  font-size: 14px;
  color: #667781;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.unread-badge {
  background: #25d366;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.conversation-item-wrapper.has-unread .conversation-name {
  font-weight: 600;
}

.conversation-item-wrapper.has-unread .conversation-preview {
  color: #111b21;
  font-weight: 500;
}

.empty-conversations {
  padding: 40px 20px;
  text-align: center;
  color: #667781;
}

.empty-conversations p {
  margin: 8px 0;
}

/* Right Panel: Chat */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #efeae2;
  position: relative;
}

.empty-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #667781;
  padding: 40px;
  text-align: center;
}

.empty-chat-icon {
  color: #c4c9cc;
  margin-bottom: 24px;
}

.empty-chat h2 {
  font-size: 24px;
  font-weight: 300;
  color: #41525d;
  margin: 0 0 8px 0;
}

.empty-chat p {
  font-size: 14px;
  color: #667781;
  margin: 0;
}

/* Chat container */
.chat-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f5f2ee;
}

/* Header */
.chat-header {
  background: #fff;
  padding: 14px 24px;
  border-bottom: 1px solid #e6e6e6;
}

.chat-header .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e1e4e8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.name-link {
  text-decoration: none;
  display: inline-block;
}

.name-link:hover .name {
  text-decoration: underline;
  color: #22C55E;
}

.name {
  font-weight: 600;
  font-size: 16px;
  color: #111b21;
  margin-bottom: 2px;
  transition: color 0.2s;
  cursor: pointer;
}

.subtitle {
  font-size: 13px;
  color: #667781;
  line-height: 1.3;
}

.chat-header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chat-back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #65676b;
  text-decoration: none;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.chat-back-button:hover {
  background-color: #f0f2f5;
  color: #050505;
}

.chat-header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: #e4e6eb;
}

.chat-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #65676b;
  background: #e4e6eb;
}

.chat-header-info {
  flex: 1;
  min-width: 0;
}

.chat-user-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #050505;
  margin: 0;
  line-height: 1.3333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-user-status {
  font-size: 0.8125rem;
  color: #65676b;
  margin: 0;
  line-height: 1.3333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-listing-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #65676b;
  text-decoration: none;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.chat-listing-link:hover {
  background-color: #f0f2f5;
  color: #050505;
}

/* Messages area */
.chat-body {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Date Separator */
.chat-date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
  position: relative;
}

.chat-date-separator::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}

.chat-date-text {
  background: #efeae2;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: #65676b;
  font-weight: 500;
  position: relative;
  z-index: 1;
  border-radius: 12px;
}

/* Message wrapper */
.message {
  display: flex;
}

.message.outgoing {
  justify-content: flex-end;
}

.message.incoming {
  justify-content: flex-start;
}

/* Bubble */
.bubble {
  max-width: 60%;
  padding: 10px 12px;
  border-radius: 14px;
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.outgoing .bubble {
  background: #dcf8c6;
  border-bottom-right-radius: 4px;
}

.outgoing .bubble .text {
  color: rgba(0, 0, 0, 1);
}

.incoming .bubble {
  background: #ffffff;
  border-bottom-left-radius: 4px;
}

.incoming .bubble .text {
  color: rgba(0, 0, 0, 1);
}

/* Text & time */
.text {
  font-size: 15px;
  color: rgba(0, 0, 0, 1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.time {
  font-size: 11px;
  color: #777;
  white-space: nowrap;
  margin-bottom: 1px;
}

/* Typing Indicator */
.typing-bubble {
  background: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: 7.5px;
  border-bottom-left-radius: 4px;
}

.typing-dots {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #65676b;
  animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {

  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  30% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Empty State */
.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  min-height: 400px;
}

.chat-empty-icon {
  color: #b8bcc1;
  margin-bottom: 1rem;
}

.chat-empty-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #050505;
  margin: 0 0 0.5rem 0;
}

.chat-empty-text {
  font-size: 0.9375rem;
  color: #65676b;
  margin: 0;
  max-width: 400px;
}

/* === Input bar === */
/* Input bar */
.chat-input {
  background: #fff;
  padding: 12px 24px;
  border-top: 1px solid #e6e6e6;
  display: flex;
  gap: 12px;
}

.chat-input input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid #ddd;
  font-size: 14px;
}

.chat-input button {
  padding: 0 18px;
  border-radius: 20px;
  border: none;
  background: #4caf50;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.message-detail-header {
  margin-bottom: 2rem;
}

.message-detail-header h1 {
  font-size: 2rem;
  color: #333;
  margin-top: 1rem;
}

.message-detail-card {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  margin: 0 auto;
}

.message-detail-info {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e0e0e0;
}

.info-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
}

.info-row strong {
  min-width: 120px;
  color: #333;
}

.info-row span {
  color: #666;
}

.message-detail-content h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
}

.message-text {
  background: #f9f9f9;
  padding: 1.5rem;
  border-radius: 6px;
  line-height: 1.8;
  color: #333;
  white-space: pre-wrap;
}

.message-detail-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* My Listings Page */
.my-listings-page {
  padding: 2rem 0;
  background: #f5f5f5;
  min-height: 100vh;
}

.btn-edit-small {
  padding: 0.5rem 1rem;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 0.3s;
}

.btn-edit-small:hover {
  background: #5568d3;
}

.btn-contact {
  padding: 0.75rem 1.5rem;
  background: #4caf50;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background-color 0.3s;
  display: inline-block;
}

.btn-contact:hover {
  background: #45a049;
}

/* Category Details */
.category-details {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f9f9f9;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.category-details h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
}

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

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-item strong {
  color: #666;
  font-size: 0.875rem;
  font-weight: 600;
}

.detail-item span {
  color: #333;
  font-size: 1rem;
}

/* Form Row for side-by-side fields */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Message Form Page */
.message-form-page {
  padding: 2rem 0;
  background: #f5f5f5;
  min-height: 100vh;
}

.message-form-header {
  max-width: 800px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
}

.message-form-header h1 {
  font-size: 2rem;
  color: #333;
  margin: 1rem 0 0.5rem;
}

.message-form-header p {
  color: #666;
  font-size: 1.125rem;
}

.message-form-card {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.listing-preview {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f9f9f9;
  border-radius: 6px;
  border-left: 4px solid #667eea;
}

.listing-preview h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: #333;
}

.preview-content {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.preview-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
}

.preview-details {
  flex: 1;
}

.preview-details strong {
  display: block;
  font-size: 1.125rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.preview-details p {
  font-size: 1.25rem;
  color: #667eea;
  font-weight: 700;
}

.message-form .form-field textarea {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s;
}

.message-form .form-field textarea:focus {
  outline: none;
  border-color: #667eea;
}

/* Responsive for listing detail */
@media (max-width: 968px) {
  .homepage-main-content {
    grid-template-columns: 1fr;
  }

  .sell-box {
    position: static;
    margin-top: 2rem;
  }

  .categories-row {
    gap: 2rem;
  }

  .category-icon-large {
    font-size: 2rem;
    width: 50px;
    height: 50px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .listing-detail-container {
    padding: 0 1rem;
  }

  .listing-main-content {
    flex-direction: column;
    gap: 1.5rem;
  }

  .listing-images-section {
    max-width: 100%;
  }

  .image-gallery-container {
    flex-direction: column;
    width: 100%;
  }

  .thumbnail-images-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1rem;
  }

  .thumbnail-image {
    width: 80px;
    height: 80px;
  }

  .listing-main-image {
    max-height: 400px;
    max-width: 100%;
  }

  .main-image {
    max-width: 100%;
  }

  .seller-info-card {
    width: 100%;
    padding: 1rem;
    margin-left: 0;
  }

  .seller-stats {
    flex-direction: column;
    gap: 0.75rem;
  }

  .image-placeholder-large {
    height: 300px;
  }

  .dropdown-menu {
    right: auto;
    left: 0;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-container {
    height: 100vh;
  }

  .chat-header {
    padding: 0.625rem 0.875rem;
  }

  .chat-header-content {
    gap: 0.75rem;
  }

  .chat-avatar {
    width: 36px;
    height: 36px;
  }

  .chat-user-name {
    font-size: 0.875rem;
  }

  .chat-user-status {
    font-size: 0.75rem;
  }

  .chat-body {
    padding: 16px;
    gap: 12px;
  }

  .bubble {
    max-width: 75%;
  }

  .message-text {
    font-size: 0.875rem;
  }

  .chat-input-container {
    padding: 0.625rem 0.75rem;
  }

  .chat-input-field-wrapper {
    min-height: 36px;
    padding: 0.375rem 0.75rem;
  }

  .chat-input {
    font-size: 0.875rem;
  }

  .chat-send-button {
    width: 36px;
    height: 36px;
  }

  .chat-send-button svg {
    width: 18px;
    height: 18px;
  }
}