/* ==========================================================================
   ESTILOS GENERALES Y SISTEMA DE DISEÑO DARK MODE - PDF TOOLS STUDIO
   ========================================================================== */

:root {
  /* Paleta Dark Mode Premium */
  --bg-main: #090d16;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #151f32;
  --bg-card: rgba(21, 31, 50, 0.75);
  --bg-card-hover: rgba(29, 42, 68, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --border-card: rgba(99, 102, 241, 0.18);

  /* Colores de Acento y Gradientes */
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --primary-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #c026d3 100%);
  --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;

  /* Texto */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dimmed: #64748b;
  --text-white: #ffffff;

  /* Estados */
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.15);
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.15);

  /* Sombras y Efectos */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  --shadow-glow-cyan: 0 0 25px rgba(6, 182, 212, 0.2);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Tipografía */
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset y Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(139, 92, 246, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Contenedor Común */
.container-main {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   BARRA SUPERIOR (HEADER)
   ========================================================================== */
.navbar {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: relative; /* Simplemente arriba en la app, sin quedar anclado/pegado al hacer scroll */
  padding: 0.9rem 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  color: #fff;
  flex-shrink: 0;
}

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

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-text h1 span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nav-center-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  max-width: 620px;
  margin: 0 1.25rem;
  text-decoration: none;
  cursor: pointer;
}

.navbar-logo-img {
  height: 52px;
  max-height: 58px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
  transition: var(--transition-smooth);
}

.navbar-logo-img:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 4px 18px rgba(99, 102, 241, 0.45));
}

.nav-actions-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Selector de Idiomas con Banderas Circulares */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.lang-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  opacity: 0.6;
}

.lang-btn:hover {
  opacity: 1;
  transform: scale(1.12);
}

.lang-btn.active {
  opacity: 1;
  border-color: var(--primary-light, #818cf8);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
  transform: scale(1.06);
}

.lang-btn svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  pointer-events: none;
}

.btn-about {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.9rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-full);
  color: #c7d2fe;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-about svg {
  width: 16px;
  height: 16px;
  color: #818cf8;
}

.btn-about:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: #818cf8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: var(--color-success-bg);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-full);
  color: #34d399;
  font-size: 0.82rem;
  font-weight: 500;
}

.security-badge svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   PUBLICIDAD: BANNERS (SUPERIOR, INFERIOR Y LATERAL)
   ========================================================================== */

/* Banner Horizontal Superior */
.ad-banner-top {
  margin: 0.5rem auto 0.75rem auto;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
}

.ad-slot-horizontal {
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 0;
}

.ad-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  color: var(--text-dimmed);
}

.ad-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

.ad-inner-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Sidebar Ads (Columna Derecha) */
.sidebar-column {
  width: 100%;
}

.sticky-sidebar {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ad-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.ad-card .ad-label {
  position: absolute;
  top: 0.65rem;
  left: 0.85rem;
}

.ad-placeholder-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0.5rem;
}

.ad-placeholder-sidebar.mini {
  padding: 1rem 0;
  min-height: 120px;
}

.ad-icon-ring {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-indigo);
  margin-bottom: 0.85rem;
}

.ad-content-box h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.ad-content-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.ad-badge-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  border-radius: var(--radius-full);
}

/* Tarjeta informativa en sidebar */
.feature-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.feature-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-cyan);
  margin-bottom: 0.85rem;
}

.feature-header svg {
  width: 20px;
  height: 20px;
}

.feature-header h5 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.feature-list li svg {
  width: 16px;
  height: 16px;
  color: var(--color-success);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Banner Móvil Inferior (Desactivado para no tapar la interfaz en móviles) */
.ad-banner-bottom {
  display: none !important;
}

.ad-slot-mobile-sticky {
  display: none !important;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 1.75rem;
  margin-top: 1.25rem;
  margin-bottom: 3rem;
  flex: 1;
}

.app-column {
  min-width: 0; /* Previene desbordamiento en grid */
}

/* Selector de Pestañas (Tabs) */
.tabs-header {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  background: var(--bg-surface);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tab-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.tab-button svg {
  width: 20px;
  height: 20px;
  transition: var(--transition-smooth);
}

.tab-button:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-button.active {
  background: var(--primary-gradient);
  color: var(--text-white);
  box-shadow: var(--shadow-glow);
}

/* Paneles de Contenido */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   ZONA DE CARGA (DRAG & DROP)
   ========================================================================== */
.dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  background: rgba(15, 23, 42, 0.35);
  position: relative;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: #a855f7;
  background: rgba(99, 102, 241, 0.08);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

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

.dropzone-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
  transition: var(--transition-smooth);
}

.dropzone:hover .dropzone-icon {
  transform: scale(1.1);
  color: #c084fc;
}

.dropzone-icon svg {
  width: 32px;
  height: 32px;
}

.dropzone-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.dropzone-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-indigo);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.btn-link:hover {
  color: #a5b4fc;
}

