/***** PRE-DEFINED VARIABLES *****/
:root {
    --blue-info:rgb(75, 131, 187);
    --green-success:rgb(127, 207, 127);
    --red-light: #F4442E;
    --red-bold: #D53925;
    --yellow-warning:rgb(230, 226, 44);
    --eggshell: #F5F1EC;
    --orange: #F08700;
    --darker-orange: #D47700;
    --yellow: #D7CF07;
    --light-brown: #C8BDAF;
    --brown: #70583E;
    --autumn-color:#70583E;
    --spring-color:#3a7f79;
    --summer-color:#656f30;
    --winter-color:white;
    --white: white;

    /* Standard sizing for fonts */
    /* --standard-font: 20px; */
    
    /* Standard sizing for padding, margins, etc */
    --five-px: 5px;
    --ten-px: 10px;
    --fifty-px: 50px;

    /* Standard font sizing */
    --font-extra-extra-small: 0.6rem;
    --font-extra-small: 0.8rem;
    --font-small: 1rem;
    --font-medium: 1.25rem;
    --font-large: 2rem;
    --font-extra-large: 2.5rem;
}

[data-theme="dark"] {
  --eggshell: #0c1015;
  --winter-color:rgb(104, 104, 104);
  --white: #3b3b34;
  --brown: #baa084;
  --light-brown: #5f5445;
}

@font-face {
    font-family: 'inter'; /* Choose a name for your font family */
    src: url('../font/Inter-VariableFont_opsz\,wght.ttf') format('truetype');   
    /* font-weight: normal; Define font weight if applicable */
    /* font-style: normal;  Define font style if applicable */
}

html {
    scroll-behavior: smooth;
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'inter';
    font-size: 20px; /* To use for rem */
    color: var(--brown);
}

body{
    margin: 0;
    padding: 0;
    height: 100%;
    /* display: flex; */
    /* flex-wrap: wrap; */
    width: 100vw;
    /* background-color: var(--eggshell); */
    background-color: var(--eggshell);
    padding-right: var(--scrollbar-compensation, 0px);
    overflow-x: hidden;
    width: 100%;
}

[data-theme="dark"] body{
  scrollbar-color: var(--white) var(--brown);
}

h1{
  font-weight: 900;
  font-size: var(--font-extra-large);
  margin: 0;
}

[data-theme="dark"] #home-hero *, #home-hero input {
  color: white;
}

h2{
  font-size: var(--font-large);
}

#main-page-content{
    display: flex;
    flex-direction: column;
    /* height: 100vh; */
    /* min-height: 100vh; */
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

main{
    flex-grow: 1;
    /* min-height: calc(100vh - 270px); */
    min-height: calc(100vh - 170px);
    position: relative;
    /* padding: 15px 40px; */
    /* max-width: 1200px; */
}

input, textarea {
  padding: 5px;
  border-radius: 2px;
  border: 1px solid var(--light-brown);
  font-size: var(--font-extra-small);
  transition: border-color 0.2s ease;
  color: var(--brown);
  font-family: 'inter';
  background-color: var(--white);
}

/* Placeholders */
input::placeholder, textarea::placeholder {
  color: var(--light-brown);
}

input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { /* Chrome, Opera, Safari */
  color: var(--light-brown);
}

input::-moz-placeholder, textarea::-moz-placeholder { /* Firefox 19+ */
  color: var(--light-brown);
  opacity: 1;
}

input:-moz-placeholder, textarea:-moz-placeholder { /* IE 10+ */
  color: var(--light-brown);
}

input:-moz-placeholder, textarea:-moz-placeholder { /* Firefox 18- */
  color: var(--light-brown);
}

@media (max-width: 576px) {
  html{
    font-size: 17px;
  }

  /* main{
    min-height: calc(100vh - 70px);
  } */
}

mark{
  background-color: var(--yellow);
}

/* SCROLL TO TOP BUTTON */
#scrollToTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--brown);
  color: var(--white);
  font-size: 24px;
  border: none;
  border-radius: 50%;
  cursor: pointer;

  opacity: 0;
  pointer-events: none;

  transition: all 0.3s ease;
  z-index: 500;
}

#scrollToTopBtn:hover {
  transform: scale(1.12);
  background: var(--darker-orange);
}

#scrollToTopBtn.visible {
  opacity: 0.95;
  pointer-events: auto;
}


