/* ================= GLOBAL ================= */

html, body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  background-color: #121212;
  /* background: linear-gradient(135deg, #387c3f 0%, #1a1a1a 50%, #0a0a0a 100%); */
  color: #e0e0e0;
  padding: 0;
}

body {
  max-width: 100%;
  width: 95%;
  margin: 0 auto;
}


/* ================= TOP BAR ================= */

/* Desktop: 3-column layout (same as before) */
#top-panel-wrapper {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px;
  background-color: #1f1f1f;
}

#top-panel-wrapper > header {
  grid-column: 2; /* Centered title */
  text-align: center;
}

#top-panel-wrapper > #top-controls {
  grid-column: 1 / span 3; /* Full width for controls */
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

#top-panel {
  text-align: left;
}


#auth-section {
  text-align: right;
}

header {
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 3rem;
  color: #ffd700;
}

header h1 a,
.auth-container h1 a {
  color: inherit;
  text-decoration: none;
}

.header-tagline {
  margin: 2px 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #888;
}

.header-tagline span {
  color: #ffd700;
  margin: 0 3px;
}


/* #auth-section a {
  color: #4caf50;
  text-decoration: none;
} */

#auth-section a {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: filter 0.2s ease;
}

#auth-section a:hover {
  filter: brightness(1.15);
}

.profile-link {
  background: #4caf50;
  color: #fff !important;
}

.logout-link {
  background: #e53935;
  color: #fff !important;
}


.login-link {
  background: #4C16DC;
  color: #fff !important;
}

.register-link {
  background: #1565c0;
  color: #fff !important;
}
/* ================= AUTH CONTAINER (login/register) ================= */
.auth-container {
    width: 350px;
    margin: 60px auto;
    padding: 25px;
    background-color: #1f1f1f;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    color: #eee;
    text-align: center;
}

.auth-container h1 {
    margin-bottom: 20px;
    font-size: 2.5rem;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.auth-container h2 {
    margin-bottom: 15px;
}

.auth-container label {
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    text-align: left;
}

.auth-container input {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #444;
    background-color: #2a2a2a;
    color: #eee;
    box-sizing: border-box;
}

.auth-container button {
    margin-top: 15px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #4caf50;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.auth-container button:hover {
    background-color: #45a049;
}

.auth-container a {
    color: #a78bfa;
    text-decoration: none;
}

.auth-container a:hover {
    text-decoration: underline;
}




/* .logout-link {
  color: #ff4444;
} */

/* ================= BUTTONS ================= */

#file {
  display: none;
}

#upload-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

#total-sightings {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  line-height: 1.3;
}

#total-sightings strong {
  font-size: 1.1rem;
  color: #ffd700;
  letter-spacing: 0;
}

.custom-file-btn {
  padding: 10px 16px;
  border-radius: 6px;
  background-color: #4caf50;
  color: white;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
}

.custom-file-btn:hover {
  background-color: #66bb6a;
}
#file-name {
    margin-top: 12px; /* space below the Upload & Predict button */
    font-style: italic;
    color: #eee;
}


/* ================= PREDICTION ================= */

#prediction {
  font-weight: bold;
  font-size: 1.1rem;
}

.prediction-loading { color: #ff9800; }
.prediction-success { color: #ffd700; }
.prediction-error { color: #f44336; }

/* ================= MAIN GRID ================= */

#main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  min-height: 65vh;
}

#map {
  height: 100%;
}

#info-panel {
  background: #161616;
  padding: 20px;
  border-left: 1px solid #2a2a2a;
}

.preview {
  width: 100%;
  max-height: 450px;
  object-fit: contain;
  border-radius: 10px;
}

.latin-name {
  margin: -10px 0 8px;
  color: #888;
  font-size: 0.85rem;
}

/* ================= FOOTER ================= */

footer {
  text-align: center;
  padding: 16px;
  font-size: 0.9rem;
  color: #aaa;
  background: #1f1f1f;
}



/* ================= FILMSTRIP ================= */

#filmstrip-label {
  padding: 10px 16px 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
}

#filmstrip-wrapper:active {
  cursor: grabbing;
}


#filmstrip-wrapper {
  background: #1a1a1a;
  border-top: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
  padding: 0;
  overflow: hidden;
}

#filmstrip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  padding: 12px 16px;
}


.film-card {
  display: flex;
  flex-direction: column;
  width: 120px;
  background: #242424;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.film-card:hover {
  transform: translateY(-3px);
  border-color: #ffd700;
}

.film-img-wrap {
  width: 100%;
  height: 90px;
  overflow: hidden;
  background: #111;
}

.film-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film-info {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.film-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffd700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.film-user {
  font-size: 0.68rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ================= ABOUT PAGE ================= */

.about-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px;
}

.about-hero {
  text-align: center;
  margin-bottom: 48px;
}

.about-hero-emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 12px;
}

