/* ============================================================
   TIERRA STICKERS — ESTILOS DEL CARGADOR DE FOTOS Y COMUNIDAD
   Archivo: css/upload.css
   ============================================================ */

@property --a {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes spinDegrade {
  to {
    --a: 360deg;
  }
}

:root {
  --ts-primary: #ff4d6d;
  --ts-primary-hover: #ff2a51;
  --ts-secondary: #ffb703;
  --ts-accent-cyan: #06d6a0;
  --ts-accent-purple: #8338ec;

  --bg-dark-base: #0c0a14;
  --bg-dark-card: #151122;
  --bg-dark-elevated: #1e1933;
  --bg-dark-border: rgba(255, 255, 255, 0.08);

  --text-light: #f8fafc;
  --text-light-muted: #94a3b8;

  --font-display: 'Baloo 2', cursive, sans-serif;
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-full: 9999px;

  --spring-transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.upload-page-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* HEADER */
.upload-header {
  text-align: center;
  margin-bottom: 36px;
}

.upload-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 183, 3, 0.12);
  border: 1px solid rgba(255, 183, 3, 0.35);
  color: #ffb703;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.upload-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 12px;
}

.upload-title .grad {
  background: linear-gradient(135deg, #ff4d6d, #ffb703, #06d6a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.upload-subtitle {
  color: var(--text-light-muted);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 auto;
}

/* TARJETA DEL FORMULARIO */
.upload-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--bg-dark-border);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  margin-bottom: 50px;
}

.upload-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ts-primary), var(--ts-secondary), var(--ts-accent-cyan));
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* GRUPO DE INPUT NOMBRE */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-input-wrap {
  position: relative;
}

.form-input {
  width: 100%;
  background: rgba(12, 10, 20, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 1.05rem;
  outline: none;
  transition: all 0.25s ease;
}

.form-input:focus {
  border-color: var(--ts-primary);
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.25);
  background: rgba(12, 10, 20, 0.95);
}

.form-hint {
  font-size: 0.85rem;
  color: var(--text-light-muted);
}

/* ÁREA DRAG & DROP */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-md);
  background: rgba(12, 10, 20, 0.45);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--ts-secondary);
  background: rgba(255, 183, 3, 0.06);
  transform: translateY(-2px);
}

.drop-zone input[type="file"] {
  display: none;
}

.drop-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
}

.drop-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.drop-desc {
  font-size: 0.9rem;
  color: var(--text-light-muted);
}

.drop-desc span {
  color: #ffb703;
  text-decoration: underline;
  font-weight: 700;
}

/* PREVIEW DE LA IMAGEN SELECCIONADA */
.preview-wrap {
  display: none;
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.preview-wrap.visible {
  display: block;
}

.preview-img-container {
  width: 100%;
  max-height: 320px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid rgba(255, 77, 109, 0.4);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  cursor: zoom-in;
}

.preview-img-container img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.preview-img-container:hover img {
  transform: scale(1.02);
}

.preview-zoom-hint {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(12, 10, 20, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  pointer-events: none;
  opacity: 0.9;
  transition: all 0.2s ease;
}

.preview-img-container:hover .preview-zoom-hint {
  opacity: 1;
  background: rgba(255, 77, 109, 0.9);
}

.btn-remove-preview {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 77, 109, 0.85);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 900;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
}

.btn-remove-preview:hover {
  transform: scale(1.15) rotate(90deg);
}

.preview-meta {
  margin-top: 10px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-light-muted);
  font-weight: 600;
}

/* BOTÓN DE SUBIDA CON DEGRADADO GIRATORIO */
.btn-submit-upload {
  position: relative;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--ts-primary), var(--ts-accent-purple));
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 15px clamp(20px, 4vw, 36px);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(0.95rem, 3vw, 1.2rem);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 8px 25px rgba(255, 77, 109, 0.4);
  transition: var(--spring-transition);
  z-index: 1;
  isolation: isolate;
  margin: 8px auto 0;
}

.btn-submit-upload::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-full);
  background: conic-gradient(from var(--a), #ff4d6d, #ffb703, #8338ec, #ff4d6d);
  animation: spinDegrade 3s linear infinite;
  z-index: -2;
  opacity: 0.85;
}

.btn-submit-upload::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--ts-primary), var(--ts-accent-purple));
  box-shadow: 0 0 0 2px #000000;
  z-index: -1;
}

.btn-submit-upload:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(255, 77, 109, 0.6);
}

.btn-submit-upload:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.7);
  pointer-events: none;
}

/* BARRA DE PROGRESO */
.progress-bar-wrap {
  display: none;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  height: 10px;
  overflow: hidden;
  margin-top: 14px;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff4d6d, #ffb703, #06d6a0);
  transition: width 0.2s ease;
}

/* GALERÍA DE FOTOS SUBIDAS */
.gallery-section {
  margin-top: 40px;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.gallery-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.gallery-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--bg-dark-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  outline: none;
  position: relative;
  user-select: none;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(255, 77, 109, 0.6);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), 0 0 20px rgba(255, 77, 109, 0.2);
}

.gallery-card:focus-visible {
  outline: 2px solid var(--ts-primary);
  outline-offset: 2px;
}

.gallery-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gallery-card:hover .gallery-thumb img,
.gallery-card:focus-visible .gallery-thumb img {
  transform: scale(1.07);
}

.gallery-thumb-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(12, 10, 20, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.gallery-card:hover .gallery-thumb-badge,
.gallery-card:focus-visible .gallery-thumb-badge {
  opacity: 1;
  transform: translateY(0);
}

.gallery-info {
  padding: 12px;
  font-size: 0.85rem;
}

.gallery-author-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}

.gallery-author {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffb703;
  word-break: break-word;
}

.gallery-meta {
  color: var(--text-light-muted);
  font-size: 0.8rem;
}

/* TOASTS */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1e1933;
  border: 1px solid rgba(255, 77, 109, 0.5);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: toastPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.success {
  border-color: #06d6a0;
}

.toast.error {
  border-color: #ef4444;
}

@keyframes toastPop {
  0% {
    transform: scale(0.6) translateY(20px);
    opacity: 0;
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* ============================================================
   MODAL DE FOTO COMUNITARIA EN TAMAÑO COMPLETO
   ============================================================ */
.ts-community-photo-modal {
  max-width: 680px;
  width: 95vw;
}

.ts-photo-modal-header {
  justify-content: flex-start;
  text-align: left;
  padding: 16px 20px;
}

.ts-photo-modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  letter-spacing: 0.3px;
  text-align: left;
}

.ts-photo-modal-pedestal {
  background: #090710 radial-gradient(circle at center, rgba(255, 77, 109, 0.08) 0%, rgba(12, 10, 20, 0.96) 75%) !important;
  background-image: none !important;
  min-height: 280px;
  max-height: 64vh;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.ts-photo-modal-pedestal img {
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.75);
  filter: none !important;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.ts-photo-modal-pedestal img:hover {
  transform: scale(1.02);
}

.ts-photo-modal-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ts-photo-meta-title {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: #fff;
}

.ts-photo-meta-title strong {
  color: var(--ts-secondary);
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.ts-photo-meta-sub {
  font-size: 0.8rem;
  color: var(--text-light-muted);
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .ts-photo-modal-pedestal img,
  .drop-zone,
  .btn-submit-upload {
    transition: none;
    animation: none;
  }
}

