/* Base Styles */
:root {
    --primary-color: #4e73df;
    --primary-light: #7395f7;
    --primary-dark: #3a56a7;
    --secondary-color: #1cc88a;
    --danger-color: #e74a3b;
    --warning-color: #f6c23e;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
    --border-color: #e3e6f0;
    --text-color: #444;
    --bg-color: #f8f9fc;
    --font-main: 'Segoe UI', Roboto, Arial, sans-serif;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    -webkit-text-size-adjust: 100%;
}

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

body {
    font-family: var(--font-main);
    background-color: #f5f7fa;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    touch-action: pan-y;
}

/* Header and Navigation */
header {
    background-color: white;
    box-shadow: var(--shadow);
    padding: 1rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    height: 80px;
}

.logo-container {
    display: flex;
    align-items: center;
    margin-right: 3rem;
    flex-shrink: 0;
    padding: 0;
    flex-basis: 40%;
    height: 70px;
    overflow: visible;
    position: relative;
}

.site-logo {
    height: 55px;
    width: auto;
    max-width: 220px;
    margin: 0;
    padding: 0;
    border: none;
    object-fit: contain;
    transform: scale(3.5);
    transform-origin: left center;
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
    animation: logoAppear 1s ease-out;
}

@keyframes logoAppear {
    0% {
        opacity: 0;
        transform: scale(2.5);
    }
    100% {
        opacity: 1;
        transform: scale(3.5);
    }
}

/* Clase para ajustar el contenido principal */
main {
    padding-top: 100px; /* Ajustar según altura del header */
    transition: padding-top 0.3s ease;
}

@media screen and (max-width: 768px) {
    main {
        padding-top: 90px;
    }
}

@media screen and (max-width: 480px) {
    main {
        padding-top: 80px;
    }
}

