/* 
 * apps.css - CSS Común para AppsGratis.es
 * Estilos reutilizables para todas las herramientas
 * Versión: 1.0
 */

/* ================================
 * VARIABLES CSS Y BASE
 * Definición de colores, tamaños, sombras y configuración inicial
 * ================================ */

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --secondary: #374151;
    --secondary-dark: #1f2937;
    --secondary-light: #4b5563;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================
 * RESET DE ESTILOS NATIVOS
 * Elimina efectos nativos feos y personaliza elementos del navegador
 * ================================ */

/* Eliminar el highlight azul al tocar en móvil - GLOBAL */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none; /* iOS Safari */
}

/* Para elementos interactivos específicos */
button, 
a, 
input, 
textarea, 
select,
[role="button"],
[tabindex] {
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE/Edge */
    user-select: none; /* Standard */
}

/* Permitir selección solo en inputs de texto */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Estilos para autocompletado acorde al diseño */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--surface) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    caret-color: var(--primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Eliminar outline nativo y reemplazar con el nuestro */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none !important;
}

/* Nuestro outline personalizado para navegación con teclado */
:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

/* Sin outline cuando no se navega con teclado */
:focus:not(:focus-visible) {
    outline: none !important;
}

/* Reset completo para botones en iOS */
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
}

/* Eliminar el estilo de presionado en iOS */
button:active,
input[type="button"]:active,
input[type="submit"]:active {
    opacity: 1; /* iOS reduce la opacidad por defecto */
}

/* Scrollbar personalizado para TODA la web */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--border-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--border-light);
}

/* Color de selección de texto acorde al diseño */
::selection {
    background: var(--primary);
    color: white;
}

::-moz-selection {
    background: var(--primary);
    color: white;
}

/* Placeholder con colores acordes */
::placeholder {
    color: var(--text-tertiary);
    opacity: 1; /* Firefox */
}

:-ms-input-placeholder {
    color: var(--text-tertiary);
}

::-ms-input-placeholder {
    color: var(--text-tertiary);
}

/* Control del resize de textareas */
textarea {
    resize: vertical; /* Solo vertical */
}

/* Color del cursor de texto */
input,
textarea {
    caret-color: var(--primary);
}

/* ================================
 * RADIO BUTTONS Y CHECKBOXES
 * Personalización de controles de formulario nativos
 * ================================ */

/* Radio buttons con color negro/gris */
input[type="radio"] {
    accent-color: var(--text-primary);
    cursor: pointer;
    outline: none !important;
}

input[type="radio"]:focus {
    outline: none !important;
    box-shadow: none !important;
}

input[type="radio"]:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

input[type="radio"]:disabled {
    accent-color: var(--text-tertiary);
}

/* Checkboxes con color negro/gris (para coherencia) */
input[type="checkbox"] {
    accent-color: var(--text-primary);
    cursor: pointer;
    outline: none !important;
}

input[type="checkbox"]:focus {
    outline: none !important;
    box-shadow: none !important;
}

input[type="checkbox"]:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

input[type="checkbox"]:disabled {
    accent-color: var(--text-tertiary);
}

/* ================================
 * HEADER CORPORATIVO
 * Cabecera principal con gradiente de marca y título de la herramienta
 * ================================ */

.header {
    background: linear-gradient(135deg, #000000 0%, #111827 25%, #064e3b 75%, #10b981 100%);
    color: white;
    padding: 0; /* ALTURA FIJA */
    height: 120px; /* ALTURA FIJA DESKTOP */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.2) 0%, transparent 60%);
    pointer-events: none;
}

.header h1, .header p {
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.header-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    color: var(--primary-light);
    vertical-align: middle;
}

