/* ============================================================================
   HERITAGE HUNTER - UI Refresh
   ============================================================================ */

/* --- Base --- */
body {
  font-family: 'Cabin', sans-serif;
  background-color: #1a1f1e;
  color: #e8e8e8;
  margin: 0;
  padding: 0;
}

/* ============================================================================
   NAVBAR
   ============================================================================ */
.navbar {
  background-color: #1a1f1e;
  border-bottom: 1px solid rgba(202, 230, 244, 0.1);
  padding: 0;
}

.navbar-inner {
  display: flex;
  align-items: center;
  padding: 2px 16px;
  width: 100%;
  gap: 12px;
}

/* Left group: burger + search icon */
.nav-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* Centre: title (hidden when search is open) */
.nav-center {
  flex-grow: 1;
  text-align: center;
  min-width: 0;
}

/* Centre: search input (hidden by default, shown when search is open) */
.nav-center-search {
  display: none;
  flex-grow: 1;
  align-items: center;
  gap: 8px;
}

.nav-center-search.open {
  display: flex;
}

.nav-center-search input {
  flex-grow: 1;
  background-color: #2a302f;
  border: 1px solid rgba(202, 230, 244, 0.2);
  color: #e8e8e8;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.9rem;
  font-family: 'Cabin', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.nav-center-search input::placeholder {
  color: #8a9a9a;
}

.nav-center-search input:focus {
  border-color: #FB8517;
  box-shadow: 0 0 0 2px rgba(251, 133, 23, 0.25);
}

/* When search is open, hide the title (mobile/tablet only) */
.nav-center.hidden {
  display: none;
}

/* On desktop, don't hide title — show search beside it with a max width */
@media only screen and (min-width: 1025px) {
  .nav-center.hidden {
    display: block;
  }

  .navbar-inner {
    position: relative;
  }

  .nav-center-search.open {
    position: absolute;
    left: 90px;
    max-width: 320px;
    z-index: 10;
  }
}

/* Right group: login/logout */
.nav-right {
  flex-shrink: 0;
  text-align: right;
}

/* Shared icon style for burger and search */
.burger-icon,
.nav-icon {
  font-size: 24px;
  cursor: pointer;
  color: #cae6f4;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  flex-shrink: 0;
  user-select: none;
  line-height: 1;
}

.burger-icon:hover,
.nav-icon:hover {
  background-color: rgba(202, 230, 244, 0.1);
}

.nav-icon.active {
  color: #FB8517;
}

/* Search close X */
#search-close {
  font-size: 28px;
  padding: 0 6px;
}

#websiteTitle {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 1px;
  font-family: 'Cabin', sans-serif;
  color: #FB8517;
  white-space: nowrap;
}

#login-text {
  flex-shrink: 0;
  text-align: right;
}

.light-text {
  color: #cae6f4;
  font-size: 0.85rem;
  text-decoration: none;
}

.light-text:hover {
  color: #FB8517;
}

.logout {
  display: block;
  font-size: 0.75rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.logout:hover {
  opacity: 1;
}

/* ============================================================================
   SIDENAV
   ============================================================================ */
.sidenav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  background-color: #111614;
  overflow-x: hidden;
  transition: width 0.3s ease;
  padding-top: 60px;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
}

.sidenav a {
  padding: 12px 12px 12px 32px;
  text-decoration: none;
  font-size: 1.1rem;
  color: #8a9a9a;
  display: block;
  transition: color 0.2s, padding-left 0.2s;
}

.sidenav a:hover {
  color: #FB8517;
  padding-left: 40px;
}

.sidenav .closebtn {
  position: absolute;
  top: 0;
  right: 25px;
  font-size: 36px;
  margin-left: 50px;
  color: #cae6f4;
}

/* ============================================================================
   MAIN LAYOUT — index.html (pub list | map | pint glass)
   ============================================================================ */
#body-unique {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
  margin: 0;
  padding: 0;
}

#body-unique .navbar {
  grid-row: 1;
}

#body-unique #parent-container {
  grid-row: 2;
  overflow: auto;
}

#parent-container {
  display: flex;
  flex-direction: row;
  overflow: auto;
}

#pubs-container,
#map-container,
#pint-container {
  width: 33.333%;
  height: 100%;
  padding: 0;
  box-sizing: border-box;
  overflow-y: auto;
  background-color: #1a1f1e;
}

/* ============================================================================
   PUB LIST
   ============================================================================ */
#pubs-container {
  padding: 8px 4px 8px 12px;
}

.pub {
  border: none;
  margin: 0 0 6px 0;
  background-color: #2a302f;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background-color 0.2s;
  border-left: 3px solid transparent;
}

.pub:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  background-color: #323a38;
}

.pub-name {
  font-family: 'Cabin', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #cae6f4;
  margin: 0 0 2px 0;
}

.pub-address {
  font-size: 0.8rem;
  color: #8a9a9a;
  margin: 0;
}

.visited {
  background-color: rgba(251, 133, 23, 0.15);
  border-left: 3px solid #FB8517;
}

