/* ===================================================
   GIO'S GALAXY — DucksFound Styles
   =================================================== */

/* Force [hidden] to actually hide regardless of display rules */
[hidden] {
  display: none !important;
}

/* ===================================================
   HOMEPAGE SECTION
   =================================================== */
.ducks {
  background: var(--deep-black);
  padding: 4rem 1.25rem 5rem;
  border-top: 1px solid rgba(255, 107, 0, 0.12);
}

.ducks__container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.ducks__heading {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 3vw, 1.5rem);
  background: linear-gradient(135deg, var(--neon-orange), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ducks__counter {
  font-family: var(--font-display);
  font-size: clamp(1rem, 4vw, 2rem);
  color: var(--yellow-glow);
  text-shadow: 0 0 18px rgba(255, 215, 0, 0.4);
  margin-top: 0.5rem;
}

.ducks__counter #duckCount {
  display: inline-block;
  min-width: 1.5em;
}

.ducks__subtitle {
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.ducks__feed {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
  margin-top: 0.5rem;
}

.ducks__empty {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 2rem 1rem;
  text-align: center;
  border: 1px dashed rgba(255, 107, 0, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

/* --- DUCK CARD --- */
.duck-card {
  display: flex;
  flex-direction: column;
  background: var(--dark-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.25s var(--ease-out-expo), border-color 0.25s ease, box-shadow 0.25s ease;
  animation: duckCardIn 0.5s var(--ease-out-expo) both;
}

@keyframes duckCardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.duck-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 107, 0, 0.4);
  box-shadow: 0 8px 24px rgba(255, 107, 0, 0.12);
}

.duck-card__photo-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #000;
}

.duck-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.duck-card__body {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}

.duck-card__user {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.duck-card__location {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.duck-card__time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.15rem;
}

/* --- DUCK CARD CLICKABLE --- */
.duck-card {
  cursor: pointer;
}

.duck-card:focus-visible {
  outline: 2px solid var(--yellow-glow);
  outline-offset: 2px;
}

/* Custom map pin */
.duck-pin {
  background: transparent;
  border: none;
}

.duck-pin__dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--neon-orange);
  border: 2px solid #fff;
  box-shadow: 0 0 12px rgba(255, 107, 0, 0.8), 0 0 4px rgba(0, 0, 0, 0.6);
  animation: pinPulse 2s ease-in-out infinite;
}

@keyframes pinPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 107, 0, 0.8), 0 0 4px rgba(0, 0, 0, 0.6); }
  50%      { box-shadow: 0 0 20px rgba(255, 107, 0, 1), 0 0 4px rgba(0, 0, 0, 0.6); }
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
  background: var(--dark-surface) !important;
  color: var(--text-primary) !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 107, 0, 0.3);
}

.leaflet-popup-tip {
  background: var(--dark-surface) !important;
}

.leaflet-popup-content {
  margin: 10px 12px !important;
  font-family: var(--font-body) !important;
  font-size: 0.85rem !important;
}

.duck-popup {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}

.duck-popup img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
}

.duck-popup span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ===================================================
   FOUND.HTML PAGE
   =================================================== */
.found-body {
  background: var(--deep-black);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1.25rem 4rem;
}

.found {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.found__logo {
  width: clamp(80px, 18vw, 120px);
  height: auto;
  filter: drop-shadow(0 0 16px rgba(123, 47, 190, 0.6));
}

.found__heading {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 4vw, 1.4rem);
  background: linear-gradient(135deg, var(--neon-orange), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.4;
}

.found__subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* --- FORM --- */
.found__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--dark-surface);
  padding: 1.5rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 107, 0, 0.15);
  text-align: left;
  margin-top: 0.5rem;
}

.found__label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.found__label em {
  font-style: normal;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
}

.found__label input[type="text"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.found__label input[type="text"]:focus {
  outline: none;
  border-color: var(--neon-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}

.found__label input[type="file"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
}

.found__label input[type="file"]:focus {
  outline: 2px solid var(--yellow-glow);
  outline-offset: 2px;
}

.found__location-btn {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.found__location-btn:hover:not(:disabled) {
  border-color: var(--neon-orange);
  background: rgba(255, 107, 0, 0.08);
}

.found__location-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.found__location-status {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-height: 1.2em;
}

.found__location-status--success {
  color: #4ade80;
}

.found__location-status--error {
  color: #f87171;
}

.found__preview {
  min-height: 0;
}

.found__preview img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.found__submit {
  margin-top: 0.5rem;
  width: 100%;
  justify-content: center;
}

.found__submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.found__msg {
  font-size: 0.85rem;
  color: #f87171;
  text-align: center;
  min-height: 1.2em;
}

/* --- SUCCESS STATE --- */
.found__success {
  width: 100%;
  background: var(--dark-surface);
  padding: 2rem 1.5rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 107, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
  animation: duckCardIn 0.5s var(--ease-out-expo) both;
}

.found__success-heading {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 3.5vw, 1.3rem);
  background: linear-gradient(135deg, var(--neon-orange), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.4;
}

.found__success p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.found__success-btn {
  margin-top: 0.5rem;
}

/* ===================================================
   LOCATION PREVIEW MAP (on found.html)
   =================================================== */
.found__preview-map {
  width: 100%;
  height: 180px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 107, 0, 0.2);
  background: #0a0a18;
  margin-top: 0.25rem;
}

/* ===================================================
   DUCK DETAIL MODAL (on homepage)
   =================================================== */
.duck-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 1.5rem 1rem;
  overflow-y: auto;
  animation: duckModalFade 0.25s ease-out;
}

.duck-modal.active {
  display: flex;
}

@keyframes duckModalFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.duck-modal__panel {
  position: relative;
  width: 100%;
  max-width: 540px;
  background: var(--dark-surface);
  border: 1px solid rgba(255, 107, 0, 0.2);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: auto 0;
  animation: duckModalSlide 0.35s var(--ease-out-expo);
}

@keyframes duckModalSlide {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.duck-modal__close {
  position: absolute;
  top: 0.6rem;
  right: 0.85rem;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: var(--text-primary);
  font-size: 1.6rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.duck-modal__close:hover {
  background: var(--neon-orange);
  color: #fff;
}

.duck-modal__close:focus-visible {
  outline: 2px solid var(--yellow-glow);
  outline-offset: 2px;
}

.duck-modal__photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #000;
}

.duck-modal__body {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.duck-modal__user {
  font-family: var(--font-display);
  font-size: 0.95rem;
  background: linear-gradient(135deg, var(--neon-orange), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  word-break: break-word;
}

.duck-modal__location {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.duck-modal__time {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

.duck-modal__map {
  width: 100%;
  height: 240px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 107, 0, 0.18);
  background: #0a0a18;
  margin-top: 0.25rem;
}

.duck-modal__no-map {
  width: 100%;
  padding: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  margin-top: 0.25rem;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (min-width: 600px) {
  .ducks__feed {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .ducks {
    padding: 6rem 2rem 7rem;
  }

  .ducks__feed {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .duck-modal__map {
    height: 320px;
  }

  .found__form {
    padding: 2rem 1.75rem;
  }
}

@media (min-width: 1200px) {
  .ducks__feed {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  .duck-card,
  .found__success {
    animation: none;
  }
  .duck-pin__dot {
    animation: none;
  }
}