.logo-container h1 {
    font-size: 2rem;
    color: var(--dark-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

.menu-toggle:hover {
    color: var(--primary-dark);
}

#main-nav {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 1;
    flex-basis: 55%;
}

.highlight {
    color: var(--primary-color);
    font-weight: bold;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 0.8rem;
    justify-content: flex-end;
    width: 100%;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 1rem;
}

nav a:hover {
    color: var(--primary-color);
    background-color: rgba(78, 115, 223, 0.1);
}

nav a.active {
    color: var(--primary-color);
    background-color: rgba(78, 115, 223, 0.1);
    border-radius: 4px;
    font-weight: 600;
    position: relative;
}

nav a.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Media Queries para Responsive Design */
@media screen and (max-width: 768px) {    header {
        padding: 0.5rem 1.5rem;
        flex-wrap: nowrap;
        height: 80px;
    }.logo-container {
        flex: 0;
        padding: 0;
        flex-basis: auto;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        margin-right: 0;
        margin-bottom: 0;
        height: auto;
        overflow: visible;
        position: relative;
        min-width: 120px;
    }.site-logo {
        height: 40px;
        max-width: 180px;
        transform: scale(4.8);  /* 3 veces más grande que 1.6 */
        transform-origin: left center;
    }
      .menu-toggle {
        display: block;
        margin-left: auto;
        position: relative;
        top: 0;
    }      #main-nav {
        flex-basis: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        order: 3;
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background-color: white;
        box-shadow: var(--shadow);
        z-index: 99;
    }
    
    #main-nav.show {
        max-height: 300px;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 0;
    }
    
    nav a {
        display: block;
        padding: 0.75rem 0;
    }
    
    .container {
        padding: 1rem;
    }
    
    /* Ajustes para la herramienta */
    .tool-section {
        padding: 1.5rem 1rem;
    }
    
    /* Ajustes para formularios y botones */
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
    
    .file-options {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .action-buttons button {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    /* Ajustes para listas de archivos */
    .files-list {
        max-height: 250px;
    }
    
    .file-item {
        flex-wrap: wrap;
        padding: 0.75rem;
    }
    
    .file-info {
        flex: 1 1 100%;
        margin-bottom: 0.5rem;
    }
    
    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    /* Ajustes para inputs en dispositivos móviles */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px; /* Evita zoom automático en iOS */
        padding: 0.75rem;
    }
    
    /* Ajustes para los rangos de páginas en split-tool */
    .range-item {
        padding: 0.75rem;
    }
    
    .range-info {
        font-size: 0.9rem;
    }
    
    /* Ajustes para los modales */
    .modal-content {
        width: 95%;
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
}

/* Responsividad adicional para pantallas extra pequeñas */
@media screen and (max-width: 480px) {
    .logo-container h1 {
        font-size: 1.5rem;
    }
      header {
        padding: 0.5rem 1rem;
        height: 70px;
        width: 100vw;
        max-width: 100%;
    }.logo-container {
        padding: 0;
        height: auto;
        justify-content: flex-start;
        overflow: visible;
        position: relative;
        min-width: 100px;
    }
      .site-logo {
        height: 35px;
        max-width: 140px;
        transform: scale(4.2);  /* 3 veces más grande que 1.4 */
    }
      #main-nav {
        top: 70px;
    }
      .tool-section {
        padding: 1rem 0.75rem;
        border-radius: 6px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .tool-section h2 {
        font-size: 1.5rem;
        white-space: normal;
        word-wrap: break-word;
    }
    
    .upload-area {
        padding: 1.5rem 1rem;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .action-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .secondary-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .file-item {
        padding: 0.5rem;
    }
    
    .file-name {
        font-size: 0.9rem;
    }
    
    .file-size {
        font-size: 0.8rem;
    }
    
    .file-action-btn {
        width: 30px;
        height: 30px;
    }
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Media Queries para pantallas grandes */
@media screen and (min-width: 1200px) {
    .logo-container {
        height: 75px;
    }
    
    .site-logo {
        height: 60px;
        max-width: 240px;
        transform: scale(3.8);
    }
}

/* Media Queries para pantallas extra grandes */
@media screen and (min-width: 1600px) {
    .logo-container {
        height: 80px;
    }    .site-logo {
        height: 65px;
        max-width: 260px;
        transform: scale(4.0);
    }
}

/* Tool Sections */
.tool-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    display: none;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.tool-section.active {
    display: block;
}

.tool-section h2 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.tool-section p {
    color: var(--dark-color);
    margin-bottom: 2rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2rem;
}

.upload-area:hover {
    border-color: var(--primary-light);
    background-color: rgba(78, 115, 223, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: rgba(78, 115, 223, 0.1);
}

.upload-area.highlight {
    border-color: var(--primary-color);
    background-color: rgba(78, 115, 223, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.browse-link {
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 500;
}

.file-input {
    display: none;
}

/* Files List */
.files-list {
    margin: 2rem 0;
    display: none;
}

.files-list h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-size: 1.2rem;
}

.drag-instructions {
    color: var(--dark-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.pdf-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.pdf-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid var(--border-color);
    position: relative;
    cursor: move;
}

.pdf-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.pdf-card.dragging {
    opacity: 0.5;
    border: 2px dashed var(--primary-color);
}

.pdf-card-number {
    position: absolute;
    top: -8px;
    left: -8px;
    background-color: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}

.pdf-preview-container {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background-color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pdf-preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pdf-preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.pdf-preview-loading .mini-logo {
    width: 40px;
    height: auto;
    animation: mini-pulse 1.2s ease-in-out infinite;
    margin-bottom: 0.5rem;
}

@keyframes mini-pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

.pdf-preview-loading .spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
    display: none; /* Lo ocultamos por defecto y solo se mostrará si hay problemas con el logo */
}

.pdf-card-details {
    padding: 0.75rem;
}

.pdf-card-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-card-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--dark-color);
}

.pdf-card-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
}

.remove-file-btn {
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition);
}

.remove-file-btn:hover {
    background-color: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

/* PDF Preview Grid */
.pdf-preview {
    margin: 2rem 0;
    display: none;
}

.pdf-preview h3 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.pdf-info {
    grid-column: 1 / -1;
    background-color: var(--light-color);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-size: 0.9rem;
    text-align: center;
}

.page-thumbnail {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.page-thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.page-thumbnail.selected {
    border: 2px solid var(--primary-color);
}

.page-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.page-number {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 0.25rem;
    font-size: 0.875rem;
}

/* Option Groups */
.option-group {
    margin-bottom: 1.5rem;
}

.option-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.option-group input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.option-help {
    font-size: 0.875rem;
    color: var(--dark-color);
    margin-top: 0.5rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.compression-option {
    background-color: var(--light-color);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.compression-option:hover {
    background-color: rgba(78, 115, 223, 0.05);
}

.compression-option input[type="radio"] {
    margin-right: 0.5rem;
}

.compression-option label {
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.compression-description {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--dark-color);
    margin-left: 1.5rem;
}

/* Buttons */
.action-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 2rem auto;
    box-shadow: 0 3px 6px rgba(78, 115, 223, 0.25);
}

.action-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

/* Secondary Button */
.secondary-btn {
    background-color: var(--light-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.secondary-btn:hover {
    background-color: rgba(78, 115, 223, 0.1);
}

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

.secondary-btn:disabled {
    border-color: var(--border-color);
    color: var(--border-color);
    cursor: not-allowed;
}

.secondary-btn i {
    margin-right: 5px;
}

/* Range Selection */
.split-options {
    background-color: var(--light-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.split-options h3 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    font-size: 1.2rem;
}

#ranges-container {
    margin-bottom: 1.5rem;
}

.range-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-left: 3px solid var(--primary-color);
}

.range-item-number {
    color: var(--primary-color);
    font-weight: bold;
    min-width: 30px;
}

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

.range-input-group input {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-align: center;
}

.range-input-group span {
    font-weight: 500;
    color: var(--dark-color);
}

.range-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.range-actions .secondary-btn {
    margin-top: 0;
}

.total-pages-info {
    background-color: white;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    color: var(--dark-color);
    display: none;
    border-left: 3px solid var(--primary-dark);
}

.remove-range-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.remove-range-btn:hover {
    transform: scale(1.1);
}

/* Input validation */
.range-input-group input.invalid {
    border-color: var(--danger-color);
    background-color: rgba(231, 74, 59, 0.05);
}

.range-validation-error {
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

/* Progress Bar */
.progress-container {
    margin: 2rem 0;
    display: none;
}

.progress-bar {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar div {
    height: 100%;
    background-color: var(--primary-color);
    width: 0;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--dark-color);
}

/* File Info */
.file-info {
    background-color: var(--light-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
    display: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.file-info-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.file-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}

.file-info-item:last-child {
    margin-bottom: 0;
    font-weight: 500;
    border-bottom: none;
}

.highlight-reduction {
    background-color: rgba(28, 200, 138, 0.1);
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background-color: white;
    color: var(--dark-color);
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Overlay and Loader */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    display: none;
}

/* Contenedor del loader con logo */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Logo en el loader */
.loader-logo {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
    animation: pulse-loader 1.5s ease-in-out infinite;
}

@keyframes pulse-loader {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* Loader estándar (como respaldo) */
.loader {
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 5px solid white;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
    display: none; /* Oculto por defecto, se muestra si hay error con el logo */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animación de descarga moderna */
.download-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.download-overlay.show {
    opacity: 1;
    visibility: visible;
}

.download-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    width: 90%;
    max-width: 450px;
    text-align: center;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.download-overlay.show .download-container {
    transform: translateY(0);
    opacity: 1;
}

.download-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.download-logo {
    width: 100px;
    height: auto;
    animation: float-download 3s ease-in-out infinite;
}

@keyframes float-download {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.download-title {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
}

.download-progress-container {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1rem;
    position: relative;
}

.download-progress-bar {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 20px;
    width: 0;
    transition: width 0.3s ease;
    animation: progress-glow 1.5s infinite;
}

@keyframes progress-glow {
    0% { box-shadow: 0 0 5px rgba(78, 115, 223, 0.5); }
    50% { box-shadow: 0 0 15px rgba(78, 115, 223, 0.8); }
    100% { box-shadow: 0 0 5px rgba(78, 115, 223, 0.5); }
}

.download-progress-text {
    color: var(--dark-color);
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.download-message {
    color: var(--secondary-color);
    font-weight: 600;
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.download-message.show {
    opacity: 1;
    transform: translateY(0);
}

.download-message i {
    font-size: 1.2rem;
}

/* Animación de celebración con el logo */
.success-animation {
    position: relative;
    width: 100%;
    height: 80px;
    overflow: hidden;
    margin-top: 1rem;
    display: none;
}

.success-animation.show {
    display: block;
}

.confetti-logo {
    position: absolute;
    width: 25px;
    height: auto;
    animation: confetti-fall 2s ease-in-out forwards;
    opacity: 0;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(0) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translateY(80px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100px) rotate(360deg);
        opacity: 0;
    }
}

/* Animation for elements */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.tool-section.active {
    animation: fadeIn 0.5s ease forwards;
}

/* Animación para tarjetas cuando se agregan */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación para botones en proceso */
.processing-btn {
    position: relative;
    overflow: hidden;
    pointer-events: none;
}

.processing-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: processing-shine 1.5s infinite;
}

@keyframes processing-shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Estilos para vista previa de rangos */
.range-preview {
    width: 100%;
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.range-preview-header {
    font-size: 0.9rem;
    color: var(--dark-color);
    margin-bottom: 8px;
    font-weight: 500;
}

.range-thumbnails {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.range-page-thumbnail {
    position: relative;
    width: auto;
    height: 140px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
    margin-bottom: 5px;
}

.range-page-thumbnail:hover {
    transform: scale(1.02);
}

.range-page-thumbnail img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.range-page-thumbnail .page-number {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 3px;
    font-size: 0.7rem;
    text-align: center;
}

.range-info {
    font-size: 0.8rem;
    color: var(--dark-color);
    text-align: center;
    margin-top: 5px;
}

.preview-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    color: var(--dark-color);
    font-size: 0.9rem;
    font-style: italic;
    gap: 10px;
}

.preview-loading .mini-logo {
    width: 30px;
    height: auto;
    animation: mini-rotate-pulse 1.5s ease-in-out infinite;
}

@keyframes mini-rotate-pulse {
    0% { transform: scale(1) rotate(0deg); opacity: 0.7; }
    50% { transform: scale(1.1) rotate(10deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 0.7; }
}

.preview-error {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    color: var(--danger-color);
    font-size: 0.9rem;
}

/* Ajustes para la estructura del elemento de rango */
.range-item {
    flex-wrap: wrap;
}

.range-input-group {
    flex: 1 1 250px;
}

.range-preview {
    flex: 1 1 100%;
}

.remove-range-btn {
    align-self: flex-start;
}
