/* Home Page Styles */
.home-page {
  padding-bottom: 40px;
}

.search-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 60px 20px;
  margin: -20px -20px 40px -20px;
}

.search-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.search-container h1 {
  font-size: 36px;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 18px;
  margin-bottom: 30px;
  opacity: 0.9;
}

.search-form {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.search-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.search-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
}

.search-btn {
  padding: 12px 32px;
  white-space: nowrap;
}

.search-filters {
  display: flex;
  gap: 10px;
}

.filter-select {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 24px;
  color: var(--text-color);
}

.view-all-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

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

/* Ads Grid */
.ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.featured-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* Ad Card */
.ad-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.ad-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.ad-card.featured {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

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

.ad-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: var(--bg-light);
}

.ad-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.featured-badge, .urgent-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.featured-badge {
  background: var(--primary-color);
}

.urgent-badge {
  background: var(--danger-color);
  right: auto;
  left: 10px;
}

.ad-content {
  padding: 16px;
}

.ad-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-color);
  line-height: 1.4;
}

.ad-price {
  margin-bottom: 12px;
}

.price-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
}

.price-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
}

.ad-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}

.ad-stats {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #6b7280;
}

.stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon {
  width: 16px;
  height: 16px;
}

/* Ad Show Page */
.ad-show {
  max-width: 1200px;
  margin: 0 auto;
}

.breadcrumb {
  padding: 16px 0;
  font-size: 14px;
  color: #6b7280;
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.separator {
  margin: 0 8px;
}

.ad-main {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 30px;
  margin-top: 20px;
}

.ad-gallery-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
}

.gallery-main {
  margin-bottom: 16px;
  position: relative;
}

.main-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  max-height: 500px;
  object-fit: contain;
  background: var(--bg-light);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10;
}

.gallery-nav:hover {
  background: rgba(0, 0, 0, 0.7);
}

.gallery-nav svg {
  width: 24px;
  height: 24px;
}

.gallery-nav-prev {
  left: 10px;
}

.gallery-nav-next {
  right: 10px;
}

.gallery-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.thumbnail:hover, .thumbnail.active {
  border-color: var(--primary-color);
}

.no-image-placeholder {
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border-radius: 8px;
  color: #9ca3af;
}

.ad-details-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border-color);
  height: fit-content;
}

.ad-header-info {
  margin-bottom: 24px;
}

.ad-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.ad-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

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

.badge-urgent {
  background: var(--danger-color);
  color: white;
}

.badge-condition {
  background: var(--bg-light);
  color: var(--text-color);
}

.badge-business {
  background: var(--warning-color);
  color: white;
}

.ad-price-box {
  padding: 16px;
  background: var(--bg-light);
  border-radius: 8px;
  margin-bottom: 20px;
}

.price-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  display: block;
}

.price-label {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-color);
}

.negotiable-label {
  font-size: 14px;
  color: #6b7280;
  display: block;
  margin-top: 4px;
}

.ad-actions {
  margin-bottom: 24px;
}

.btn-block {
  width: 100%;
  text-align: center;
}

.contact-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.contact-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.phone-btn {
  background: #3b82f6;
  color: white;
}

.phone-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.whatsapp-btn {
  background: #25D366;
  color: white;
}

.whatsapp-btn:hover {
  background: #20BA5A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.ad-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  font-weight: 600;
}

.info-value {
  font-size: 14px;
  color: var(--text-color);
}

.ad-description {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.ad-description h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.ad-description p {
  color: #4b5563;
  line-height: 1.6;
}

.seller-info {
  margin-bottom: 24px;
}

.seller-info h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.seller-card {
  padding: 16px;
  background: var(--bg-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.seller-name {
  font-weight: 600;
  color: var(--text-color);
}

.ad-management {
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.ad-management h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.management-actions {
  display: flex;
  gap: 10px;
}

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

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

.btn-danger:hover {
  background: #dc2626;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.empty-state p {
  font-size: 18px;
  margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
  .search-container h1 {
    font-size: 28px;
  }

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

  .search-filters {
    flex-direction: column;
  }

  .ads-grid, .featured-grid {
    grid-template-columns: 1fr;
  }

  .ad-main {
    grid-template-columns: 1fr;
  }

  .ad-info-grid {
    grid-template-columns: 1fr;
  }

  .management-actions {
    flex-direction: column;
  }

  .contact-buttons-grid {
    grid-template-columns: 1fr;
  }
}
