/* css/styles.css */

:root {
  --primary-color: #556B2F;
  --secondary-color: #ffffff;
  --accent-color: #8B4513;
  --bg-color: #F5F5F5;
  --text-color: #333333;
  --section-bg-default: #ffffff;
  --section-bg-alt: #e8f0d8;
}

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

body {
  font-family: 'Open Sans', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}


/* Full-width Main Container */
main {
  width: 100%;
}

/* Section Styling */
section {
  padding: 20px;
}

/* Alternating Section Backgrounds */
.section-default {
  position: relative;
  background-color: var(--section-bg-default);
  background-image: url('../img/about.webp');
  background-repeat: no-repeat;
  background-size: cover;
}

/* Add overlay using a pseudo-element */
.section-default::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  z-index: 0;
}

/* Ensure direct children appear above the overlay */
.section-default > * {
  position: relative;
  z-index: 1;
}

.section-alt {
  background-color: var(--section-bg-alt);
}

/* Centered Section Headings */
section h2 {
  text-align: center;
  padding-bottom: 5px;
  font-size: 1.5em;
  margin-bottom: 15px;
  color: var(--primary-color);
}


.categories {
  position: relative;
  min-height: 90vh; 
  padding: 90px 10%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.categories::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* adjust opacity as needed */
  z-index: 1;
}

/* Ensure that the content appears above the overlay */
.top-content,
.bottom-content {
  position: relative;
  z-index: 2;
}

/* Top content styling */
.top-content {
  text-align: center;
  color: var(--secondary-color);
  padding-bottom: 50px;
}
.logo-container {
  padding-bottom: 20px;
}
.logo-image {
  width: 30%;   
  height: auto;
}

/* Welcome Title and Text */
.welcome-title {
  font-size: 2.5em;
  margin-bottom: 20px;
  font-family: 'Montserrat', sans-serif;
}

.welcome-text {
  font-size: 1.5em;
  max-width: 800px;
  margin: 0 auto;
  transition: opacity 0.5s ease;
  opacity: 1;
  font-family: 'Montserrat', sans-serif;
  min-height: 100px;
}

.welcome-text::after {
  content: "|";
  margin-left: 5px;
  animation: blink 0.7s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Bottom content styling */
.bottom-content {
  text-align: center;
  color: var(--secondary-color);
  padding-bottom: 50px;
}

.bottom-content h2 {
  font-size: 1.5em;
  margin-bottom: 15px;
  padding-bottom: 5px;
  color: white;
}

/* Categories Grid */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}



/* Footer — base reset (visual styles live in header.css under .site-footer) */
footer {
  width: 100%;
}

/* post_ad Page Styling */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--secondary-color);
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px;
  font-family: 'Open Sans', sans-serif;
  font-size: 1em;
  color: var(--text-color);
  width: 100%;
  outline: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'10'%20height%3D'10'%20viewBox%3D'0%200%2010%2010'%20xmlns%3D'http://www.w3.org/2000/svg'%3E%3Cpolygon%20points%3D'0,0%2010,0%205,7'%20fill%3D'%23333'%2F%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
  margin-bottom: 20px;
}

.media-upload-area {
  border: 2px dashed #ccc;
  border-radius: 4px;
  background-color: var(--secondary-color);
  height: 300px;  /* Fixed height */
  position: relative;
  overflow-y: auto;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 5px;
  padding: 10px; /* Optional padding */
}

.media-placeholder {
  font-size: 1em;
  color: var(--text-color);
  margin: 0 0 10px 0;
  text-align: center;
}

.media-upload-area h3 {
  margin-top: 0;
  font-size: 1.5em;
  color: var(--text-color);
}

#uploadButton {
  padding: 8px 12px;
  border: 1px solid var(--primary-color);
  background-color: var(--primary-color);
  color: var(--secondary-color);
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 10px;
}

#uploadButton:hover {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.media-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.media-thumb {
  position: relative;
  display: inline-block;
}

.media-thumb img,
.media-thumb video {
  max-width: 100px;
  max-height: 100px;
  object-fit: cover;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.remove-btn {
  position: absolute;
  top: -5px;
  right: -5px;
  background: red;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  text-align: center;
  line-height: 20px;
  font-size: 16px;
  cursor: pointer;
}

.set-main-btn {
  position: absolute;
  bottom: -5px;
  left: -5px;
  width: 22px;
  height: 22px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0;
}

.set-main-btn.is-main {
  background: #556B2F;
}

.set-main-btn:not(.is-main):hover {
  background: rgba(85, 107, 47, 0.85);
}

/* -------------------------------
   Forms (Login & Register) Styling
---------------------------------- */
form.auth-form {
  margin: 40px auto;
  padding: 20px;
  background-color: var(--section-bg-default);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.auth-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  font-family: 'Montserrat', sans-serif;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="number"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: 'Open Sans', sans-serif;
  font-size: 1em;
}

.auth-form textarea {
  width: 100%;
  min-height: 150px;  /* Set a minimum height */
  resize: vertical;   /* Allow vertical resizing only */
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: 'Open Sans', sans-serif;
  font-size: 1em;
  margin-bottom: 20px;
}

.auth-form button[type="submit"] {
  width: 100%;
  padding: 10px;
  background-color: var(--primary-color);
  color: var(--secondary-color);
  border: none;
  border-radius: 4px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-family: 'Montserrat', sans-serif;
}

.auth-form button:hover {
  background-color: var(--accent-color);
}

/* -------------------------------
       Responsive Form Adjustments
---------------------------------- */
@media (max-width: 480px) {
  form.auth-form {
    margin: 20px 10px;
    padding: 15px;
  }
}

/* -------------------------------
          Cookie banner
---------------------------------- */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 15px 20px;
  display: none; /* Hidden by default; shown via JS if not accepted */
  justify-content: space-between;
  align-items: center;
  z-index: 10000;
  font-size: 14px;
}

#cookie-banner p {
  margin: 0;
}

#cookie-banner a {
  color: #fff;
  text-decoration: underline;
}

#accept-cookies {
  background: var(--primary-color); /* Or a color of your choice */
  color: var(--secondary-color);      /* Or a color of your choice */
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: background 0.3s;
}

#accept-cookies:hover {
  background: var(--accent-color);
}