/* ===========================
   CAMPUSMARKET - SELL PAGE CSS
   =========================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ---- NAVBAR ---- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 0 28px;
  height: 56px;
  border-bottom: 1px solid #e8eaed;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  color: #1a9e7c;
  font-size: 20px;
}

.nav-brand {
  font-weight: 700;
  font-size: 17px;
  color: #1a9e7c;
  letter-spacing: -0.3px;
}

.nav-bell {
  background: none;
  border: none;
  font-size: 18px;
  color: #666;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
}
.nav-bell:hover { background: #f0f2f5; }

/* ---- MAIN SECTION ---- */
.sell-section {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 16px 48px;
}

/* ---- SELL CARD ---- */
.sell-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  margin-bottom: 32px;
}

/* ---- HEADER ---- */
.sell-header {
  margin-bottom: 28px;
}
.sell-header h2 {
  font-size: 26px;
  font-weight: 700;
  color: #111;
  margin-bottom: 4px;
}
.sell-header p {
  font-size: 14px;
  color: #888;
}

/* ---- SELL BODY (2-col) ---- */
.sell-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

/* ---- LEFT COLUMN ---- */
.sell-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Upload Box */
.upload-box {
  border: 2px dashed #c8d6d0;
  border-radius: 12px;
  background: #f7faf9;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  padding: 20px;
  position: relative;
}
.upload-box:hover, .upload-box.dragover {
  border-color: #1a9e7c;
  background: #edf8f5;
}

.upload-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.upload-icon-wrap {
  width: 52px;
  height: 52px;
  background: #e0f2ec;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #1a9e7c;
  margin-bottom: 4px;
}

.upload-title {
  font-size: 14px;
  font-weight: 600;
  color: #222;
}
.upload-sub {
  font-size: 12px;
  color: #999;
  line-height: 1.5;
}

.select-btn {
  background: #fff;
  border: 1.5px solid #c8d6d0;
  border-radius: 8px;
  padding: 7px 20px;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  cursor: pointer;
  margin-top: 4px;
  transition: border-color 0.2s, color 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.select-btn:hover {
  border-color: #1a9e7c;
  color: #1a9e7c;
}

/* Image preview grid */
.preview-grid {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}
.preview-grid.active { display: grid; }

.preview-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid #e0ece8;
}

/* Tips Box */
.tips-box {
  background: #f7faf9;
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid #e0ece8;
}
.tips-title {
  font-size: 11px;
  font-weight: 700;
  color: #1a9e7c;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}
.tips-title i { margin-right: 5px; }

.tips-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tips-box li {
  font-size: 13px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tips-box li i {
  color: #1a9e7c;
  font-size: 13px;
  flex-shrink: 0;
}

/* ---- RIGHT COLUMN ---- */
.sell-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field-group label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.optional {
  font-weight: 400;
  color: #aaa;
  font-size: 12px;
}

.field-group input,
.field-group textarea,
.field-group select {
  width: 100%;
  border: 1.5px solid #e0e4e8;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: #222;
  background: #fff;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
}
.field-group input::placeholder,
.field-group textarea::placeholder {
  color: #bbb;
}
.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  border-color: #1a9e7c;
  box-shadow: 0 0 0 3px rgba(26, 158, 124, 0.1);
}

.field-group textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

/* Two-column row */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Select wrapper */
.select-wrap {
  position: relative;
}
.select-wrap select {
  padding-right: 32px;
  cursor: pointer;
}
.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 12px;
  pointer-events: none;
}

/* Phone input */
.phone-input-wrap {
  position: relative;
}
.phone-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 13px;
}
.phone-input-wrap input {
  padding-left: 34px;
}

/* Post Button */
.post-btn {
  background: #1a9e7c;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s;
  margin-top: 4px;
}
.post-btn:hover { background: #168a6b; }
.post-btn:active { transform: scale(0.98); }

.post-note {
  font-size: 11.5px;
  color: #aaa;
  text-align: center;
  line-height: 1.4;
}

/* Success Message */
.success-msg {
  display: none;
  background: #edf8f5;
  border: 1.5px solid #1a9e7c;
  color: #1a9e7c;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  gap: 8px;
  align-items: center;
}
.success-msg.show {
  display: flex;
}

/* ---- LISTINGS SECTION ---- */
.listings-section {
  background: #fff;
  border-radius: 16px;
  padding: 24px 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.listings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.listings-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #111;
}
.view-all {
  font-size: 13px;
  color: #1a9e7c;
  font-weight: 600;
  text-decoration: none;
}
.view-all:hover { text-decoration: underline; }

.listings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Listing Card */
.listing-card {
  border: 1.5px solid #e8eaed;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  background: #fff;
}
.listing-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.listing-img {
  width: 100%;
  height: 130px;
  background-size: cover;
  background-position: center;
  background-color: #e8eaed;
}

.listing-info {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.listing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.listing-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #222;
}
.listing-price {
  font-size: 13.5px;
  font-weight: 700;
  color: #111;
}

/* Tags */
.listing-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  border-radius: 4px;
  padding: 2px 7px;
  width: fit-content;
}
.listing-tag.textbooks { background: #e6f7f2; color: #1a9e7c; }
.listing-tag.electronics { background: #e8f0fe; color: #3b82f6; }

.listing-time {
  font-size: 11.5px;
  color: #aaa;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Create Card */
.create-card {
  cursor: pointer;
  border-style: dashed;
  border-color: #d0d5dd;
  background: #fafafa;
  transition: border-color 0.2s, background 0.2s;
}
.create-card:hover {
  border-color: #1a9e7c;
  background: #f0faf7;
  transform: translateY(-2px);
}

.create-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 185px;
  gap: 10px;
  color: #888;
}
.create-plus {
  width: 40px;
  height: 40px;
  border: 2px solid #ccc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #bbb;
  transition: border-color 0.2s, color 0.2s;
}
.create-card:hover .create-plus {
  border-color: #1a9e7c;
  color: #1a9e7c;
}
.create-inner p {
  font-size: 13px;
  font-weight: 500;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 700px) {
  .sell-body {
    grid-template-columns: 1fr;
  }
  .listings-grid {
    grid-template-columns: 1fr 1fr;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .sell-card { padding: 20px 14px; }
  .listings-grid { grid-template-columns: 1fr; }
}