.header p {
    opacity: 0.95;
    font-size: clamp(0.875rem, 2vw, 1rem);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* ================================
 * BREADCRUMBS OBLIGATORIOS
 * Navegación jerárquica que muestra la ubicación actual (Inicio > Herramienta)
 * ================================ */

.breadcrumbs {
    background: linear-gradient(135deg, #2d2d2d 0%, #064e3b 25%, #000000 50%, #111827 75%, #10b981 99%, #10b981 100%);
    padding: 0; /* ALTURA FIJA - No padding variable */
    height: 48px; /* ALTURA FIJA DESKTOP */
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.breadcrumbs .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
}

.breadcrumb-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
    font-size: 1rem;
}

.breadcrumb-link:hover {
    color: var(--primary-light);
}

.breadcrumb-separator {
    color: var(--text-tertiary);
    width: 12px;
    height: 12px;
}

.breadcrumb-current {
    color: var(--text-tertiary);
    font-size: 1rem;
}

/* ================================
 * CONTAINER Y LAYOUT
 * Contenedor principal que centra y limita el ancho del contenido
 * ================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    width: 100%;
}

/* ================================
 * SISTEMA DE BOTONES
 * Estilos base y variantes para todos los botones de la plataforma
 * ================================ */

.btn {
    background: var(--secondary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover::before {
    opacity: 1;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Botón primario - CTA principal */
.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-primary:active {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

/* Estado deshabilitado para botón primario */
.btn-primary:disabled {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #9ca3af;
    cursor: default;
    pointer-events: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    opacity: 1;
}

.btn-primary:disabled:hover {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    transform: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Botón secundario - Acciones secundarias */
.btn-secondary {
    background: var(--secondary);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
}

/* Botón outline - Sin relleno */
.btn-outline {
    background: var(--surface);
    color: var(--secondary);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    background: var(--border-light);
    border-color: var(--secondary);
}

/* Botón copiar - Acción específica */
.btn-copy {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-copy:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-copy:active {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

/* Icono dentro de botones */
.btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ================================
 * UPLOAD ZONE REUTILIZABLE
 * Área de drag & drop para cargar archivos con estados hover y dragover
 * ================================ */

.upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background: var(--surface);
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 600px;
    position: relative;
    overflow: hidden;
}

/* Efecto de fondo al hover */
.upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.upload-zone:hover::before,
.upload-zone.dragover::before {
    opacity: 1;
}

/* Estados hover y dragover */
.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.upload-icon {
    margin: 0 auto 1rem;
    color: var(--primary);
}

.upload-zone h2 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-zone p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.file-input {
    display: none;
}

/* ================================
 * SECURITY NOTICE INLINE
 * Aviso de seguridad auto-inyectado dentro del desplegable
 * ================================ */

.security-notice-inline {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    color: #065f46;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    border: 1px solid var(--primary);
    margin-bottom: 1rem;
    text-align: center;
}

.security-notice-inline h3 {
    font-weight: 600;
    margin: 0 0 0.1rem 0
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.security-notice-inline p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.825rem;
}

/* Icono de seguridad */
.security-icon {
    color: var(--primary);
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

/* Ocultar el security notice antiguo si existe */
.security-notice {
    display: none !important;
}

/* ================================
 * SISTEMA DE STATS CARDS
 * Tarjetas que muestran estadísticas numéricas (ej: archivos, tamaño, etc.)
 * ================================ */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.5rem 1rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    display: block;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ================================
 * RESULTS SECTION
 * Contenedor para mostrar resultados con header y controles de exportación
 * ================================ */

.results {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    overflow: hidden;
}

.results-header {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-content {
    height: 60vh;
    max-height: 600px;
    overflow: auto;
    position: relative;
}

.export-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ================================
 * ESTADOS DE CARGA
 * Spinners animados y mensajes para estados de procesamiento o sin archivos
 * ================================ */

.processing,
.no-files {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

.no-files-icon {
    margin: 0 auto 1.5rem;
    color: var(--border);
}

.no-files h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Loader inicial de página */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ================================
 * COOKIE BANNER
 * Banner fijo inferior para cumplimiento GDPR con aceptación de cookies
 * ================================ */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideUp 0.4s ease;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 280px;
}

.cookie-text strong {
    display: block;
    margin-bottom: 0.25rem;
}

.cookie-text p {
    font-size: 0.875rem;
    line-height: 1.5;
    opacity: 0.95;
    margin: 0;
}

.cookie-text a {
    color: var(--primary-light);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ================================
 * NOTIFICACIONES
 * Toast/popup temporal que aparece en esquina superior derecha (ej: "Copiado!")
 * ================================ */

.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1001;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-notification.show {
    transform: translateX(0);
}

/* ================================
 * FAQ SECTION
 * Grid de preguntas frecuentes con formato de tarjetas
 * ================================ */

.faq-section {
    margin-top: 4rem;
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}

.faq-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.faq-decoration {
    width: 28px;
    height: 28px;
    color: var(--text-tertiary);
    opacity: 0.9;
    animation: floatDown 2s ease-in-out infinite;
}

/* Animación de flotación hacia abajo */
@keyframes floatDown {
   0%, 100% { transform: translateY(2px); }
   50% { transform: translateY(5px); }
}

.faq-section h2 {
    text-align: center;
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 3rem;
    font-weight: 700;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.faq-item {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.faq-item h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.faq-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* ================================
 * SEO CONTENT COLLAPSIBLE
 * Contenido desplegable con información útil de la herramienta
 * ================================ */

.seo-content-wrapper {
    margin: 0 auto 2rem;
    max-width: 900px;
}

.seo-toggle {
    width: 100%;
    background: var(--surface);
    color: var(--text-secondary);
    border: 2px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.seo-toggle:hover {
    background: var(--border-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.seo-toggle:active {
    transform: translateY(0);
}

.toggle-icon {
    flex-shrink: 0;
    color: var(--primary);
    width: 20px;
    height: 20px;
}

.seo-toggle span {
    flex: 0 0 auto;
    text-align: center;
}

/* ================================
 * SISTEMA DE CHEVRON ICON
 * Flechitas que rotan 180° al expandir/colapsar secciones
 * ================================ */

/* Chevron base - para cualquier icono que rote */
.chevron-icon {
    flex-shrink: 0;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    width: 20px;
    height: 20px;
}

/* Posición absoluta solo para SEO toggle */
.seo-toggle .chevron-icon {
    position: absolute;
    right: 1.5rem;
}

/* Rotaciones para todos los chevrons */
.btn[aria-expanded="true"] .chevron-icon,
.seo-toggle[aria-expanded="true"] .chevron-icon,
.filters-active .chevron-icon {
    transform: rotate(180deg);
}

/* ================================
 * SEO CONTENT (CONTENEDOR)
 * ================================ */

.seo-content {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-top: 0.5rem;
    overflow: hidden;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}

/* Estado colapsado */
.seo-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    border: none;
    box-shadow: none;
}

.seo-content-inner {
    padding: 2rem;
    line-height: 1.8;
}

/* Estilos de texto dentro del SEO content */
.seo-content h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.seo-content h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem;
    font-weight: 600;
}

.seo-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.seo-content ul {
    margin: 1rem 0 1rem 2rem;
    color: var(--text-secondary);
}

.seo-content li {
    margin-bottom: 0.5rem;
}

.seo-content strong {
    color: var(--text-primary);
}

/* ================================
 * FOOTER UNIVERSAL
 * Para index.html, otros html y todas las apps
 * ================================ */

.footer {
    background: linear-gradient(135deg, #022c22 0%, #064e3b 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: auto;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

/* Enlaces del footer */
.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Copyright separado */
.footer-copyright {
    color: #f3f4f6; /* Ligeramente más gris que white puro */
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

/* Tagline separado */
.footer-tagline {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Textos completos por defecto (desktop) */
.link-text-full {
    display: inline;
}

.link-text-short {
    display: none;
}

/* ================================
 * ANIMACIONES Y UTILIDADES
 * Keyframes para animaciones y clases auxiliares (.hidden, .mobile-only, etc.)
 * ================================ */

/* Animación fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación slide up */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Animación spin */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Línea divisoria decorativa */
.decor-line {
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  margin: 0 auto;
  position: relative;
  animation: slideLine 3s ease-in-out infinite alternate;
}

@keyframes slideLine {
  0%   { transform: translateX(-7px); }
  100% { transform: translateX(7px); }
}

/* Utilidad para ocultar elementos */
.hidden {
    display: none !important;
}

/* Utilidad para elementos solo móvil */
.mobile-only {
    display: none;
}

/* Utilidad para elementos solo desktop */
.desktop-only {
    display: block;
}

/* ================================
 * RESPONSIVE TABLET-MOVIL (hasta 768px)
 * Todos los ajustes para pantallas medianas-pequeñas
 * ================================ */

@media (max-width: 768px) {
    
    /* -------- UTILIDADES -------- */
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: inline !important;
    }

    /* -------- LAYOUT GENERAL -------- */
    .container {
        padding: 0.75rem;
    }
    
    /* -------- HEADER -------- */
    .header {
        height: 100px;
        padding: 0 0.75rem;
    }
    
    .header h1 {
        font-size: clamp(1rem, 5vw, 1.25rem);
        gap: 0.4rem;
        flex-direction: row;
        word-break: break-word;
        hyphens: auto;
        line-height: 1.1;
        margin-bottom: 0.25rem;
    }
    
    .header-icon {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }
    
    .header p {
        font-size: 0.8rem;
        line-height: 1.2;
        margin: 0;
    }
    
    /* -------- BREADCRUMBS -------- */
    .breadcrumbs {
        height: 40px; /* ALTURA FIJA MÓVIL */
        padding: 0;
    }
    
    .breadcrumbs .container {
        padding: 0 0.75rem;
        gap: 0.4rem;
    }
    
    .breadcrumb-link,
    .breadcrumb-current {
        font-size: 0.9rem;
    }
    
    .breadcrumb-separator {
        width: 10px;
        height: 10px;
    }
    
    /* -------- UPLOAD ZONE -------- */
    /* NOTA: Comportamiento específico móvil - sin borde */
    .upload-zone {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 1rem 0;
        margin-bottom: -1rem;
    }
    
    .upload-zone:hover {
        background: transparent;
        border: none;
        transform: none;
        box-shadow: none;
    }
    
    /* Ocultar elementos no necesarios en móvil */
    .upload-zone h2,
    .upload-zone p {
        display: none;
    }
    
    .upload-icon {
        display: none;
        margin: 0 auto 0.75rem;
        width: 32px;
        height: 32px;
    }
    
    .upload-zone .btn {
        margin: 0 auto;
        padding: 0.875rem 1.75rem;
        font-size: 0.9rem;
        background: var(--primary-dark); /* Verde oscuro #059669 */
        color: white;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
    }
    
    .upload-zone .btn:hover,
    .upload-zone .btn:active {
        background: #047857; /* Aún más oscuro */
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
    }
    
    /* -------- BOTONES -------- */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        border-radius: 6px;
    }
    
    .btn-icon {
        width: 14px;
        height: 14px;
    }
    
    /* -------- RESULTS -------- */
    .results-header {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 0.75rem;
        gap: 0.75rem;
    }
    
    .results-header h3 {
        font-size: 0.95rem;
    }
    
    .export-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }
    
    .export-controls .btn {
        justify-content: center;
        padding: 0.45rem 0.4rem;
        font-size: 0.75rem;
    }
    
    /* -------- STATS -------- */
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
        margin-bottom: 1rem;
    }
    
    .stat-card {
        padding: 0.6rem 0.4rem;
        border-radius: 8px;
    }
    
    .stat-number {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.6rem;
        margin-top: 0.1rem;
    }
    
    /* -------- SECURITY NOTICE INLINE -------- */
    .security-notice-inline {
        padding: 0;
        margin-bottom: 0.75rem;
    }
    
    .security-notice-inline h3 {
        font-size: 0.75rem;
        gap: 0.3rem;
        margin-bottom: 0px;
        line-height: 0;
    }
    
    .security-notice-inline .security-icon {
        width: 17px;
        height: 17px;
    }
    
    .security-notice-inline p {
        font-size: 0.7rem;
        line-height: 1;
        margin-bottom: 0.4rem;
    }
    
    /* -------- FAQ MÓVIL - ACCORDION -------- */
    .faq-section {
        margin-top: 1rem;
        padding: 1rem 0;
    }
    
    .faq-section h2 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;  /* Una sola columna en móvil */
        gap: 0.5rem;
    }
    
    /* FAQ como accordion en móvil */
    .faq-item {
        padding: 0;
        background: var(--surface);
        border-radius: 8px;
        overflow: hidden;
        transition: none;
        cursor: pointer;
    }
    
    .faq-item:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
    
    .faq-item h3 {
        font-size: 0.9rem;
        margin: 0;
        padding: 0.75rem 2.5rem 0.75rem 0.75rem;
        background: var(--border-light);
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .faq-decoration {
        width: 20px;
        height: 20px;
    }
    
    /* Icono + para accordion */
    .faq-item h3::after {
        content: '+';
        position: absolute;
        right: 0.75rem;
        font-size: 1.2rem;
        font-weight: 500;
        color: var(--primary);
        transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Rotación cuando está activo */
    .faq-item.active h3::after {
        transform: rotate(45deg);
    }
    
    /* Contenido colapsable */
    .faq-item p {
        font-size: 0.9rem;
        line-height: 1.35;
        margin: 0;
        padding: 0 0.75rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.15s cubic-bezier(0.4, 0, 0.2, 1), padding 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Estado expandido */
    .faq-item.active p {
        padding: 0.75rem;
        max-height: 800px !important;
    }

    /* -------- SEO CONTENT -------- */
    .seo-content-wrapper {
        margin: 0.5rem auto;
    }
    
    .seo-toggle {
        padding: 0.5rem 2.5rem 0.5rem 1rem;
        font-size: 0.85rem;
        gap: 0.5rem;
        border-radius: 8px;
    }
    
    .seo-toggle span {
        flex: 1;
        text-align: center;
        padding-right: 0;
    }
    
    .seo-toggle .chevron-icon {
        right: 1rem;
        width: 16px;
        height: 16px;
    }
    
    .toggle-icon {
        width: 16px;
        height: 16px;
    }
    
    .seo-content {
        border-radius: 8px;
    }
    
    .seo-content-inner {
        padding: 0.75rem 0.6rem;
    }
    
    .seo-content h2 {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
    }
    
    .seo-content h3 {
        font-size: 1rem;
        margin: 0.75rem 0 0.4rem;
    }
    
    .seo-content p,
    .seo-content li {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .seo-content ul {
        margin: 0.4rem 0 0.4rem 1.25rem;
    }
    
    /* -------- COOKIE BANNER -------- */
    .cookie-banner {
        padding: 0.75rem;
        text-align: center;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .cookie-text {
        min-width: auto;
        text-align: center;
    }
    
    .cookie-text strong {
        font-size: 0.85rem;
    }
    
    .cookie-text p {
        font-size: 0.75rem;
        line-height: 1.3;
        text-align: center;
    }
    
    .cookie-actions {
        width: 100%;
        justify-content: center;
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    
    .cookie-actions .btn {
        min-width: 90px;
        text-align: center;
        font-size: 0.75rem;
        padding: 0.5rem 0.9rem;
    }
    
    /* -------- RESULTS CONTENT -------- */
    .results-content {
        height: auto;
        min-height: 150px;
        max-height: 45vh;
        padding: 0.5rem;
    }
    
    .results {
        border-radius: 8px;
    }
    
    /* -------- ESTADOS DE CARGA -------- */
    .processing,
    .no-files {
        padding: 2.5rem 1.5rem;
    }
    
    .no-files-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 1rem;
    }
    
    .no-files h3 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }
    
    .no-files p {
        font-size: 0.85rem;
    }
    
    .spinner {
        width: 32px;
        height: 32px;
        margin-bottom: 1rem;
    }
    
    /* -------- NOTIFICACIONES -------- */
    .copy-notification {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
    
    /* -------- FOOTER TABLET -------- */
    .footer {
        padding: 1.5rem 1rem;
    }
    
    .footer-links {
        gap: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
    
    /* Mostrar textos abreviados en tablet/móvil */
    .link-text-full {
        display: none;
    }
    
    .link-text-short {
        display: inline;
    }
    
    .footer-copyright {
        font-size: 0.9rem;
    }
    
    .footer-tagline {
        font-size: 0.8rem;
    }
    
    /* Cuando cualquier input tiene focus */
    input:focus,
    textarea:focus,
    select:focus {
        /* Forzar scroll para que sea visible */
        scroll-margin-bottom: 50vh;
        scroll-margin-top: 100px;
    }
    
    /* Añadir padding inferior cuando el teclado está activo */
    body.keyboard-open {
        padding-bottom: 50vh;
    }
    
    /* Mejorar la visibilidad del input activo */
    input:focus,
    textarea:focus,
    select:focus {
        position: relative;
        z-index: 10;
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    }
}

/* ================================
 * FIX ESPECÍFICO PARA IOS
 * ================================ */
 
@supports (-webkit-touch-callout: none) {
    input:focus,
    textarea:focus,
    select:focus {
        font-size: 16px !important; /* Previene zoom en iOS */
    }
}

/* ================================
 * RESPONSIVE MOVIL (hasta 480px)
 * Ajustes específicos para pantallas pequeñas
 * ================================ */

@media (max-width: 480px) {
    .footer {
        padding: 1rem 0.75rem;
    }
    
    /* Enlaces más compactos */
    .footer-links {
        gap: 1rem;
        margin-bottom: 1rem;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .footer-links a {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Copyright más pequeño */
    .footer-copyright {
        font-size: 0.85rem;
        margin-bottom: 0.2rem;
    }
    
    /* Tagline más compacto */
    .footer-tagline {
        font-size: 0.75rem;
        line-height: 1.3;
        margin-bottom: 6px;
    }
}

/* ================================
 * MICRO MÓVIL FOOTER (hasta 400px)
 * Reducción progresiva de espacios
 * ================================ */

@media (max-width: 400px) {
    .footer {
        padding: 0.75rem 0.5rem;
    }
    
    .footer-links {
        gap: 0.5rem; /* 50% del gap original de móvil */
        margin-bottom: 0.75rem;
    }
    
    .footer-links a {
        font-size: 0.8rem;
        padding: 0.15rem 0.3rem;
    }
    
    .footer-copyright {
        font-size: 0.8rem;
        margin-bottom: 0.15rem;
    }
    
    .footer-tagline {
        font-size: 0.7rem;
    }
}

/* ================================
 * ULTRA MICRO FOOTER (hasta 320px)
 * Máxima compresión
 * ================================ */

@media (max-width: 320px) {
    .footer {
        padding: 0.6rem 0.4rem;
    }
    
    .footer-links {
        gap: 0.4rem;
        margin-bottom: 0.6rem;
    }
    
    .footer-links a {
        font-size: 0.75rem;
        padding: 0.1rem 0.25rem;
    }
    
    .footer-copyright {
        font-size: 0.75rem;
        margin-bottom: 0.1rem;
    }
    
    .footer-tagline {
        font-size: 0.65rem;
    }
}

/* ================================
 * ACCESIBILIDAD Y PRINT
 * Mejoras para alto contraste, movimiento reducido y estilos de impresión
 * ================================ */

/* Accesibilidad - Modo Alto Contraste */
@media (prefers-contrast: high) {
    :root {
        --primary: #00a86b;
        --border: #000;
        --text-secondary: #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .header,
    .upload-section,
    .export-controls,
    .cookie-banner,
    .copy-notification {
        display: none !important;
    }
    
    .results {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .results-content {
        height: auto;
        max-height: none;
        overflow: visible;
    }
}