/* ==========================================================
   ÁLBUM FAMILIAR PRIVADO - SISTEMA DE DISEÑO Y ESTILOS MODERNOS
   ========================================================== */

:root {
  --bg-main: #090d16;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-card-hover: rgba(28, 38, 58, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(245, 158, 11, 0.5);

  --accent-gold: #f59e0b;
  --accent-gold-hover: #d97706;
  --accent-gold-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 60%, #d97706 100%);
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-indigo: #6366f1;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.25);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Scrollbar estilizado */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

.hidden {
  display: none !important;
}

html.is-authenticated #lockScreen {
  display: none !important;
}

html.is-authenticated #appContainer {
  display: flex !important;
}

/* ==========================================================
   1. PANTALLA DE BLOQUEO POR PIN (LOCK SCREEN)
   ========================================================== */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #151d30 0%, #070a12 100%);
  padding: 20px;
  overflow: hidden;
}

.lock-bg-glow {
  position: absolute;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
  top: 15%;
  left: 50%;
  transform: translate(-50%, -30%);
  filter: blur(40px);
  pointer-events: none;
  animation: pulseGlow 6s ease-in-out infinite alternate;
}

.lock-bg-glow.secondary {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  top: 60%;
  left: 45%;
  animation: pulseGlow 7s ease-in-out infinite alternate-reverse;
}

@keyframes pulseGlow {
  0% { transform: translate(-50%, -30%) scale(0.95); opacity: 0.6; }
  100% { transform: translate(-50%, -30%) scale(1.15); opacity: 0.9; }
}

.lock-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lock-icon-badge {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  margin-bottom: 16px;
  box-shadow: var(--shadow-glow);
}

.lock-svg {
  width: 28px;
  height: 28px;
}

.lock-title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  background: linear-gradient(180deg, #ffffff 30%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lock-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 280px;
  line-height: 1.4;
}

/* Indicadores de PIN */
.pin-dots-container {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 18px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pin-dot.filled {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.pin-error-msg {
  height: 20px;
  font-size: 0.84rem;
  color: var(--accent-rose);
  font-weight: 500;
  margin-bottom: 8px;
}

.pin-error-msg.visible {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Teclado Táctil */
.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 290px;
  margin-bottom: 20px;
}

.keypad-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 1.45rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.keypad-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.keypad-btn:active {
  transform: scale(0.92);
  background: rgba(245, 158, 11, 0.25);
  border-color: var(--accent-gold);
}

.keypad-btn.func-btn {
  font-size: 1.15rem;
  color: var(--text-secondary);
}

.keypad-btn.func-btn:active {
  color: var(--text-primary);
}

.lock-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary);
}

.checkbox-label input {
  accent-color: var(--accent-gold);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.pin-hint-tag {
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ==========================================================
   2. BARRA DE NAVEGACIÓN SUPERIOR
   ========================================================== */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 90px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b0f17;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 0.74rem;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.storage-stats-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--accent-gold);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Botones de acción */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-normal);
  user-select: none;
}

.action-btn.primary {
  background: var(--accent-gold-gradient);
  color: #0b0f17;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.action-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.action-btn.primary:active {
  transform: translateY(1px);
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-glass);
  color: var(--text-primary);
}

.action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}

.action-btn.secondary.active-mode {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.action-btn.icon-only {
  padding: 9px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-glass);
  color: var(--text-secondary);
}

.action-btn.icon-only:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.action-btn.icon-only.danger:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.action-btn svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================
   3. BARRA DE HERRAMIENTAS Y FILTROS
   ========================================================== */
.toolbar-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
  gap: 4px;
}

.pill-btn {
  background: transparent;
  border: none;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.pill-btn:hover {
  color: var(--text-primary);
}

.pill-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 600;
}

.pill-count {
  font-size: 0.74rem;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.pill-btn.active .pill-count {
  background: var(--accent-gold);
  color: #0b0f17;
  font-weight: 700;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 380px;
  min-width: 220px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 8px 36px 8px 38px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.07);
}

.btn-clear-search {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.btn-clear-search:hover {
  color: var(--text-primary);
}

.view-toggles {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toggle-icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-icon-btn svg {
  width: 20px;
  height: 20px;
}

.toggle-icon-btn:hover {
  color: var(--text-primary);
}

.toggle-icon-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-gold);
  border-color: var(--border-glass);
}

/* ==========================================================
   4. CUADRÍCULA DE FOTOS Y VIDEOS (GALLERY GRID)
   ========================================================== */
.gallery-wrapper {
  padding: 8px 24px 40px;
  flex: 1;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  transition: all var(--transition-normal);
}

.gallery-grid.dense {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.media-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  aspect-ratio: 4 / 3;
}

.media-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-md);
}

.media-card.selected {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px var(--accent-gold), 0 8px 20px rgba(245, 158, 11, 0.2);
}

.media-thumb-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #0f1623;
}

.media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.media-card:hover .media-thumb {
  transform: scale(1.05);
}