.dropzone-tip {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-dimmed);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   LISTA DE ARCHIVOS (COMBINAR)
   ========================================================================== */
.files-section {
  margin-top: 1.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.section-title p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.section-actions {
  display: flex;
  gap: 0.5rem;
}

.file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

/* Estilo de Scrollbar Custom */
.file-list::-webkit-scrollbar,
.pages-grid::-webkit-scrollbar {
  width: 6px;
}
.file-list::-webkit-scrollbar-track,
.pages-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}
.file-list::-webkit-scrollbar-thumb,
.pages-grid::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 4px;
}
.file-list::-webkit-scrollbar-thumb:hover,
.pages-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.6);
}

.file-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: var(--transition-smooth);
}

.file-item:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: var(--bg-card-hover);
}

.file-index-badge {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.file-icon {
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-actions-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* ==========================================================================
   FICHA Y HERRAMIENTAS DE CORTE DE PDF
   ========================================================================== */
.cut-content {
  margin-top: 1.5rem;
}

.file-info-banner {
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.file-info-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-info-icon svg {
  width: 24px;
  height: 24px;
}

.file-info-details {
  flex: 1;
  min-width: 0;
}

.file-info-details h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

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

/* Opciones de Selección */
.options-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.options-box-title h5 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.9rem;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.range-tool-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.group-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.input-inline {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.input-inline input {
  width: 70px;
  padding: 0.45rem 0.5rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  text-align: center;
}

.custom-text-input {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.custom-text-input input {
  flex: 1;
  padding: 0.45rem 0.75rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
}

.custom-text-input input:focus,
.input-inline input:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* Barra rápida de conteo y botones */
.selection-quick-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.counter-display {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.counter-highlight {
  font-weight: 700;
  color: #38bdf8;
  font-size: 1.05rem;
}

.quick-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   CUADRÍCULA VISUAL DE PÁGINAS (PREVIEW DE MINIATURAS)
   ========================================================================== */
.pages-grid-wrapper {
  margin-bottom: 1.5rem;
}

.pages-grid-legend {
  font-size: 0.8rem;
  color: var(--text-dimmed);
  margin-bottom: 0.75rem;
}

.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  max-height: 480px;
  overflow-y: auto;
  padding: 0.5rem 0.35rem 0.5rem 0;
}

.page-card {
  background: var(--bg-surface-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-smooth);
  position: relative;
}

.page-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.page-card.selected {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.12);
  box-shadow: var(--shadow-glow);
}

.page-thumbnail-box {
  width: 100%;
  aspect-ratio: 0.72;
  background: #ffffff;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  position: relative;
}

.page-thumbnail-box canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.page-placeholder {
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
}

.page-card-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.15rem;
}

.page-number {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--text-dimmed);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.page-card.selected .custom-checkbox {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
  color: #ffffff;
}

.custom-checkbox svg {
  width: 12px;
  height: 12px;
  stroke-width: 3;
  opacity: 0;
  transition: var(--transition-smooth);
}

.page-card.selected .custom-checkbox svg {
  opacity: 1;
}

/* ==========================================================================
   CONFIGURACIÓN DE SALIDA Y BOTONES
   ========================================================================== */
.output-settings {
  background: rgba(15, 23, 42, 0.6);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.input-with-ext {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-width: 360px;
}

.input-with-ext input {
  flex: 1;
  padding: 0.6rem 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
}

.input-with-ext input:focus {
  outline: none;
}

.input-with-ext .extension {
  padding: 0 0.85rem;
  color: var(--text-dimmed);
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  height: 100%;
  display: flex;
  align-items: center;
}

.action-footer {
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   BARRA DE DESCARGA CON NOMBRE DE ARCHIVO
   ========================================================================== */
.download-action-bar {
  background: rgba(15, 23, 42, 0.75);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  flex-wrap: wrap;
}

.download-name-group {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.download-name-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.download-name-group .input-with-ext {
  max-width: 100%;
}

.btn-download-action {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:not(:disabled):hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.45);
}

.btn-success {
  background: var(--success-gradient);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.btn-success:not(:disabled):hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:not(:disabled):hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-danger-outline:not(:disabled):hover {
  background: var(--color-danger-bg);
  border-color: var(--color-danger);
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.btn-icon:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
}

.btn-icon.btn-danger:hover {
  color: #ef4444;
  background: var(--color-danger-bg);
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-chip {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-full);
}

.btn-chip svg {
  width: 14px;
  height: 14px;
}

.btn-chip:hover {
  color: var(--text-main);
  border-color: rgba(99, 102, 241, 0.4);
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
}

/* ==========================================================================
   MODAL DE PROGRESO
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.25rem;
}

.modal-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.spinner-ring {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--accent-indigo);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.modal-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.modal-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.progress-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

/* ==========================================================================
   TOAST NOTIFICACIONES
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 1100;
  max-width: 360px;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-md);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.88rem;
  color: var(--text-main);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(15, 30, 26, 0.95);
}

.toast.toast-error {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(35, 18, 22, 0.95);
}

.toast.toast-warning {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(35, 26, 15, 0.95);
}

.toast-icon {
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(10, 15, 26, 0.85);
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-dimmed);
}

.footer-links {
  display: flex;
  gap: 0.75rem;
}

/* ==========================================================================
   MODAL ABOUT (INFORMACIÓN Y TÉRMINOS LEGALES)
   ========================================================================== */
.modal-card-about {
  max-width: 620px;
  text-align: left;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-color: rgba(99, 102, 241, 0.35);
}

.modal-about-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.7);
}

.about-header-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.about-icon-header {
  width: 22px;
  height: 22px;
  color: var(--accent-indigo);
  flex-shrink: 0;
}

.modal-about-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-close-modal svg {
  width: 20px;
  height: 20px;
}

.btn-close-modal:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.modal-about-body {
  padding: 1.35rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.modal-about-body::-webkit-scrollbar {
  width: 6px;
}
.modal-about-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}
.modal-about-body::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 4px;
}

.about-dev-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.dev-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.2);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.about-dev-box h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.about-dev-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.about-email-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #38bdf8;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.about-email-link svg {
  width: 16px;
  height: 16px;
}

.about-email-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.about-free-banner {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.08);
}