.visited .pub-name {
  color: #FB8517;
}

.visited:hover {
  background-color: rgba(251, 133, 23, 0.22);
}

.pub-expanded {
  background-color: #f7f7ff;
  color: #1a1f1e;
  min-height: auto;
  max-height: none;
  border-radius: 8px;
  border-left: 3px solid #FB8517;
}

.pub-expanded .pub-name { color: #1a1f1e; }
.pub-expanded .pub-address { color: #555; }
.pub-expanded:hover { background-color: #f0f0f8; transform: none; }

/* ============================================================================
   PUB EXPANDED CONTENT (forms, posts, buttons)
   ============================================================================ */
.pub .pub-expanded {
  padding: 10px 30px;
  position: relative;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.additional-content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: start;
  margin: 8px 5px 0 10px;
}

.additional-content textarea {
  margin-top: 5px;
  width: 100%;
  border-radius: 6px;
  border: 1px solid #ccc;
  padding: 8px;
  font-family: 'Cabin', sans-serif;
  font-size: 0.85rem;
}

.additional-content textarea:focus {
  border-color: #FB8517;
  outline: none;
  box-shadow: 0 0 0 2px rgba(251, 133, 23, 0.2);
}

.additional-content input[type="submit"] {
  align-self: flex-end;
  background-color: #FB8517;
  color: #1a1f1e;
  border: none;
  border-radius: 6px;
  padding: 6px 16px;
  font-family: 'Cabin', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 8px;
  transition: background-color 0.2s, transform 0.1s;
}

.additional-content input[type="submit"]:hover {
  background-color: #e07510;
  transform: translateY(-1px);
}

.additional-content input[type="date"] {
  border-radius: 6px;
  border: 1px solid #ccc;
  padding: 4px 8px;
  font-family: 'Cabin', sans-serif;
  font-size: 0.85rem;
}

.post { margin-left: 10px; font-size: 0.9rem; }

.edit-button,
.delete-button {
  margin: 6px 4px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: #fff;
  font-family: 'Cabin', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.edit-button:hover {
  background-color: #FB8517;
  border-color: #FB8517;
  color: #1a1f1e;
}

.delete-button {
  float: right;
  color: #c0392b;
  border-color: #c0392b;
}

.delete-button:hover {
  background-color: #c0392b;
  color: white;
}

/* ============================================================================
   MAP
   ============================================================================ */
#map-container {
  border-left: 1px solid rgba(202, 230, 244, 0.08);
  border-right: 1px solid rgba(202, 230, 244, 0.08);
  padding: 0;
}

/* ============================================================================
   PINT GLASS
   ============================================================================ */
#pint-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: 10px 0;
}

.pinttitle-desktop {
  display: block;
  text-align: center;
  color: #cae6f4;
  font-size: clamp(0.9rem, 1.5vw, 1.4rem);
  font-weight: 700;
  margin-bottom: 4px;
  flex-shrink: 0;
  padding: 0 8px;
}

.pinttitle-mobile { display: none; }

#animation-container {
  position: relative;
  width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#animation-text {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%);
  font-size: xx-large;
  color: #1a1f1e;
  font-family: 'Cabin', sans-serif;
  font-weight: bold;
  z-index: 1;
  text-shadow: -1px 0 #cae6f4, 0 1px #cae6f4, 1px 0 #cae6f4, 0 -1px #cae6f4;
}

#animation-water {
  transition: all 0.5s ease;
  transform-box: fill-box;
  transform-origin: bottom;
}

#pint-container svg {
  display: block;
  width: 85%;
  height: auto;
  flex-grow: 1;
  margin: 0 auto;
  padding-left: 15%;
}

#pint-bottomcontainer {
  color: #cae6f4;
  text-align: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  width: 100%;
}

/* ============================================================================
   LANDING / WELCOME PAGE
   ============================================================================ */
.welcome-content {
  background-color: #2a302f;
  margin: 10% auto;
  padding: 32px 40px;
  border: 1px solid rgba(202, 230, 244, 0.1);
  width: 80%;
  max-width: 600px;
  color: #e8e8e8;
  font-family: 'Cabin', sans-serif;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

#welcomeTitle {
  text-align: center;
  font-family: 'Cabin', sans-serif;
  color: #FB8517;
  font-size: 1.6rem;
}

#welcomeMessage {
  text-align: justify;
  font-family: 'Cabin', sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #cae6f4;
}

#welcomeMessage a { color: #FB8517; }

#welcomeLoginURL {
  display: block;
  text-align: center;
  font-size: 1.2rem;
  color: #FB8517;
  font-weight: 600;
  padding: 10px 24px;
  border: 2px solid #FB8517;
  border-radius: 8px;
  text-decoration: none;
  margin: 16px auto;
  max-width: 200px;
  transition: all 0.2s;
}

#welcomeLoginURL:hover {
  background-color: #FB8517;
  color: #1a1f1e;
}

/* ============================================================================
   ABOUT, FAQ, CONTACT PAGES
   ============================================================================ */