/* Insignia de Video */
.video-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-play-icon {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* Checkbox circular de selección en esquina */
.select-checkbox-container {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 6;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.select-checkbox {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.media-card.selected .select-checkbox {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.select-checkbox svg {
  width: 13px;
  height: 13px;
  stroke: #0b0f17;
  stroke-width: 3;
  opacity: 0;
  transform: scale(0.6);
  transition: all var(--transition-bounce);
}

.media-card.selected .select-checkbox svg {
  opacity: 1;
  transform: scale(1);
}

/* Botón de Descarga Rápida Individual */
.quick-download-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 6;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: all var(--transition-fast);
}

.quick-download-btn:hover {
  opacity: 1;
  background: var(--accent-gold);
  color: #0b0f17;
  border-color: var(--accent-gold);
  transform: scale(1.1);
}

.quick-download-btn svg {
  width: 16px;
  height: 16px;
}

/* Pie de tarjeta con info */
.media-card-meta {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(9, 13, 22, 0.85) 100%);
  padding: 24px 12px 10px;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.media-filename {
  font-size: 0.78rem;
  font-weight: 500;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75%;
}

.media-size {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Estado Vacío */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

/* ==========================================================
   5. BARRA FLOTANTE DE ACCIONES (SELECCIÓN MÚLTIPLE)
   ========================================================== */
.selection-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  z-index: 100;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-xl);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: calc(100% - 32px);
  max-width: 620px;
  transition: transform var(--transition-bounce);
}

.selection-bar.active {
  transform: translateX(-50%) translateY(0);
}

.selection-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selection-badge {
  background: var(--accent-gold-gradient);
  color: #0b0f17;
  font-weight: 700;
  font-size: 0.9rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.selection-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.selection-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.selection-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-subtle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.btn-subtle:hover {
  color: var(--text-primary);
}

.btn-download-zip {
  background: var(--accent-gold-gradient);
  border: none;
  color: #0b0f17;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-download-zip:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

.btn-download-zip:active {
  transform: scale(0.97);
}

.btn-download-zip svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================
   6. VISOR LIGHTBOX OPTIMIZADO PARA MÓVILES
   ========================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
  touch-action: none; /* Control total de gestos touch */
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 15, 0.97);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 1;
  transition: opacity 0.25s ease;
}

/* Barra superior */
.lightbox-topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  gap: 12px;
}

.lightbox-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.lightbox-counter {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.lightbox-filename {
  font-size: 0.9rem;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.lightbox-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-btn:active {
  transform: scale(0.95);
}

.lightbox-btn.close-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
}

.lightbox-btn.close-btn:hover {
  background: rgba(244, 63, 94, 0.3);
  color: #ffffff;
  border-color: rgba(244, 63, 94, 0.5);
}

.lightbox-btn svg {
  width: 18px;
  height: 18px;
}

/* Área central de gestos */
.lightbox-content-area {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
}

.lightbox-media-container {
  max-width: 100%;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  will-change: transform, opacity;
}

.lightbox-media-element {
  max-width: 95vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  pointer-events: auto;
}

video.lightbox-media-element {
  background: #000000;
  outline: none;
}

/* Flechas de navegación (Desktop & Tablets) */
.lightbox-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.lightbox-nav-arrow:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: var(--accent-gold);
}

.lightbox-nav-arrow:active {
  transform: translateY(-50%) scale(0.92);
}

.lightbox-nav-arrow.prev {
  left: 20px;
}

.lightbox-nav-arrow.next {
  right: 20px;
}

.lightbox-nav-arrow svg {
  width: 24px;
  height: 24px;
}

/* Barra inferior */
.lightbox-bottombar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.lightbox-file-details {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-sep {
  opacity: 0.5;
}

.lightbox-swipe-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.75;
  font-size: 0.76rem;
}

/* ==========================================================
   7. MODALES GENERALES (SUBIDA & COMPARTIR)
   ========================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(4, 7, 13, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

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

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

/* Zona Drag & Drop */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.drop-zone.drag-over {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.05);
}

.drop-icon {
  width: 44px;
  height: 44px;
  color: var(--accent-gold);
}

.drop-zone h4 {
  font-size: 1rem;
  font-weight: 600;
}

.drop-zone p {
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 280px;
}

.file-input-hidden {
  display: none;
}

.upload-progress-container {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gold-gradient);
  transition: width 0.2s ease;
}

.tip-card {
  margin-top: 18px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.8rem;
  color: #fde68a;
  line-height: 1.4;
}

/* Modal Compartir */
.share-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.share-info-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.info-label {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.info-value {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 600;
  font-family: monospace;
}

.info-value.pin-display {
  background: var(--accent-gold);
  color: #0b0f17;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 1rem;
}

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

.share-steps h4 {
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.share-steps ol {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.full-width {
  width: 100%;
  justify-content: center;
}

/* ==========================================================
   8. RESPONSIVE Y MÓVIL
   ========================================================== */
@media (max-width: 768px) {
  .app-header {
    padding: 10px 14px;
  }

  .header-center {
    display: none;
  }

  .btn-text {
    display: none;
  }

  .action-btn {
    padding: 8px 10px;
  }

  .toolbar-section {
    padding: 12px 14px;
    gap: 10px;
  }

  .search-box {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .gallery-wrapper {
    padding: 6px 12px 90px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .gallery-grid.dense {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .lightbox-nav-arrow {
    display: none; /* En móvil usamos touch swipe nativo */
  }

  .lightbox-filename {
    max-width: 120px;
  }

  .selection-bar {
    width: calc(100% - 20px);
    bottom: 14px;
    padding: 8px 14px;
    gap: 10px;
  }

  .selection-sub {
    display: none;
  }

  .btn-download-zip {
    padding: 8px 14px;
    font-size: 0.84rem;
  }
}