.about-free-banner .box-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #34d399;
  margin-bottom: 0.45rem;
}

.about-free-banner .box-title svg {
  width: 18px;
  height: 18px;
  color: #34d399;
}

.about-free-banner h5 {
  font-size: 0.96rem;
  font-weight: 700;
  margin: 0;
  color: #34d399;
}

.about-free-banner p {
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.55;
  margin: 0;
}

.about-privacy-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.about-privacy-box .box-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #34d399;
  margin-bottom: 0.45rem;
}

.about-privacy-box .box-title svg {
  width: 18px;
  height: 18px;
}

.about-privacy-box h5 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.about-privacy-box p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.about-legal-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.about-legal-box .box-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fbbf24;
  margin-bottom: 0.6rem;
}

.about-legal-box .box-title svg {
  width: 18px;
  height: 18px;
}

.about-legal-box h5 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.about-legal-box p {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.about-legal-box ul {
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.about-legal-box li {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-about-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   RESPONSIVIDAD Y MEDIA QUERIES (MÓVIL Y TABLET)
   ========================================================================== */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .sidebar-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .sticky-sidebar {
    position: static;
    display: contents;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 1.2rem 0 0.6rem 0;
  }

  .nav-container {
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 0 1rem;
  }

  .brand {
    justify-content: center;
    text-align: center;
  }

  .brand-text h1 {
    font-size: 1.15rem;
  }

  .brand-text p {
    font-size: 0.78rem;
  }

  /* Los 3 botones principales responsivos en móviles: 2 arriba y el 3ro abajo abarcando todo el ancho */
  .tabs-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    padding: 0.4rem;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: visible;
  }

  .tab-button {
    width: 100%;
    min-height: 48px;
    padding: 0.55rem 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    line-height: 1.25;
    white-space: normal;
    border-radius: var(--radius-sm);
    word-break: normal;
    overflow-wrap: normal;
    box-sizing: border-box;
  }

  .tab-button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  /* El tercer botón se coloca debajo de los dos primeros abarcando todo el ancho */
  .tab-button:nth-child(3),
  .tab-button.tab-button-full {
    grid-column: 1 / -1;
    font-size: 0.88rem;
    padding: 0.65rem 0.85rem;
    min-height: 44px;
    gap: 0.5rem;
  }

  .nav-center-logo {
    margin: 0.2rem 0;
    max-width: 240px;
  }

  .navbar-logo-img {
    max-height: 38px;
  }

  .nav-actions-right {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .security-badge {
    justify-content: center;
  }

  .sidebar-column {
    grid-template-columns: 1fr;
  }

  .ad-banner-bottom {
    display: none !important;
  }

  body {
    padding-bottom: 0;
  }

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

  .panel-card {
    padding: 1.15rem;
  }

  .dropzone {
    padding: 2rem 1rem;
  }

  .pages-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 0.65rem;
  }

  .action-footer .btn {
    width: 100%;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 4.5rem;
    max-width: none;
  }
}

/* ==========================================================================
   TAB 3: GENERAR PDF CON IMÁGENES (Recorte / Contraste Mágico)
   ========================================================================== */

/* Barra de Herramientas de Imágenes */
.img2pdf-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.img2pdf-toolbar-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* Switch de Contraste Mágico */
.magic-contrast-switch-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 0.5rem 0.9rem;
  border-radius: 9999px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-smooth);
}