.about-page,
.faq-page {
  font-family: 'Cabin', sans-serif;
  line-height: 1.6;
  color: #cae6f4;
  background-color: #2a302f;
  border: 1px solid rgba(202, 230, 244, 0.1);
  border-radius: 12px;
  padding: 28px 32px;
  margin: 24px auto;
  width: 85%;
  max-width: 800px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.about-page h1, .faq-page h1 { font-size: 1.8rem; margin: 0 0 16px 0; color: #FB8517; }
.about-page h2, .faq-page h2 { font-size: 1.2rem; margin: 20px 0 8px 0; color: #e8e8e8; }
.about-page p, .faq-page p { font-size: 0.95rem; margin-bottom: 10px; }
.about-page a, .faq-page a { color: #FB8517; }

.contact-form { display: flex; flex-direction: column; align-items: flex-start; }
.form-group { margin-bottom: 16px; width: 100%; }
.form-group label { display: inline-block; margin-bottom: 6px; font-weight: 600; color: #cae6f4; }

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(202, 230, 244, 0.2);
  border-radius: 6px;
  background-color: #1a1f1e;
  color: #e8e8e8;
  font-family: 'Cabin', sans-serif;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #FB8517;
  outline: none;
  box-shadow: 0 0 0 2px rgba(251, 133, 23, 0.2);
}

.form-group button {
  padding: 10px 24px;
  background-color: #FB8517;
  color: #1a1f1e;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Cabin', sans-serif;
  font-weight: 600;
  transition: background-color 0.2s;
}

.form-group button:hover { background-color: #e07510; }

/* Alerts */
.messages .alert { border-radius: 8px; margin: 8px 16px; font-family: 'Cabin', sans-serif; }

/* Profile page */
.card { background-color: #2a302f; border: 1px solid rgba(202, 230, 244, 0.1); border-radius: 12px; }
.card-header { background-color: rgba(251, 133, 23, 0.1); color: #FB8517; font-weight: 600; border-bottom: 1px solid rgba(202, 230, 244, 0.1); }
.list-group-item { background-color: #2a302f; border-color: rgba(202, 230, 244, 0.08); color: #cae6f4; }
.btn-primary { background-color: #FB8517; border-color: #FB8517; color: #1a1f1e; font-weight: 600; }
.btn-primary:hover { background-color: #e07510; border-color: #e07510; }

/* ============================================================================
   RESPONSIVE — TABLET & MEDIUM (1024px and below)
   ============================================================================ */
@media only screen and (max-width: 1024px) {
  #parent-container {
    flex-direction: column;
    width: 100%;
    position: relative;
  }

  #pubs-container, #map-container, #pint-container { width: 100%; }

  #map-container { order: 1; height: 45vh; min-height: 250px; }
  #pubs-container { order: 2; height: auto; max-height: 50vh; padding: 8px; }

  #pint-container {
    order: 3;
    position: fixed;
    bottom: 12px;
    right: 12px;
    z-index: 50;
    width: 80px;
    height: 110px;
    background-color: rgba(26, 31, 30, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(202, 230, 244, 0.15);
    padding: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }

  .pinttitle-desktop { display: none; }
  .pinttitle-mobile {
    display: block;
    font-size: 0.55rem;
    color: #cae6f4;
    text-align: center;
    margin: 0;
    padding: 2px 0 0 0;
  }

  #pint-container svg { margin-left: 10%; width: 80%; height: 60%; padding-left: 0; }
  #animation-text { font-size: 0.7rem; top: 35%; }
  #pint-bottomcontainer { display: none; }

  .pub { margin: 0 0 4px 0; padding: 8px 12px; }
  .pub-name { font-size: 0.9rem; }
  .pub-address { font-size: 0.75rem; }
}

/* ============================================================================
   RESPONSIVE — MOBILE (500px and below)
   ============================================================================ */
@media only screen and (max-width: 500px) {
  .navbar-inner { padding: 2px 8px; gap: 6px; }

  .burger-icon, .nav-icon { font-size: 20px; padding: 2px 6px; }
  #search-close { font-size: 22px; }

  #websiteTitle { font-size: 1.3rem; letter-spacing: 0.5px; }

  .light-text { font-size: 0.7rem; }
  .logout { font-size: 0.6rem; }

  .nav-center-search input { font-size: 0.8rem; padding: 4px 8px; }

  #map-container { height: 50vh; }
  #pubs-container { max-height: 45vh; }

  #pint-container { width: 65px; height: 90px; bottom: 8px; right: 8px; }
  #pint-container svg { width: 85%; height: 55%; margin-left: 8%; }
  #animation-text { font-size: 0.6rem; }
  .pinttitle-mobile { font-size: 0.5rem; }

  .welcome-content { width: 92%; padding: 20px 24px; margin: 20% auto; }
  #welcomeTitle { font-size: 1.3rem; }
  #welcomeMessage { font-size: 0.85rem; }

  .about-page, .faq-page { width: 92%; padding: 20px 16px; margin: 16px auto; }
}