.about-hero h2 {
  font-size: 2.4rem;
  color: #ffd700;
  margin: 0 0 10px;
}

.about-subtitle {
  color: #888;
  font-size: 1.1rem;
  margin: 0;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.about-card {
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.about-card:hover {
  border-color: #ffd700;
  transform: translateY(-2px);
}

.about-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.about-card h3 {
  color: #ffd700;
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.about-card p {
  color: #aaa;
  line-height: 1.7;
  margin: 0;
  font-size: 0.95rem;
}

.about-footer-cta {
  text-align: center;
}

.about-footer-cta p {
  color: #888;
  margin-bottom: 16px;
}

.about-cta-btn {
  display: inline-block;
  padding: 12px 28px;
  background: #4C16DC;
  color: #fff;
  border-radius: 24px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s ease;
}

.about-cta-btn:hover {
  background: #3b0fb8;
}

.about-link {
  background: #2a2a2a;
  color: #e0e0e0 !important;
  border: 1px solid #444;
}

.about-link:hover {
  background: #333;
}



/* ================= MOBILE ================= */

@media (max-width: 900px) {

  body {
    width: 100%;
  }

  /* Top wrapper: stack vertically, centred */
  #top-panel-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    text-align: center;
  }

  /* Order: title → upload controls → auth links */
  #top-panel-wrapper header  { order: 1; }
  #top-panel-wrapper #top-panel { order: 2; width: 100%; text-align: center; }
  #top-panel-wrapper #auth-section { order: 3; }

  header h1 {
    font-size: 1.8rem;
  }

  /* Centre the upload button + sightings count */
  #upload-row {
    justify-content: center;
  }

  /* Auth links: wrap onto multiple lines if needed */
  #auth-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    text-align: center;
  }

  #file-name,
  #prediction {
    text-align: center;
  }

  /* Main content: map on top, info panel below */
  #main {
    grid-template-columns: 1fr;
  }

  #map {
    height: 45vh;
    margin: 0 12px;
    border-radius: 8px;
  }

  #info-panel {
    border-left: none;
    border-top: 1px solid #2a2a2a;
    padding: 14px;
  }

  #info-panel img.preview {
    display: block;
    margin: 0 auto;
    max-height: 220px;
    width: auto;
  }

  /* Filmstrip: narrower cards fit more on screen */
  .film-card {
    width: auto;
  }

  #filmstrip {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    padding: 10px 12px;
  }

  footer {
    font-size: 0.75rem;
    padding: 12px;
  }

  /* About page */
  .about-wrapper {
    padding: 28px 16px;
  }

  .about-hero h2 {
    font-size: 1.7rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  /* Auth pages: full-width card with comfortable spacing */
  .auth-container {
    width: auto;
    margin: 24px 16px;
    padding: 24px 20px;
  }

  .auth-container input {
    font-size: 1rem;
    padding: 12px 10px;
  }

  .auth-container button {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
  }

}



.auth-error {
    background: #2a1515;
    color: #f44336;
    border: 1px solid #5c2020;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 14px;
}

.auth-success {
    background: #152a1a;
    color: #4caf50;
    border: 1px solid #1e5c28;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 14px;
}

.auth-hint {
    color: #888;
    font-size: 14px;
    margin-bottom: 16px;
}
 
.auth-link {
    margin-top: 12px;
    font-size: 14px;
    text-align: center;
}
 

/* ───── Dark map theme + custom mushroom pins ───── */

/* Map container — green-tinted dark background shows during tile load */

.leaflet-tile-pane {
  filter: brightness(1.0) saturate(1.2);
}

.leaflet-control-attribution {
  background: rgba(31, 31, 31, 0.85) !important;
  color: #aaa !important;
}
.leaflet-control-attribution a {
  color: #ffd700 !important;
}
.leaflet-bar a,
.leaflet-bar a:hover {
  background: #1f1f1f !important;
  color: #ffd700 !important;
  border-color: #2a2a2a !important;
}

.leaflet-popup-content-wrapper {
  background: #1f1f1f;
  color: #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}
.leaflet-popup-content-wrapper strong {
  color: #ffd700;
}
.leaflet-popup-tip {
  background: #1f1f1f;
}

/* ───── Individual markers ───── */
.myc-marker {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffd700;
  border: 3px solid #b89800;
  box-shadow: 0 2px 8px rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
}

/* ───── Marker clusters ───── */
.myc-cluster {
  background: transparent;
}
.myc-cluster-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffd700;
  border: 3px solid #b89800;
  box-shadow: 0 2px 8px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.myc-cluster-inner span {
  font-size: 16px;
  line-height: 1;
}
.myc-cluster-inner strong {
  font-size: 11px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1;
}