/* NAVBAR */
nav{
  display: flex;
  align-items: center;
  font-size: var(--font-small);
  font-weight: 700;
  position: relative;
  padding: 30px 50px 100px 50px;
  box-sizing: border-box;
  top: 0;
  left: 0;
  right: 0;
  width: auto;
}

nav.home{
  position: absolute;
  padding: 30px 50px;
}

nav .background{
  position: absolute;
  left: 0;
  top: 0;
  /* right: 0; */
  background-position: center;
  background-size: cover;
  /* bottom: 0; */
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  cursor: default;
}

[data-theme="dark"] nav .nav-tear img{
  content: url('/images/partials/content-top-ripped-dark.png');
}

/* Nav links (desktop & mobile) */
#nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 0; /* your padding already spaces things out */
  position: relative;
  z-index: 3; /* above .background */

}


#nav-links a,
#nav-open-login-modal,
#nav-logout,
#themeToggle {
  padding: 0 20px;
  text-decoration: none;
  color: var(--orange);
  cursor: pointer;
  z-index: 3;
  transition: color 0.2s ease;
}


#nav-links a,
#nav-logout {
  z-index: 3;
}

/* Nav links hover */
#nav-links a:hover,
#nav-open-login-modal:hover,
#nav-logout:hover, 
#themeToggle:hover {
  color: var(--yellow);
}
/* nav > a:hover, #nav-open-login-modal:hover, #nav-logout:hover {
  color: var(--yellow);
} */

.nav-tear {
    width: 100vw;
    overflow: hidden; 
    min-width: 900px;
    position: absolute;

}

.nav-tear:not(.home) { /* Regular search bar, not for home page */
      bottom: 0;
    left: 0;
    z-index: 2;
}


.nav-tear.home.top {
    
    /* top: 10px; */
    border-top: 30px var(--eggshell) solid;
}
.nav-tear.home.bottom {
    bottom: 60px;
}

.nav-tear img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    pointer-events: none;
    position: relative;
}

.nav-tear.home.bottom img {
  left: -10px;
  width: calc(101% + 10px);
}


[data-theme="dark"] .nav-tear.home.top img {
  content: url('/images/partials/home-page-nav-ripped-dark.png');
}

[data-theme="dark"] .nav-tear.home.bottom img {
  content: url('/images/partials/content-top-ripped-dark.png');
}


/* FIller to fill in the transparent spots that aren't wanted */
.nav-tear-filler.bottom.home{
  position: relative;
  width: 100vw;
  height: 60px;
  background: var(--eggshell);
  bottom: 0;
}

#nav-links .highlighted, #content-wrapper footer .highlighted{
  color: var(--yellow);
}

/* Dark / light mode toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--brown);
  /* padding: 6px 10px; */
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  /* gap: 6px; */
  align-items: center;
  font-size: var(--font-small);
  font-weight: 700;
  margin-left: auto;
}

[data-theme="dark"] .theme-toggle .sun {
  display: none;
}

[data-theme="light"] .theme-toggle .moon {
  display: none;
}


a:not(.btn-primary, .btn-secondary){
  text-decoration: none;
  color: var(--orange);
  transition: all 0.2s ease;
}
a:hover {
  color: var(--yellow);
}

/* NAVBAR MOBILE VIEW */
@media (max-width: 992px) {
  nav {
    padding: 30px 50px 70px 50px;
  }
}
@media (max-width: 768px) {
  nav {
    padding: 16px 18px 40px 18px;
  }

  nav.home{
    padding: 20px 17px;
  }

  /* Mobile toggle (3 bars) */
  #nav-mobile-toggle {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    z-index: 50;
    margin-left: auto; /* push it to the right */
  }

  #nav-mobile-toggle .bar {
    width: 22px;
    height: 2px;
    background: var(--orange);
    border-radius: 2px;
  }

  /* Backdrop (hidden by default) */
  #nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    /* backdrop-filter: blur(2px); */
    z-index: 1040;
  }

  #nav-backdrop.visible {
    display: block;
  }

  /* Close button inside the drawer */
  .nav-close {
    align-self: flex-end;
    font-size: 1.6rem;
    padding: 10px;
    cursor: pointer;
    color: var(--brown);
  }

  /* Turn nav links into a slide-in panel */
  #nav-links {
    position: fixed;
    inset: 0 0 0 30%; /* panel from right side; adjust as you like */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    background: var(--eggshell);
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
    box-shadow: -4px 0 10px rgba(0,0,0,0.3);
    z-index: 1045;
  }

  #nav-links a,
  #nav-links button,
  #nav-open-login-modal,
  #nav-logout {
    padding: 10px 0;
    font-size: var(--font-small);
  }

  /* When open */
  #nav-links.open {
    transform: translateX(0);
  }

  .nav-tear {
    min-width: 0;
    width: 100%;
  }

  /* Dark mode toggle */
  .theme-toggle {
    margin-left: unset;
  }
}