.magic-contrast-switch-box:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.5);
}

.magic-contrast-switch-box.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.magic-switch-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  transition: var(--transition-smooth);
}

.magic-contrast-switch-box.active .magic-switch-toggle {
  background: #10b981;
}

.magic-switch-handle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.magic-contrast-switch-box.active .magic-switch-handle {
  transform: translateX(20px);
}

.magic-switch-info {
  display: flex;
  flex-direction: column;
}

.magic-switch-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.magic-contrast-switch-box.active .magic-switch-title {
  color: #34d399;
}

.magic-switch-desc {
  font-size: 0.72rem;
  color: var(--text-dimmed);
}

/* Selector de Ajustes de Página (A4, Carta, Márgenes) */
.page-options-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.opt-inline-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.select-styled {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.select-styled:focus {
  border-color: var(--primary-accent);
}

/* Grid de Imágenes Cargadas */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.15rem;
  margin-bottom: 1.5rem;
}

.image-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition-smooth);
}

.image-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--shadow-card);
}

.image-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--border-subtle);
}

.image-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.5rem;
}

.image-card-header-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.page-num-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-accent);
  background: rgba(99, 102, 241, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* Botón de tijeras en la cabecera de cada imagen */
.btn-card-crop-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.btn-card-crop-badge:hover {
  background: #38bdf8;
  color: #020617;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.image-card-preview-box {
  aspect-ratio: 3 / 4;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.5rem;
  position: relative;
  cursor: pointer;
}

/* Botón de tijeras flotante sobre la imagen */
.thumb-crop-overlay-btn {
  position: absolute;
  bottom: 0.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(56, 189, 248, 0.7);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.32rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  transition: var(--transition-smooth);
  z-index: 2;
  white-space: nowrap;
}

.thumb-crop-overlay-btn:hover {
  background: #38bdf8;
  color: #020617;
  transform: translateX(-50%) scale(1.06);
}

.image-card-thumb {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  border-radius: 2px;
  background: #ffffff;
  transition: filter 0.25s ease;
}

.image-card.cropped-active .image-card-thumb {
  border: 1.5px solid #10b981;
}

.cropped-tag {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
  z-index: 2;
}

.image-card-meta {
  padding: 0.45rem 0.65rem;
  font-size: 0.74rem;
  color: var(--text-dimmed);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.4);
}

.image-card-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid var(--border-subtle);
}

.btn-card-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-card-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-card-action.btn-action-crop {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  gap: 0.25rem;
}

.btn-card-action.btn-action-crop:hover {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.25);
}

.btn-action-text {
  font-size: 0.72rem;
  font-weight: 700;
}

.btn-card-action.btn-action-delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

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

/* ==========================================================================
   MODAL DE RECORTE INTERACTIVO (CROP MODAL)
   ========================================================================== */
.crop-modal-card {
  max-width: 860px;
  width: 95%;
  background: #0b1120;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  max-height: 90vh;
}

.crop-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--border-subtle);
}

.crop-modal-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.crop-modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  background: #030712;
}

.crop-canvas-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  background: #0f172a;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

#crop-canvas {
  display: block;
  max-width: 100%;
  max-height: 55vh;
  object-fit: contain;
  cursor: crosshair;
}

.crop-instructions {
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-dimmed);
  text-align: center;
}

.crop-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.crop-presets {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-crop-preset {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-crop-preset:hover, .btn-crop-preset.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary-accent);
  color: #ffffff;
}

.crop-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

