/* =========================================== */
/*     ESTILOS MODERNOS PARA  PDF EDITOR       */
/* =========================================== */

/* ===== 1. HEADER MODERNO  ===== */

.modern-header {
    background: rgba(191, 225,255,0.2) !important;       /*linear-gradient(45deg, 
        rgba(26, 74, 140, 0.95) 0%, 
        rgba(42, 97, 180, 0.95) 100%) !important;*/ 
    border-radius: 8px; 
    padding: 0.9rem 1rem !important; 
    margin: 0 -2rem 1rem !important; 
    color: black !important;  /*white !important;*/
    box-shadow: 
        0 4px 20px rgba(26, 74, 140, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important; 
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modern-header a:not(.btn):not(.nav-link):not(.dropdown-item) {
    color: #1a4a8c !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    text-decoration: none !important;
    font-weight: 600;
    padding: 5px 10px !important; 
    border-radius: 18px !important; 
    display: inline-block;
    box-shadow: 0 2px 8px rgba(26, 74, 140, 0.15); 
    transition: all 0.3s ease;
    border: 2px solid transparent;
    backdrop-filter: blur(5px);
    font-size: 0.95rem; 
}

.modern-header a:not(.btn):not(.nav-link):not(.dropdown-item):hover {
    color: #0d2d5a !important;
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%) !important;
    transform: translateY(-5px) scale(1.08) !important;
    box-shadow: 
        0 12px 25px rgba(26, 74, 140, 0.45),
        0 3px 10px rgba(26, 74, 140, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 0 0 3px rgba(255, 255, 255, 0.7) !important;
    border-color: #1a4a8c !important;
    border-width: 2.5px !important;
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* ===== 2. BARRA DE BÚSQUEDA  ===== */
#scale-wrap > div > div > div > div > div:nth-child(2) {
    display: flex !important;
    justify-content: center !important;
    margin: -1.5rem auto 0.75rem !important; /*margin: -0.75rem auto 0.75rem !important;*/ 
    width: 100% !important;
    padding: 0 1rem !important; 
}

#searchBar {
    width: 100% !important;
    max-width: 487.5px !important; 
    padding: 0.675rem 0.9375rem 0.675rem 2.25rem !important;  
    border: 2px solid #e2e8f0 !important;
    border-radius: 45px !important; 
    font-size: 0.95rem !important; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.35-4.35'%3E%3C/path%3E%3C/svg%3E") no-repeat 1.25rem center !important;
    background-size: 18px !important; 
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05) !important; 
    color: #334155 !important;
    font-family: inherit !important;
}

#searchBar:focus {
    outline: none !important;
    border-color: #1a4a8c !important; /* Color del header */
    box-shadow: 0 0 0 3px rgba(26, 74, 140, 0.15), 0 6px 15px rgba(0, 0, 0, 0.1) !important; 
    transform: translateY(-1px); 
    background-color: #ffffff !important;
}

/* ===== 3. CONTROLES MODERNOS  ===== */
#scale-wrap > div > div > div > div > div:nth-child(3) {
    background: white !important;
    border-radius: 14px !important; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07) !important; 
    padding: 0.375rem 0.5rem !important;     
    margin: -2rem auto 1.5rem !important;  
    max-width: 1200px;
    border: 1px solid #f1f5f9 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0.375rem !important;   
}

/* ===== 4. BOTONES DE FAVORITOS  ===== */
.toggle-favourites {
    cursor: pointer !important;
}

.toggle-favourites.active {
    color: gold !important;
}

.favorite-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important; 
    padding: 0.7rem 1.25rem !important;   
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
    border: none !important;
    border-radius: 12px !important; 
    color: #334155 !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06) !important; 
    border: 1px solid #e2e8f0 !important;
    font-size: 0.95rem !important; 
    min-height: 44px !important;   
    white-space: nowrap !important;
}

.favorite-action-btn .btn-text {
    font-size: 0.9rem !important; 
    font-weight: 600 !important;
    color: #334155 !important;
    transition: color 0.3s ease !important;
}

