@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Source+Sans+3:wght@400;600&display=swap');

:root {
  --azul: #003399;
  --celeste: #74ACDF;
  --blanco: #FFFFFF;
  --dorado: #D4A017;
  --naranja: #E87722;
  --gris: #f4f4f4;
  --gris-oscuro: #555;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--gris);
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
header {
  background: var(--azul);
  color: var(--blanco);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1000;
}

.logo-escudo {
  width: 52px;
  height: 52px;
  background: var(--celeste);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  border: 3px solid var(--blanco);
  flex-shrink: 0;
}

header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  line-height: 1.2;
}

header p {
  font-size: 0.78rem;
  color: var(--celeste);
  margin-top: 2px;
}

.header-right {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  font-size: 0.73rem;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}
.badge:hover { background: rgba(255,255,255,0.25); }
.badge.editor-active { background: var(--dorado); border-color: var(--dorado); color: #000; }

/* STATS BAR */
.stats-bar {
  background: var(--celeste);
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 8px 20px;
}
.stat {
  text-align: center;
  color: var(--azul);
  font-weight: 600;
}
.stat span {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
}
.stat small {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* MAIN LAYOUT */
.main-wrap {
  display: flex;
  flex: 1;
  height: calc(100vh - 120px);
}

/* SIDEBAR */
.sidebar {
  width: 340px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 2px solid var(--celeste);
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}
.tab-btn {
  flex: 1;
  padding: 10px 6px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gris-oscuro);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tab-btn.active {
  color: var(--azul);
  border-bottom-color: var(--azul);
}

.tab-panel { display: none; padding: 16px; }
.tab-panel.active { display: block; }

/* UPLOAD FORM */
.form-section h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gris-oscuro);
  margin: 14px 0 6px;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
}

.drop-zone {
  border: 2px dashed var(--celeste);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.drop-zone:hover, .drop-zone.over {
  border-color: var(--azul);
  background: #f0f5ff;
}
.drop-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.drop-zone .icon { font-size: 2rem; margin-bottom: 6px; }
.drop-zone p { font-size: 0.8rem; color: var(--gris-oscuro); }
.drop-zone img {
  max-width: 100%; max-height: 120px; border-radius: 6px; display: none; margin: 0 auto;
}

.form-group { margin-bottom: 10px; }
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 3px;
  color: #333;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--azul);
}

.loc-btn {
  width: 100%;
  padding: 9px;
  border: 2px dashed var(--celeste);
  background: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--azul);
  font-weight: 600;
  transition: all 0.2s;
  font-family: 'Source Sans 3', sans-serif;
}
.loc-btn:hover { background: #f0f5ff; }
.loc-btn.selecting { background: #fff3e0; border-color: var(--naranja); color: var(--naranja); animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.loc-info {
  font-size: 0.75rem;
  color: var(--gris-oscuro);
  margin-top: 4px;
}

.submit-btn {
  width: 100%;
  padding: 11px;
  background: var(--azul);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  margin-top: 14px;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.03em;
}
.submit-btn:hover { background: #002277; transform: translateY(-1px); }
.submit-btn:disabled { background: #aaa; cursor: not-allowed; transform: none; }

.msg { padding: 8px 12px; border-radius: 6px; font-size: 0.82rem; margin-top: 10px; display: none; }
.msg.ok { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.msg.err { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

/* GALLERY */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 1;
  background: #eee;
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item .overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,30,0.75));
  color: white;
  padding: 6px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery-item:hover .overlay { opacity: 1; }
.empty-gallery {
  text-align: center; color: var(--gris-oscuro); padding: 30px 10px; font-size: 0.85rem;
}

/* EDITOR PANEL */
.editor-panel { padding: 0; }
.editor-login { padding: 20px; }
.editor-login h3 { margin-bottom: 12px; color: var(--azul); }
.editor-items { padding: 12px; }
.pending-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}
.pending-card img {
  width: 100%; height: 140px; object-fit: cover;
}
.pending-card .card-body { padding: 10px 12px; }
.pending-card .card-body h4 { font-size: 0.88rem; margin-bottom: 4px; }
.pending-card .card-body p { font-size: 0.75rem; color: var(--gris-oscuro); }
.card-actions { display: flex; gap: 8px; padding: 8px 12px; border-top: 1px solid #eee; }
.btn-approve {
  flex: 1; padding: 7px; border: none; border-radius: 6px;
  background: #2e7d32; color: white; cursor: pointer; font-size: 0.8rem; font-weight: 600; font-family: 'Source Sans 3', sans-serif;
}
.btn-reject {
  flex: 1; padding: 7px; border: none; border-radius: 6px;
  background: #c62828; color: white; cursor: pointer; font-size: 0.8rem; font-weight: 600; font-family: 'Source Sans 3', sans-serif;
}
.btn-edit {
  padding: 7px 12px; border: 1px solid #999; border-radius: 6px;
  background: none; cursor: pointer; font-size: 0.8rem; font-family: 'Source Sans 3', sans-serif;
}

/* MAP */
#map {
  flex: 1;
  z-index: 1;
}

/* Custom cursor when selecting location */
#map.selecting-location { cursor: crosshair !important; }

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,40,0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { transform: scale(0.93) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal img {
  width: 100%; max-height: 280px; object-fit: cover;
}
.modal-body { padding: 18px 20px; }
.modal-body h2 { font-family: 'Playfair Display', serif; font-size: 1.2rem; margin-bottom: 8px; color: var(--azul); }
.modal-meta { font-size: 0.8rem; color: var(--gris-oscuro); margin-bottom: 8px; }
.modal-meta span { margin-right: 14px; }
.modal-desc { font-size: 0.88rem; line-height: 1.5; }
.modal-close {
  display: block; margin: 14px 20px 16px auto;
  padding: 8px 20px;
  border: 1px solid var(--azul); color: var(--azul);
  background: none; border-radius: 6px; cursor: pointer;
  font-size: 0.85rem; font-family: 'Source Sans 3', sans-serif; font-weight: 600;
}

/* EDIT MODAL */
.edit-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,40,0.7);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.edit-modal-overlay.open { display: flex; }
.edit-modal {
  background: white;
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.edit-modal h3 { margin-bottom: 14px; color: var(--azul); }
.edit-modal-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ANTARTIDA LABEL custom */
.leaflet-antartida-label {
  background: rgba(0,51,153,0.85);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}
/* AUTH SECTION */
#auth-section {
  padding: 10px 0;
}
#auth-section a {
  color: var(--azul);
  text-decoration: none;
  font-weight: 600;
}
#auth-section a:hover {
  text-decoration: underline;
}

#logoutBtn {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}
#logoutBtn:hover {
  background: #c62828;
  border-color: #c62828;
}