@media (min-width: 992px) {
  .nav-tear.home.top {
    border-top: none;
  }
}


/* Hide backdrop & close button on desktop */
@media (min-width: 769px) {
  #nav-backdrop { display: none !important; }
  .nav-close { display: none; }
}

/* Desktop: hide toggle */
#nav-mobile-toggle {
  display: none;
}


/* Loading */
#main-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 5000;
}

#main-loading-overlay.visible {
  display: flex;
}

#main-loading-overlay::after {
  content: "Loading...";
  color: white;
  font-size: var(--font-medium);
}

/* SEARCH */
#search-parent{
  position: relative;
  margin-bottom: 0;
  align-self: center;
  flex: 0.5;
  margin: 20px 0px;
  display: flex;
  justify-content: center;
  align-items: center;
  --search-box-container-width: 85%;
  --search-box-container-width-decimal: 0.85;
  z-index: 20;
  width: 100%;
  background-color: var(--white);
  border: var(--light-brown) solid 3px;
  border-radius: 10px;
  box-shadow: #00000047 0px 4px 4px;
}

#search-parent *{
  color: var(--brown);

}

#search-parent.home{
  min-height: 60px;
  background-color: rgba(134, 134, 134, 0.45);
  backdrop-filter: blur(4px);
  border: var(--eggshell) solid 2px;
  border-radius: 10px;
}

[data-theme="dark"] #search-parent.home {
  border: var(--light-brown) solid 3px;

}

#search-parent:not(.home){
  margin-bottom: 75px;
}

#search-parent.home *{
  font-size: var(--font-medium);
  font-weight: bold;
  color:  var(--white);
  margin: auto;
}

#search-parent * {
  background: none;
}

#search-box-container{
  position: relative;
  width: 100%;
  display: flex;
}

#search-box-container-left-padding{
  padding-left: 20px;
}

@media (max-width: 576px) {
  #search-box-container-left-padding{
    padding-left: 0px;
  }
}

#search-btn {
    border: 0;
    background: none;
    padding: 0 10px;
    color: var(--light-brown);
    display: flex;
    align-items: center;
    cursor: pointer;
}

#search-input-box {
    width: 100%;
    border: 0;
    outline: 0;
    font-size: var(--font-small);
    padding: 10px 12px;
}
[data-theme="dark"] #search-input-box {
    color: rgb(208, 208, 208);
}

#clear-search{
  padding: 0 10px;
    color:  var(--white);
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* White placeholder text (for home page input) */
#search-parent.home *::placeholder {
  color:  var(--white);
}

#search-parent.home *::-webkit-input-placeholder { /* Chrome, Opera, Safari */
  color:  var(--white);
}

#search-parent.home *::-moz-placeholder { /* Firefox 19+ */
  color:  var(--white);
  opacity: 1;
}

#search-parent.home *:-ms-input-placeholder { /* IE 10+ */
  color:  var(--white);
}

#search-parent.home *:-moz-placeholder { /* Firefox 18- */
  color:  var(--white);
}

@media (max-width: 768px) {
  #search-input-box > div{
    
  }
}

/* Footer */
footer{
    margin-top: 25px;
    width: 100%;
    background-color: var(--eggshell);
    text-align: end;
    padding: 20px;
    box-sizing: border-box;
}

footer > *{
    margin: 0 10px
}

footer > a{
  cursor: pointer;
}

/****** MODALS ******/
.modal{
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  overflow: visible;
  position: relative;
  mask-image: linear-gradient(to top, transparent, #000000 1%, #000000 99%, transparent);
  border-radius: 62px;
  max-height: 85vh;
  max-width: 100vw;
  
}


#modal-backdrop-insert{
  z-index: 1010;
}
/* === BACKDROP === */
.modal-backdrop {
  z-index: 1050;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  /* backdrop-filter: blur(6px); */
}
/* Don't accept clicks on the parent "invisible" portion, to allow clicks to go through for backdrop el */
.modal-parent{
  position: fixed;      /* overlay */
  inset: 0;             /* fill viewport */
  display: flex;        /* center content */
  align-items: center;
  justify-content: center;
  z-index: 1500;   
  pointer-events: none;
}
.modal-parent > * {
    pointer-events: all;
}