.favorite-action-btn .material-symbols-rounded {
    font-size: 1.4rem !important; 
    color: #64748b !important;
    transition: all 0.3s ease !important;
}

.favorite-action-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%) !important;
    transform: translateY(-3px) !important; 
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12) !important; 
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}

.favorite-action-btn.active,
.toggle-favourites.active {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    border-color: #fbbf24 !important;
    color: #92400e !important;
}

.favorite-action-btn.active .btn-text,
.toggle-favourites.active .btn-text {
    color: #92400e !important;
}

.favorite-action-btn.active .material-symbols-rounded,
.toggle-favourites.active .material-symbols-rounded {
    color: #f59e0b !important;
}

/* Ajuste adicional para el selector de ordenación */
#sort-options {
    border: 1px solid #cbd5e1 !important;
    background: white !important;
    padding: 0.45rem 0.65rem !important; 
    border-radius: 8px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    min-width: 150px !important; 
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    font-size: 0.9rem !important; 
}


/* ===== 5. SISTEMA RESPONSIVO  ===== */

@media (min-width: 1200px) {

    .navbar-nav {
        margin-left: 290px !important; /* ESTE AJUSTE ASEGURA QUE LAS HERRAMIENTAS DE LA BARRA DE NAVEGACIÓN QUEDEN SEPARADAS DEL NOMBRE */ 
    }
}


@media (max-width: 768px) {
    #searchBar {
        max-width: 90% !important;
        padding: 1rem 1.25rem 1rem 3rem !important;
        background-position: 1rem center !important;
        margin: 0 auto 1.5rem !important;
        display: block !important;
    }
    
    #scale-wrap > div > div > div > div > div:nth-child(3) {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 1.25rem !important;
        margin: 0 auto 2rem !important;
        gap: 1.25rem !important;
    }
    
    .favorite-action-btn {
        padding: 0.8rem 1.25rem !important;
        min-height: 48px !important;
        gap: 0.6rem !important;
    }
}

@media (max-width: 480px) {
    #searchBar {
        padding: 0.9rem 1rem 0.9rem 2.8rem !important;
        background-position: 0.9rem center !important;
        font-size: 0.95rem !important;
    }
    
    .favorite-action-btn {
        padding: 0.7rem 1rem !important;
        font-size: 0.95rem !important;
    }
    
    .favorite-action-btn .btn-text {
        font-size: 0.9rem !important;
    }
}

/* ===== 6. SISTEMA RESPONSIVO ACORDEÓN  ===== */
@media (min-width: 768px) {
    .features-container .feature-rows {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 30px !important;
        margin-top: 30px !important;
        align-items: flex-start !important;
    }
    
    .feature-group {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 250px !important;
        max-width: 300px !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .feature-group-header {
        margin-bottom: 15px !important;
        padding: 12px 16px !important;
        background: #f8f9fa !important; 
        border-radius: 8px !important;
        border-left: 4px solid #6c757d !important;
        font-size: 1.1em !important;
        font-weight: 600 !important;
        cursor: default !important;
    }

    .nav-group-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        flex-grow: 1 !important;
    }
    
    #groupFavorites:empty,
    #groupFavorites .nav-group-container:empty {
        display: none !important;
    }
    
    .stirling-collapse-icon {
        display: none !important;
    }
    
    .feature-group-header {
        pointer-events: none !important;
    }
}

@media (max-width: 767px) {
    .features-container .feature-rows {
        display: block !important;
        margin-top: 30px !important;
        padding-top: 15px !important;
    }
    
    #groupFavorites:has(.nav-group-container:empty) {
        display: none !important;
    }
    
    #groupFavorites .nav-group-container:empty {
        display: none !important;
    }
    
    .feature-group-header.collapsible-header {
        cursor: pointer !important;
        padding: 16px 18px !important;
        background: #f8f9fa !important;
        border-radius: 10px !important;
        margin-bottom: 10px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        transition: all 0.3s ease !important;
        border-left: 5px solid #6c757d !important;
        box-shadow: 0 3px 6px rgba(0,0,0,0.07) !important;
        font-size: 1.15em !important;
        font-weight: 600 !important;
        color: #212529 !important;
    }
    
    .feature-group.active .feature-group-header.collapsible-header {
        background: #e3f2fd !important;
        border-left-color: #2196f3 !important;
        color: #0d47a1 !important;
    }
    
    .nav-group-container {
        display: none !important;
    }
    
    .feature-group.active .nav-group-container {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
        padding: 20px 0 !important;
        animation: fadeIn 0.4s ease-out !important;
    }
    
    .stirling-collapse-icon {
        display: inline-block !important;
        font-size: 1em !important;
        margin-left: 12px !important;
        color: #495057 !important;
        transition: transform 0.3s ease !important;
        font-weight: bold !important;
        min-width: 20px !important;
        text-align: center !important;
    }
    
    .feature-group.active .stirling-collapse-icon {
        transform: rotate(180deg) !important;
        color: #2196f3 !important;
    }
}

