@import url(fontawesome-all.min.css);
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/*
  Restyled for modern, smooth boxed layout with blue color palette (bird theme), smooth buttons, boxed cards, and shadowed content.
  Applied site-wide to all main/section content.
*/
html, body {
  height: 100%;
  background: #f3f5f9 no-repeat fixed;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  line-height: 1.6;
  color: #1f2937;
  -webkit-text-size-adjust: 100%;
}

#wrapper {
  max-width: 1024px;
  margin: 48px auto 24px auto;
  padding: 32px 32px 34px 32px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(2, 8, 20, 0.06);
}

header#header {
  margin-bottom: 28px;
}
.logo {
  color: #0f172a!important;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 0.01em;
  text-shadow: none;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  align-items: stretch;
  border-bottom: 0;
  margin-bottom: 2.2em;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: none;
  padding: 0.4em;
}
.tab {
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 12rem;
  padding: 0.75em 1.3em;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.09em;
  letter-spacing: 0.01em;
  background: transparent;
  color: #334155;
  border: none;
  transition: background 0.19s, color 0.19s;
  border-radius: 8px;
  border-bottom: 2px solid transparent;
  line-height: 1.2;
  text-align: center;
}
.tab.active {
  background: #ffffff;
  color: #0f172a;
  border-bottom: 2px solid #2563eb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  z-index: 2;
}
.tab:not(.active):hover {
  background: #f1f5f9;
}
.tab:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.tabcontent {
  display: none;
  padding: 0 6px 2rem 6px;
}
.tabcontent.active {
  display: block;
}

#main {
  margin-bottom: 24px;
}

section.post {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
  padding: 34px 24px 28px 24px;
}

.post header.major {
  margin-bottom: 1.2em;
}

h1, h2, h3, h4 {
  color: #0f172a;
  margin-top: 0.1em;
  margin-bottom: 0.5em;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
}
h1 {
  font-size: 2.25rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.1rem;
}
h4 {
  font-size: 1.0rem;
}

/* Upload Form Styling */
#uploadForm, form#uploadForm {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: none;
  padding: 34px 24px 22px 24px;
  max-width: 475px;
  margin: 0 auto 1rem auto;
  border: 1px solid #e5e7eb;
}
#uploadForm label {
  font-weight: 600;
  color: #0f172a;
  font-size: 1.04em;
}
#uploadForm input, #uploadForm select, #uploadForm button {
  border-radius: 8px;
  outline: none;
  border: 1px solid #cbd5e1;
  font-size: 1em;
  min-height: 2.3em;
  padding: 0.38em 0.9em;
  margin-top: 2.5px;
  margin-bottom: 10px;
  background: #fff;
  transition: border 0.18s, box-shadow 0.16s, background 0.17s;
  width: 100%;
  max-width: 100%;
}
#uploadForm input:focus, #uploadForm select:focus {
  border: 1px solid #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
#uploadForm button {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #1d4ed8;
  font-weight: 600;
  padding: 0.65em 1.7em;
  cursor: pointer;
  margin-top: 0.5em;
  box-shadow: none;
  transition: background 0.21s;
  display: block;
}
#uploadForm button:hover {
  background: #1d4ed8;
  color: #fff;
}
#uploadMsg {
  padding-top: 0.8em;
  font-weight: 600;
  color: #166534; /* Success is green; errors are set inline */
}
#uploadMsg span[style*="color:red"] {
  color: #d32f2f!important;
}

/* Tab, Icon & Social List Styling */
#nav ul.icons {
  margin-top: 0.3em;
}
#nav ul.icons li {
  display: inline-block;
  margin-right: 1.1em;
}
#nav ul.icons a {
  color: #4a6988;
  font-size: 1.2em;
  transition: color 0.16s;
}
#nav ul.icons a:hover { color: #1565c0; }
#navPanelToggle.hidden { display: none !important; }
#nav.keep-visible-on-mobile {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e2e8f0;
  backdrop-filter: blur(4px);
  border-radius: 12px;
}

/* Map adapts to white box */
#map {
  width: 100%;
  min-height: clamp(20rem, 55vh, 31.25rem);
  box-shadow: none;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  margin-bottom: 1.9em;
  overflow: hidden;
}
.legend {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  max-width: min(16rem, calc(100vw - 3rem));
}
.legend .dot {
  border: 1px solid #2563eb;
}

.site-login-overlay {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.96);
}

.site-login-card {
  width: min(100%, 26rem);
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 25px rgba(2, 8, 20, 0.08);
}

.site-login-input {
  width: 100%;
  margin: 0 0 0.75rem 0;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
}

.site-login-button {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid #1d4ed8;
  border-radius: 0.65rem;
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
}

.site-login-message {
  color: darkred;
  margin-top: 1rem;
}
.popup-content {
  min-width: 180px;
}
.popup-action {
  display: inline-block;
  margin-top: 0.5em;
  margin-right: 0.35em;
  border: 0;
  border-radius: 8px;
  padding: 0.35em 0.7em;
  font-size: 0.92em;
  font-weight: 700;
  text-decoration: none;
  background: #1976D2;
  color: #fff !important;
}
.popup-action.secondary {
  background: #e3f1ff;
  color: #124e8c !important;
}
.drive-folder-link {
  margin-top: 0.65em;
}

/* Footer and Copyright */
#footer {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0 0 1.2em 0;
  margin-top: 36px;
}
#copyright {
  color: #64748b;
  letter-spacing: 0.01em;
  font-size: 0.95em;
  background: none;
  text-align: center;
  margin-top: 0.8em;
}
#copyright ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  flex-wrap: wrap;
}
#copyright li {
  display: inline;
}
#copyright li + li::before {
  content: "|";
  margin-right: 0.35em;
  color: #94a3b8;
}

/* Cards in generic/elements.html (and featured boxes) */
section.post, .box {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

/* Typography Tweaks */
p, label, input, select, option, textarea {
  font-size: 1.07em;
}
a, a:visited {
  color: #1d4ed8;
  border-bottom: none;
}
a:hover {
  color: #1e40af;
  border-bottom: none;
}

/* Responsive: keep boxed, but pad less on mobile */
@media(max-width:670px) {
  #nav.keep-visible-on-mobile {
    top: max(0px, env(safe-area-inset-top));
    margin-bottom: 1rem;
  }
  #wrapper {
    margin: 20px 12px;
    padding: 16px;
  }
  section.post,
  #uploadForm {
    padding: 18px 14px;
  }
  .tabs {
    gap: 0.4em;
    margin-bottom: 1.4em;
    padding: 0.3em;
  }
  .tab {
    flex: 1 1 0%;
    min-width: 0;
    padding: 0.7em 0.7em !important;
    font-size: 0.98em;
  }
  .tabcontent {
    padding: 0 0 1.25rem 0;
  }
  h1 {
    font-size: 1.85rem;
  }
  p,
  label,
  input,
  select,
  option,
  textarea {
    font-size: 1rem;
  }
}
@media(max-width:500px){
  #wrapper {
    margin: 12px 8px;
    padding: 12px;
    border-radius: 16px;
  }
  section.post {
    padding: 16px 12px;
  }
  #map {
    min-height: 18rem;
  }
  .legend {
    font-size: 10px;
    line-height: 1.55;
  }
  .site-login-card {
    padding: 1.2rem;
  }
}
@media(max-width:400px){
  #wrapper { margin: 8px 4px; padding: 10px 8px; }
  .tab { font-size: 0.98em; }
  #uploadForm { padding: 14px 10px; }
}