.modal-close {
  font-size: var(--font-medium);
  cursor: pointer;
  /* color: #666; */
  transition: color 0.2s;
  width: 20px;
  height: 20px;
}
.modal-close *{
  stroke: var(--brown);
}


.modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.modal-tear-left {
  width: 87px;
  background-image: url('/images/partials/login-left-ripped.png');
  background-repeat: repeat-y; 
  background-size: 100% auto;
  flex-shrink: 0;
  animation: fadeIn 0.3s ease-out;
  margin-right: -1px;
}

.modal-tear-right {
  width: 86px; /*png width*/
  background-image: url('/images/partials/login-right-ripped.png');
  background-repeat: repeat-y;
  background-size: 100% auto;
  flex-shrink: 0;
  animation: fadeIn 0.3s ease-out;
  margin-left: -1px;
}

.modal-content{
  overflow-y: auto;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(0); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .modal{
    border-radius: 25px;
  }
  .modal-tear-left, .modal-tear-right{
    width: 15px;
  }
}

[data-theme="dark"] .modal-tear-left {
  background-image: url('/images/partials/login-left-ripped-dark.png');
}

[data-theme="dark"] .modal-tear-right {
  background-image: url('/images/partials/login-right-ripped-dark.png');
}

[data-theme="dark"] .modal-backdrop  {
  background: rgb(0 0 0 / 89%);
}

/* FORMS */
.form-group{
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: left;
  margin-bottom: 20px;
}

.form-input-rules{
  font-size: var(--font-extra-extra-small);
}


/***** ALERTS & FLASH *****/
.alert{
    padding: var(--ten-px);
    margin-bottom: 5px;
}

.alert.info {
    background-color: var(--blue-info);
}
.alert.warning {
    background-color: var(--yellow-warning);
}
.alert.error {
    background-color: var(--red-light);
}
.alert.success {
    background-color: var(--green-success);
}

#flash-messages{
    width: 100vw;
    /* width: calc(100vw - (100vw - 100%)); */
    /* top: 0; */
    /* left: 0; */
    /* right: 0; */
    display: flex;
    position: fixed;
    flex-direction: column;
    z-index: 999999; 
    box-sizing: border-box;

    /* Resize to exclude scrollbar */
    scrollbar-gutter: stable;
    overflow: hidden;
}

.flash-message{
    /* width: 100%; */
    /* display: flex; */
    /* justify-content: space-between; */
    /* box-sizing: border-box; */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    margin: 0;
    box-sizing: border-box;
    color: black;
    font-weight: 500;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.flash-message.fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

.flash-message .close-btn {
  margin-left: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: var(--font-extra-small);
}

.flash-message .timer {
  /* margin-left: 10px; */
  font-weight: 400;
  font-size: var(--font-extra-small);
  opacity: 0.9;
  background-color:  var(--white);
  color: black;
  padding: 2px;
  border: #000 1px solid;
  border-radius: 15px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.alert.info .timer {
    border-color: blue;
}
.alert.warning .timer {
    border-color: rgb(175, 164, 0);
}
.alert.error .timer {
    border-color: rgb(255, 0, 0);
}
.alert.success .timer {
    border-color: rgb(0, 150, 0);
}

/* Buttons */
.btn{
  background-color: var(--orange);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  border: var(--darker-orange) 3px solid;
  cursor: pointer;
  display: block;
  width: max-content;
  transition: all 0.2s ease;
  box-shadow: #00000042 0px 4px 4px;
}

.btn.btn-primary{
  margin: 26px 0;
  padding: 15px;
  cursor: pointer;
  font-size: var(--font-small);
  /* font-weight: 600; */
}



.btn.btn-secondary {
  border: var(--darker-orange) 3px solid;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: var(--font-extra-small);
}

.btn:hover {
  /* background: #b5b5b5; */
  color: var(--darker-orange);
}

.btn.danger {
  background-color: var(--red-light);
  border: var(--red-bold) solid 3px;
  /* border-radius: 4px; */
  /* font-weight: 600; */
  transition: all 0.2s ease;
}

.btn.danger:hover {
  background-color: var(--red-bold);
}

@media (max-width: 576px) {
  .btn.btn-primary{
    padding: 10px;
  }
}

/* Misc */
.toggle{

}
.toggle.selected{
    /* text-decoration: underline; */
}
.hidden{
    display: none !important;
}

.general-max-width{
    max-width: 1200px;
    width: 100%;
}

.margin-auto{
  margin-left: auto !important;
  margin-right: auto !important;
}

.flex-column{

}

.p50{
  padding: 50px;
  box-sizing: border-box;
}

.p0-top{
  padding-top: 0;
}

.eggshell-background{
  background-color: var(--eggshell);
}

.white-text{
  color:  var(--white);
}

.small-header{
  font-size: var(--font-medium);
  font-weight: 600;
}

@media (max-width: 576px) {
  .p50{
    padding: 10px;
  }
}

/****** Minor Page-Specific *****/
/* Home page */
#home-hero{
  margin: auto;
  padding: 100px;
  background-size: cover;
  height: calc(100vh - 165px - 140px); /* reduce by top nav and bottom tear section */
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 450px;
}

#home-hero *{
  z-index: 2;
  position: relative;
}