/* Esto asegura el color negro para el botón del menú móvil */
.navbar-toggler .material-symbols-rounded {
    color: black !important;
}

.navbar-toggler {
    border-color: black !important /*rgba(255, 255, 255, 0.5) !important;*/
}


/* ===== 7. ESTILOS COMPLEMENTARIOS ===== */
.favorite-icon {
    cursor: pointer;
    width: 0rem;
    font-size: 2rem;
}

#footer {
    margin-top: 70px !important;
    padding-top: 25px !important;
    border-top: 1px solid rgba(0,0,0,0.1) !important;
}

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

/* ===== 8. AJUSTES ESTRUCTURALES ===== */
body {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
}

.page-container {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

#scale-wrap {
    flex: 1 !important;
}

body > :last-child:not(script):not(style) {
    margin-top: auto !important;
}

/* ===== 9. FONDO PERSONALIZADO  ===== */
/* 1. Fondo en el HTML */
 /* Aplicamos el diseño al body directamente */
 html, body {
     min-height: 100vh !important;
     margin: 0;
 }

 body {
     background-color: #e3f2fd !important; /* Azul muy suave de base */
     background-image: 
         radial-gradient(circle at 20% 30%, #bbdefb 0%, transparent 20%),             /*CÍRCULO IZQUIERDA*/
         radial-gradient(circle at 80% 70%, #c3e3ff 0%, transparent 25%),             /*CÍRCULO DERECHA*/ 
         radial-gradient(circle at 50% 10%, #e1f5fe 0%, transparent 30%) !important;  /*CÍRCULO CENTRO*/
     background-attachment: fixed !important;
     background-size: cover !important;
 }

 /* Forzamos transparencia en TODOS los posibles contenedores padres */
 #scale-wrap, 
 .page-container, 
 .container.main-container,
 #wrapper, 
 main, 
 article {
     background: transparent !important;
     background-color: transparent !important;
 }


/* html {
     background: linear-gradient(135deg, 
         color-mix(in srgb, #0d3b66 70%, white 30%) 0%, 
         color-mix(in srgb, #1a659e 70%, white 30%) 30%, 
         color-mix(in srgb, #2a9d8f 70%, white 30%) 60%, 
         color-mix(in srgb, #f4a261 70%, white 30%) 90%, 
         color-mix(in srgb, #f0f9ff 70%, white 30%) 100% 
     ) !important;
     background-attachment: fixed !important;
     background-size: cover !important;
     min-height: 100vh !important;
     
     /* Textura más sutil de "tela"  
     background-image: 
         linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
         linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
     background-size: 60px 60px;
 }

 /* 2. Body transparente 
 body.transition-theme,
 body {
     background: transparent !important;
     min-height: 100vh !important;
 }

 /* 3. Transparencia en contenedores 
 #scale-wrap,
 .page-container,
 .container.main-container {
     background-color: transparent !important;
 }
*/

/* ===== 10. PERSONALIZACIÓN DE BARRA DE NAVEGACIÓN  ===== */

 nav.navbar:first-of-type,
 header > nav,
 body > nav:first-of-type,
 .MuiAppBar-root:first-of-type {
     background-color: rgba(180, 200, 220, 0.2) !important; /* La opacidad al 0.2 */

     /* Subir el blur a 20px compensa la falta de color y da elegancia */
     backdrop-filter: blur(20px) saturate(1.5) !important;

     /* Un borde casi invisible para que la barra no se "disuelva" en el fondo */
     border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
     box-shadow: none !important; /* Sin sombra para máxima limpieza */
 }
 nav.navbar:first-of-type .nav-link,
 header > nav .nav-link {
     color: #000000 !important;
     transition: color 0.3s ease, background-color 0.3s ease !important;
     padding: 8px 15px;
     border-radius: 6px;
 }

 nav.navbar:first-of-type .nav-link:hover {
     color: #1a73e8 !important; /* El azul que elegiste */
     background-color: rgba(26, 115, 232, 0.1) !important; /* Un toque de fondo azul muy tenue */
 }


/* Selectores ESPECÍFICOS solo para la barra principal 
nav.navbar:first-of-type,
header > nav,
body > nav:first-of-type,
.MuiAppBar-root:first-of-type {
    background-color: rgba(26, 74, 140, 0.92) !important;
    backdrop-filter: blur(8px) saturate(1.4) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 12px rgba(10, 42, 92, 0.25) !important;
}

/* Selectores específicos para elementos DENTRO de la barra 
nav.navbar:first-of-type .navbar-brand,
nav.navbar:first-of-type .nav-link,
header > nav .navbar-brand,
body > nav:first-of-type .navbar-brand {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}
*/

/* ===== 11. TARJETAS DE  HERRAMIENTAS ===== */
.card-header,
.tool-group-header,
.group-title,
[class*="group"] h2,
[class*="group"] h3,
/*[class*="group"] h4, ESTA LÍNEA DEBE SER DESCOMENTADA PARA APLICAR LOS CAMBIOS A LOS NOMBRES DE GRUPOS DE HERRAMIENTAS */
[class*="group-title"],
[class*="header"]:has(+ .tool-grid) {
    /* FONDO COMPLETO del encabezado */
    background: linear-gradient(135deg, 
        rgba(58, 118, 200, 0.9) 0%,     
        rgba(42, 92, 168, 0.85) 100%   
    ) !important;
    
    /* Texto y bordes */
    color: rgba(255, 255, 255, 0.98) !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    padding: 14px 20px !important;
    border-radius: 10px 10px 0 0 !important;
    border: none !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    
    /* Efectos visuales */
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 4px 8px rgba(10, 42, 92, 0.2) !important;
}

/*Nombres de grupos de herramientas   ESTE AJUSTE PERMITE DAR FONDO DE COLOR */
[class*="group"] h4 {
    /*background: linear-gradient(135deg, #6760e8 0%, #8a6bef 100%) !important;
    border-radius: 10px !important; */  
    color: rgba(0, 0, 0, 1);   /*COLOR NEGRO PARA LOS NOMBRES DE LOS GRUPOS DE HERRAMIENTAS PARA NAVEGADORES MODO OSCURO  */
}


/* Cuerpo de la tarjeta (demtro de las herramientas)*/ 
.card-body,
.tool-group-body,
[class*="group-body"],
[class*="card"]:has(.btn) {
    background-color: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(3px) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(107, 168, 232, 0.3) !important;
    border-top: none !important;
    padding: 20px !important;
    box-shadow: 0 6px 16px rgba(58, 118, 200, 0.1) !important;
    color: rgba(0, 0, 0, 1); /*COLOR NEGRO PARA TEXTO TARJETA HERRAMMIENTAS EN MODO OSCURO DE NAVEGADORES*/

}

 /*Elimina el desbordamiento de los botones de acción de la herramienta "Firmar"*/  
 .draggable-buttons-box {
   display: flex !important;
   flex-wrap: wrap !important;
   justify-content: center !important;
   align-items: center !important;
   gap: 8px !important;
   width: 100% !important;
   max-width: 100% !important;
   overflow-x: auto !important;
   box-sizing: border-box !important;
   padding: 8px !important;
   margin: 0 !important;
 }
 
 .draggable-buttons-box button,
 .draggable-buttons-box .btn {
   flex-shrink: 0 !important;
   white-space: nowrap !important;
 }
