/* style.css */

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

body {
  font-family: Arial, sans-serif;
  background-color: #f5f7fa;
  color: #1f2937;
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

.pageView {
  min-height: 400px;
}

.accountNotice {
  background-color: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 12px 0;
}

.accountNoticeContent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.accountNoticeText {
  color: #92400e;
  font-weight: 700;
}

.accountNoticeFeedback {
  margin-top: 8px;
  color: #1f2937;
}

.accountNoticeFeedback.isError {
  color: #991b1b;
}

.accountNoticeFeedback.isSuccess {
  color: #065f46;
}

.accountNotice.attention {
  box-shadow: inset 0 0 0 2px #f59e0b;
}

.siteHeader {
  background-color: #ffffff;
  border-bottom: 1px solid #dbe3eb;
  position: sticky;
  top: 0;
  z-index: 20;
}

.headerContent {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logoImage {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
}

.logoText {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logoText h1 {
  font-size: 1.5rem;
  line-height: 1.1;
  color: #111827;
}

.logoText p {
  font-size: 0.95rem;
  color: #6b7280;
}

.mainNav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.mainNav a,
.mainNav .navLinkButton {
  font-weight: 600;
  color: #374151;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mainNav a:hover,
.mainNav .navLinkButton:hover {
  color: #0f4c81;
}

.navLinkButton {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.messagesUnreadBadge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background-color: #dc2626;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* HOME */
.homeHeroSection {
  background: linear-gradient(135deg, #0f4c81, #2563eb);
  color: white;
  padding: 60px 0;
}

.homeHeroContent {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: start;
}

.homeHeroText h2 {
  font-size: 2.2rem;
  margin-bottom: 14px;
}

.homeHeroLead {
  font-size: 1rem;
  opacity: 0.97;
  max-width: 760px;
}

.homeHeroActions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.homeHeroCard {
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(6px);
}

.homeHeroCard h3 {
  margin-bottom: 14px;
  font-size: 1.2rem;
}

.homePrinciplesList {
  padding-left: 18px;
}

.homePrinciplesList li + li {
  margin-top: 8px;
}

.homeLatestAdsSection {
  padding: 36px 0 44px;
}

.sectionHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.sectionSubtitle {
  color: #6b7280;
  margin-top: 4px;
}

/* FILTERS / ADS */
.filtersSection {
  padding: 30px 0;
}

.filtersBox {
  background-color: white;
  border: 1px solid #dbe3eb;
  border-radius: 14px;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.filterGroup,
.formGroup {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filterGroup label,
.formGroup label {
  font-weight: 700;
  font-size: 0.95rem;
}

.filterGroup input,
.filterGroup select,
.formGroup input,
.formGroup select,
.formGroup textarea {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  background-color: #fff;
}

.buttonGroup {
  justify-content: flex-end;
}

.primaryButton,
.backButton,
.contactSellerButton,
.buttonGroup button {
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 700;
  background-color: #0f4c81;
  color: white;
}

.primaryButton:hover,
.backButton:hover,
.contactSellerButton:hover,
.buttonGroup button:hover {
  background-color: #0c3c66;
}

.secondaryButton {
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 700;
  background-color: #e5e7eb;
  color: #111827;
}

.secondaryButton:hover {
  background-color: #d1d5db;
}

.resultsSection,
.adDetailPageSection {
  padding: 36px 0 40px;
}

.resultsHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.radiusInfoText {
  color: #6b7280;
  font-size: 0.95rem;
}

.carList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.carCard {
  background-color: white;
  border: 1px solid #dbe3eb;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.carCard:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.carImage {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.carCardContent {
  padding: 16px;
}

.carTitle {
  font-size: 1.15rem;
  margin-bottom: 10px;
  color: #111827;
}

.carPrice {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f4c81;
  margin-bottom: 14px;
}

.carMeta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  font-size: 0.95rem;
  color: #4b5563;
}

.carMetaItem {
  background-color: #f8fafc;
  padding: 8px 10px;
  border-radius: 10px;
}

.emptyState {
  margin-top: 20px;
  padding: 18px;
  background-color: white;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  text-align: center;
}

/* DETAIL */
.adDetailHeader {
  margin-bottom: 18px;
}

.adDetailContent {
  background-color: white;
  border: 1px solid #dbe3eb;
  border-radius: 16px;
  overflow: hidden;
}

.adDetailImage {
  width: 100%;
  height: 360px;
  object-fit: cover;
  display: block;
}

.adDetailBody {
  padding: 24px;
}

.adDetailTop {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.adDetailTitleGroup h3 {
  font-size: 1.8rem;
  color: #111827;
  margin-bottom: 8px;
}

.adDetailLocation {
  color: #6b7280;
  font-size: 1rem;
}

.adDetailPrice {
  font-size: 2rem;
  font-weight: 800;
  color: #0f4c81;
}

.adDetailGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.adDetailItem {
  background-color: #f8fafc;
  border-radius: 12px;
  padding: 12px 14px;
  color: #374151;
}

.adDetailSectionTitle {
  font-size: 1.2rem;
  color: #111827;
  margin-bottom: 12px;
}

.adDetailDescription {
  margin-bottom: 24px;
  color: #374151;
}

.adSellerBox {
  background-color: #f8fafc;
  border: 1px solid #dbe3eb;
  border-radius: 14px;
  padding: 18px;
}

.adSellerBox p {
  margin-bottom: 8px;
  color: #374151;
}

.adSellerBox p:last-child {
  margin-bottom: 0;
}

.adDetailActions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* SELLER */
.sellerDashboardSection {
  padding: 36px 0 40px;
}

.sellerDashboardHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.sellerDashboardSubtitle {
  color: #6b7280;
  margin-top: 4px;
}

.sellerStatsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.sellerStatCard {
  background-color: white;
  border: 1px solid #dbe3eb;
  border-radius: 14px;
  padding: 18px;
}

.sellerStatLabel {
  color: #6b7280;
  margin-bottom: 8px;
}

.sellerStatValue {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f4c81;
}

.sellerDashboardTableWrapper {
  background-color: white;
  border: 1px solid #dbe3eb;
  border-radius: 14px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.sellerDashboardTable {
  width: 100%;
  border-collapse: collapse;
}

.sellerDashboardTable th,
.sellerDashboardTable td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

.sellerDashboardTable th {
  background-color: #f8fafc;
  color: #374151;
  font-size: 0.95rem;
}

.inlineActionButton {
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  background-color: #0f4c81;
  color: white;
  font-weight: 700;
}

.inlineActionButton:hover {
  background-color: #0c3c66;
}

.statusBadge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background-color: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.85rem;
}

.sellerCreateAdSection {
  background-color: white;
  border: 1px solid #dbe3eb;
  border-radius: 16px;
  padding: 22px;
}

.sellerCreateAdHeader {
  margin-bottom: 18px;
}

.sellerCreateAdHeader h4 {
  font-size: 1.2rem;
  color: #111827;
  margin-bottom: 4px;
}

.sellerCreateAdSubtitle {
  color: #6b7280;
}

.createAdForm {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.createAdGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.fullWidth {
  grid-column: 1 / -1;
}

.checkboxGroup {
  align-items: flex-start;
}

.checkboxLabel {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #111827;
}

.checkboxLabel input {
  width: auto;
}

.formActions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

/* MESSAGES */
.messagesSection {
  padding: 36px 0 40px;
}

.messagesHeader {
  margin-bottom: 18px;
}

.messagesSubtitle {
  color: #6b7280;
  margin-top: 4px;
}

.messagesTabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.messagesTabButton {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  background-color: #e5e7eb;
  color: #111827;
}

.messagesTabButton.active {
  background-color: #0f4c81;
  color: white;
}

.messagesLayout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
}

.messagesSidebarHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.messagesList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.conversationListItem {
  border: 1px solid #dbe3eb;
  background-color: white;
  border-radius: 14px;
  padding: 14px;
  width: 100%;
}

.conversationListPrimaryAction {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  width: 100%;
  display: block;
}

.conversationListItem.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.conversationListItem.unread {
  background-color: #eff6ff;
}

.conversationListTop {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.conversationListName {
  font-weight: 700;
  color: #111827;
}

.conversationListDate {
  color: #6b7280;
  font-size: 0.85rem;
  white-space: nowrap;
}

.conversationListMeta {
  color: #374151;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.conversationListSecondaryMeta {
  color: #6b7280;
  font-size: 0.82rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.conversationListSnippet {
  color: #6b7280;
  font-size: 0.92rem;
}

.conversationListActions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.conversationActionButton {
  border: none;
  background-color: #e5e7eb;
  color: #111827;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 700;
}

.conversationActionButton:hover {
  background-color: #d1d5db;
}

.conversationActionButtonDanger {
  background-color: #fee2e2;
  color: #991b1b;
}

.conversationActionButtonDanger:hover {
  background-color: #fecaca;
}

.messageDetailCard {
  background-color: white;
  border: 1px solid #dbe3eb;
  border-radius: 16px;
  padding: 20px;
  min-height: 280px;
}

.emptyMessageDetail {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

.conversationHeader {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.conversationTitle {
  font-size: 1.2rem;
  color: #111827;
  margin-bottom: 4px;
}

.conversationMeta {
  color: #6b7280;
}

.conversationStatus {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background-color: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  font-size: 0.85rem;
}

.conversationThread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.threadMessage {
  max-width: 100%;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid #e5e7eb;
}

.threadMessageBuyer {
  background-color: #f8fafc;
}

.threadMessageSeller {
  background-color: #eff6ff;
  border-color: #bfdbfe;
}

.threadMessageHeader {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.threadMessageAuthor {
  font-weight: 700;
  color: #111827;
}

.threadMessageDate {
  color: #6b7280;
  font-size: 0.85rem;
}

.threadMessageBody {
  white-space: pre-wrap;
  color: #1f2937;
}

.replyBox {
  border-top: 1px solid #e5e7eb;
  padding-top: 18px;
}

.replyBox h4 {
  margin-bottom: 12px;
  color: #111827;
}

/* AUTH */
.authSection {
  padding: 36px 0 40px;
}

.authContainer {
  max-width: 640px;
}

.authCard {
  background-color: white;
  border: 1px solid #dbe3eb;
  border-radius: 16px;
  padding: 24px;
}

.authHeader {
  margin-bottom: 18px;
}

.authSubtitle {
  color: #6b7280;
  margin-top: 4px;
}

.authTabs {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.authTabButton {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  background-color: #e5e7eb;
  color: #111827;
}

.authTabButton.active {
  background-color: #0f4c81;
  color: white;
}

.authForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.authInlineActions {
  margin-top: -4px;
}

.authTextButton {
  border: none;
  background: transparent;
  color: #0f4c81;
  font-weight: 700;
  padding: 0;
}

.authTextButton:hover {
  color: #0c3c66;
  text-decoration: underline;
}

.authStatusBox {
  margin-bottom: 16px;
  border: 1px solid #dbe3eb;
  border-radius: 12px;
  padding: 12px 14px;
  background-color: #f8fafc;
  color: #1f2937;
}

.authStatusBox.isError {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.authStatusBox.isSuccess {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.authStatusActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.authInfoBox {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background-color: #f8fafc;
  border: 1px solid #e5e7eb;
  color: #374151;
}

/* MODAL */
.modalOverlay {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 24, 39, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}

.modalCard {
  width: min(100%, 680px);
  background-color: white;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.modalSubtitle {
  color: #6b7280;
  margin-top: 4px;
}

.iconButton {
  border: none;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  color: #374151;
  padding: 0;
}

.contactForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.successMessage {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* FOOTER */
.siteFooter {
  background-color: #111827;
  color: white;
  padding: 24px 0;
  margin-top: 30px;
}

@media (max-width: 900px) {
  .messagesLayout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .headerContent {
    flex-direction: column;
    align-items: flex-start;
  }

  .logoImage {
    width: 52px;
    height: 52px;
  }

  .logoText h1 {
    font-size: 1.2rem;
  }

  .logoText p {
    font-size: 0.85rem;
  }

  .homeHeroSection {
    padding: 40px 0;
  }

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

  .homeHeroText h2 {
    font-size: 1.7rem;
  }

  .adDetailImage {
    height: 240px;
  }

  .adDetailBody {
    padding: 18px;
  }

  .adDetailTitleGroup h3 {
    font-size: 1.4rem;
  }

  .adDetailPrice {
    font-size: 1.6rem;
  }

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

  .modalCard {
    padding: 18px;
  }

  .accountNoticeContent {
    align-items: flex-start;
  }
}

.hidden {
  display: none;
}