@media (max-width: 576px) {
  #home-hero{
    padding: 10px;
    height: calc(100vh - 160px);
  }
}

/* Account Page */
.general-max-width.account{
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.general-max-width.account > h1 {
  flex-basis: 100%;
}
.general-max-width.account > .flex-column {
  flex: 1 1 calc(25% - 20px);
}

.reset-password-section{
  max-width: 400px;
}

.delete-account-modal-close:not(button) {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: var(--font-medium);
  cursor: pointer;
  color: #666;
  transition: color 0.2s;
}
.delete-account-modal-close:hover { 
  color: #000; 
}

.delete-account-modal {
  position: relative;
  background: #fff;
  color: #111;
  border-radius: 8px;
  padding: 1.8rem;
  max-width: 400px;
  margin: 10vh auto;
  text-align: center;
  box-shadow: 0 4px 25px rgba(0,0,0,0.4);
}

.delete-account-modal h2 {
  margin-top: 0;
  color: var(--red-bold);
}
/* Minor fix for delete modals */
.delete-account-modal,
#delete-account-modal,
#delete-account-modal-2 {
  pointer-events: all;
  z-index: 1050; /* ensure above backdrop */
}

@media (max-width: 768px) {
  .general-max-width.account > .flex-column {
    flex: 1 1 100%;
  }
}


/* FAQ Page */
.faq-div{
  margin: 15px 5px;
}

.faq-div:not(:last-child) > .border{
  width: 90%;
  height: 2px;
  background-color: var(--light-brown);
  margin-top: 15px;
  margin-left: auto;
  margin-right: auto;
}

.faq-question{
  font-weight: 600;
  font-size: var(--font-medium);
  color: var(--darker-orange);
}

.faq-answer{

}

/* Results (map + search) */
#park-list{
  display: flex;
  flex-wrap: wrap;
  column-gap: 20px;
  row-gap: 20px;
  justify-content: center;
}

.park-result-div{
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  max-width: min-content;
  gap: 1vw;
  text-align: center;
  width: 150px;
}

.park-result-div a{
  color: var(--brown);
  font-weight: 700;
}

.park-result-div img{
  max-width: 10vw;
  /* min-width: 150px; */
  border-radius: 8px;
  box-shadow: rgba(0, 0, 0, 0.267) 0px 4px 4px;
  width: 150px;
  aspect-ratio: 1/1;
  object-fit: cover;
}

@media (max-width: 768px) {
  .park-result-div img{
    min-width: 100px;
  }
}

/* Contact Page */
/* .general-max-width > .contact{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: stretch;
  gap: 10px;
} */

/* .contact .flex-column{
  margin: 0 20px;
  flex-grow: 1;
} */

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: stretch;  /* match column heights */
}

/* Left column */
.contact .flex-column.left {
  flex: 0 0 30%;
  max-width: 350px;
}

/* Right column */
.contact .flex-column.right {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
}

.contact .flex-column.right .form-group {
  flex: 1;       /* <— THIS is the missing piece */
  display: flex;
  flex-direction: column;
}

/* Stretch textarea */
.contact .flex-column.right textarea {
  flex: 1;
  min-height: 0;   /* override default */
  resize: vertical;
}

/* Mobile */
@media (max-width: 768px) {
  .contact .flex-column.left,
  .contact .flex-column.right {
    flex: 1 1 100%;
    max-width: none;
  }
}
