html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-color: #353535; /* concrete grey */
    color: #fff;
}

#pageWrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#title {
    position: relative;
    text-align: center;
    font-size: clamp(1rem, 6vw, 2rem); /* min 1.5rem, preferred 6vw, max 3rem */
    color: #fff;
    padding: 2vh 2vw;
    z-index: 1;

    overflow: hidden;
    border-radius: 1vh;
}

#title::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(50px, 40vw, 200px);  /* scales but stays within limits */
    height: clamp(50px, 40vw, 200px);
    background-image: url('https://www.sdsskateboards.com/cdn/shop/products/dip-black_1024x1024.png?v=1676345769');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    transform: translate(-50%, -50%) rotate(90deg);
    z-index: -1;
    opacity: 0.8;
}

/* Mobile tweaks */
@media (max-width: 480px) {
    #title {
        font-size: 8vw;
        padding: 3vh 3vw;
    }

    #title::before {
        width: 60vw;
        height: 60vw;
    }
}


#map {
    flex: 1 1 auto;
    min-height: 300px;
    border-top: 2px solid #666;  /* subtle border for style */
    border-bottom: 2px solid #666;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}

#addSpotBtn {
    position: fixed;   /* float on top of map */
    top: 90%;            /* distance from top */
    left: 50%;            /* center horizontally */
    transform: translateX(-50%);
    z-index: 1000;        /* make sure it stays above map tiles */
    padding: 10px 20px;
    background-color: #fff;
    border: 2px solid #333;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

#addSpotBtn:hover {
    background-color: #f0f0f0;
}

#spotForm {
    display: flex;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex; /* only applies when visible */
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#spotForm form {
    background-color: #303030dc;
    padding: 20px 30px;
    border-radius: 10px;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#spotForm input, #spotForm textarea {
    width: 100%;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #333;
}

#spotForm button {
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

#tagOptions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tagBtn {
    padding: 5px 10px;
    border: 1px solid #333;
    border-radius: 5px;
    background-color: #eee;
    cursor: pointer;
    font-size: 0.9em;
}

#tagBtn:hover {
    background-color: #f0f0f0;
}

.tagBtn.selected {
    background-color: #666;
    color: #fff;
    border-color: #444;
}

#filterContainer {
    position: fixed;
    top: 150px;
    right: 10px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#filterBtn {
    padding: 10px 20px;
    background-color: #fff;
    border: 2px solid #333;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

#filterBtn:hover {
    background-color: #f0f0f0;
}

#filterPanel {
    display: none; /* hidden by default */
    flex-direction: column;
    gap: 10px;
    background-color: #3f3f3f;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    min-width: 150px;
    max-height: 400px;
    overflow-y: auto;
}

#filterPanel h3 {
    margin-top: 10px;
    font-size: 1em;
    color: #fff;
}

#filterOptions button {
    display: block;
    width: 100%;
    margin-bottom: 5px;
    padding: 8px;
    background-color: #eee;
    border: 1px solid #333;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
}

#filterOptions button.selected {
    background-color: #15ff00;
    color: #fff;
    border-color: #444;
}

/* Modal background */
.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
  }
  
  /* Modal box */
  .modal-content {
    background: #3f3f3f;
    padding: 20px;
    border-radius: 10px;
    width: 280px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 3000;
  }
  
  /* Close button */
  .close {
    float: right;
    font-size: 22px;
    cursor: pointer;
    z-index: 3000;
  }
  
  /* Open button */
  .auth-open {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1100;
  }
  
#topLeftOverlay {
    position: absolute;   /* stays in the same place while scrolling */
    top: 10px;         /* distance from top */
    left: 10px;        /* distance from left */
    display: flex;
    align-items: center;
    gap: 1vw;          /* space between image and text */
    background-color: rgba(0, 0, 0, 0.6); /* semi-transparent background */
    padding: 1vw 1vw;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    z-index: 1200;      /* above map controls */
    font-size: 1.2vw;
}
  

#topLeftOverlay img {
    width: 5vw;       /* adjust to desired size */
    max-width: 50px;
    height: auto;
    object-fit: cover;
    display: block;
    border-radius: 5px;
}

#authBtn {
    padding: 10px 20px;
    background-color: #fff;
    border: 2px solid #000000;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

#authBtn:hover {
    background-color: #f0f0f0;
}

#authSubmitBtn {
    padding: 5px 10px;
    background-color: #fff;
    border: 2px solid #333;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

#authSubmitBtn:hover {
    background-color: #f0f0f0;
}

#signOutBtn {
    padding: 10px 20px;
    background-color: #fff;
    border: 2px solid #000000;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

#signOutBtn:hover {
    background-color: #f0f0f0;
}

/* Overlay on top of everything */
.popup-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999; /* Higher than modals */
}

/* Hidden state */
.hidden {
  display: none;
}

/* Content box */
.popup-content {
  background: #3f3f3f;
  padding: 20px 25px;
  border-radius: 10px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.popup-btn {
  margin-top: 15px;
  padding: 8px 15px;
  background-color: #fff;
  color: #000;
  border: 2px solid #333;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.popup-btn:hover {
  background-color: #f0f0f0;
}

#locateBtn {
    position: fixed;
    right: 5px;
    bottom: 25px;
    padding: 5px 5px;
    background-color: #fff;
    border: 2px solid #333;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 2000;
}

#locateBtn:hover {
    background-color: #f0f0f0;
}

#userEmail {
    position: absolute;
    top: 55px;
    right: 60px;
    font-size: 12px;
    margin-left: auto;
    color: #a1a1a1;
}

#userDisplayName {
    position: absolute;
    top: 70px;
    right: 60px;
    font-size: 12px;
    margin-left: auto;
    color: #a1a1a1;
}

#userProfilePic {
    position: absolute;
    top: 50px;
    right: 10px;
}

#editProfileBtn {
    padding: 10px 20px;
    background-color: #fff;
    border: 2px solid #000000;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

#editProfileBtn:hover {
    background-color: #f0f0f0;
}

#saveProfileBtn {
    padding: 10px 20px;
    background-color: #fff;
    border: 2px solid #000000;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

#saveProfileBtn:hover {
    background-color: #f0f0f0;
}

#profileBtn {
    padding: 10px 20px;
    background-color: #fff;
    border: 2px solid #000000;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

#profileBtn:hover {
    background-color: #f0f0f0;
}

#forgotPasswordLink {
    text-decoration: underline;
}

#resetModal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4000;
    background: #3f3f3f;
    padding: 20px;
    border-radius: 10px;
    width: 400px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 5000;
}

#resetCancelBtn, #resetSubmitBtn {
    padding: 5px 10px;
    background-color: #fff;
    border: 2px solid #333;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

#resetCancelBtn:hover, #resetSubmitBtn:hover {
    background-color: #f0f0f0;
}