/* ===== Reset and Base Styles ===== */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0b5ea8;
  color: white;
}

/* ===== Banner ===== */
.banner {
  height: 60px;
  width: 100%;
  background-color: black; /* transparent by default */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.banner.scrolled {
  background-color: black;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* Header inside banner */
.banner .header {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Logo */
.banner .logo {
  width: 50px;
  height: auto;
  object-fit: contain;
}

/* Title inside header */
.banner .header h1 {
  font-size: 20px;
  margin: 0;
  color: white;
  font-family: Helvetica, Arial, sans-serif;
}

/* Navigation links */
.banner .nav-links {
  display: flex;
  gap: 40px;
  align-items: center;
  flex-wrap: wrap;
}

/* Nav link text and hover */
.banner .nav-links .spaced-span a {
  font-size: 28px; /* matches index page */
  font-weight: 500;
  color: white;
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}

.banner .nav-links .spaced-span a:hover {
  color: yellow;
}

.banner .nav-links .spaced-span a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  background: white;
  left: 0;
  bottom: -2px;
  transition: width 0.3s ease;
}

.banner .nav-links .spaced-span a:hover::after {
  width: 100%;
}

/* Contact Button */
.banner .contact-us-button {
  background-color: white;
  color: black;
  padding: 10px 25px;
  border-radius: 25px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.2s, box-shadow 0.2s;
}

.banner .contact-us-button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Menu Toggle (Mobile) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 30px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.menu-toggle:hover {
  transform: scale(1.1);
}

/* ===== Marketplace Wrapper and Hero Section ===== */
.marketplace-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 30px;
}

/* Hero Section */
.hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 50px;
}

.hero-content h1 {
  font-size: 3.2rem;
  margin-bottom: 15px;
}

.hero-content p {
  font-size: 1.3rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 30px;
}

/* Search bar */
.search-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(0,0,0,0.15);
  padding: 18px;
  border-radius: 18px;
  width: fit-content;
  margin: 0 auto;
}

.search-bar input,
.search-bar select {
  border: none;
  border-radius: 12px;
  padding: 15px 18px;
  font-size: 1rem;
  min-width: 230px;
}

.search-bar button {
  border: none;
  border-radius: 12px;
  padding: 15px 24px;
  background: #1677ff;
  color: white;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}

/* ===== Marketplace Content ===== */
.marketplace-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  align-items: start;
}

/* Sidebar */
.sidebar {
  background: #12385c;
  border-radius: 20px;
  padding: 25px;
}

.sidebar h2 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.6rem;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar ul li {
  margin-bottom: 10px;
  font-size: 1rem;
}

/* Listings Grid */
.listings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* Individual Listing Cards */
.listing-card {
  background: #165a8a;
  border-radius: 16px;
  padding: 15px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.listing-card img {
  max-width: 100%;
  border-radius: 12px;
  margin-bottom: 10px;
}

.listing-card h3 {
  margin: 10px 0 5px;
  font-size: 1.2rem;
}

.listing-card p {
  margin: 5px 0;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
}

.listing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* ===== Delete Button Styling ===== */
.listing-card .delete-btn {
  background-color: #ff4444;
  border: none;
  color: white;
  font-weight: bold;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s, transform 0.2s;
  font-size: 0.9rem;
}

.listing-card .delete-btn::before {
  content: "🗑️";
}

.listing-card .delete-btn:hover {
  background-color: #cc0000;
  transform: translateY(-2px);
}

/* ===== Sell Button ===== */
.sell-button-wrapper {
  margin-top: 20px;
}

.sell-button {
  background: #00c851;
  border: none;
  color: white;
  font-size: 1.1rem;
  padding: 15px 25px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.sell-button:hover {
  background: #007e33;
}

/* ===== Sell Form Container ===== */
.sell-form-container {
  display: none;
  background: #12385c;
  border-radius: 20px;
  padding: 25px;
  margin-top: 40px;
}

.sell-form-container h2 {
  margin-top: 0;
  margin-bottom: 20px;
}

.sell-form-container form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sell-form-container input,
.sell-form-container select,
.sell-form-container textarea,
.sell-form-container button[type="submit"] {
  padding: 12px 15px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
}

.sell-form-container textarea {
  resize: vertical;
  min-height: 80px;
}

.sell-form-container button[type="submit"] {
  background: #00c851;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.sell-form-container button[type="submit"]:hover {
  background: #007e33;
}

/* ===== Auth Container Styling ===== */
#auth-container {
  max-width: 400px;
  margin: 40px auto;
  background: rgba(255, 255, 255, 0.1);
  padding: 30px 25px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  text-align: center;
  color: white;
  backdrop-filter: blur(6px);
}

#auth-container h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

#auth-container input {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 15px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  outline: none;
  box-sizing: border-box;
}

#auth-container button {
  width: 100%;
  padding: 12px 0;
  margin-bottom: 10px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s;
}

#auth-container button#signUpBtn {
  background-color: #00c851;
  color: white;
}

#auth-container button#signUpBtn:hover {
  background-color: #007e33;
  transform: scale(1.03);
}

#auth-container button#signInBtn {
  background-color: #1677ff;
  color: white;
}

#auth-container button#signInBtn:hover {
  background-color: #005bb5;
  transform: scale(1.03);
}

#auth-container button#signOutBtn {
  background-color: #ff4444;
  color: white;
}

#auth-container button#signOutBtn:hover {
  background-color: #cc0000;
  transform: scale(1.03);
}

#auth-container p#authStatus {
  margin-top: 10px;
  font-size: 0.95rem;
  min-height: 1.2em;
  color: #fff;
}

/* ===== Modal Styles ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  padding-top: 0;
  transition: padding-top 0.5s ease, opacity 0.5s ease;
  opacity: 0;
  pointer-events: none;
}

.modal.show {
  padding-top: 80px;
  opacity: 1;
  pointer-events: auto;
}

#auth-container {
  transform: translateY(-100px);
  transition: transform 0.5s ease;
}

.modal.show #auth-container {
  transform: translateY(0);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  color: white;
  cursor: pointer;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 500px) {
  #auth-container {
    margin: 20px;
    padding: 20px;
  }

  #auth-container h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 1024px) {
  .marketplace-content {
    grid-template-columns: 1fr;
  }

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

/* ===== Responsive Banner for Tablet + Mobile ===== */

/* Tablet: 769px – 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
  .banner .nav-links .spaced-span a {
    font-size: 20px;       /* smaller font for tablets */
  }
  .banner .header h1 {
    font-size: 18px;       /* smaller site title */
  }
  .banner .nav-links {
    gap: 20px;             /* reduce spacing */
  }
}

/* Mobile: ≤768px */
@media (max-width: 768px) {
  .banner {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 15px;
  }

  .banner .header {
    gap: 10px;
    justify-content: center;
  }

  .banner .header h1 {
    font-size: 16px;       /* smaller site title */
  }

  .banner .nav-links {
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    align-items: center;
    width: 100%;
    gap: 12px;
    transition: max-height 0.3s ease;
  }

  .banner .nav-links.show {
    max-height: 400px;     /* allow links to wrap */
  }

  .banner .nav-links .spaced-span a {
    font-size: 18px;       /* mobile-friendly font size */
    white-space: normal;   /* wrap long text */
    text-align: center;
  }

  .menu-toggle {
    display: block;
  }
}