/* ------------------------- */
/* ESTRUCTURA PRINCIPAL */
/* ------------------------- */

.q_Infload-container {
    display: flex;
    flex-direction: column;
    padding: var(--q_global-padding-sm);
    background: var(--q_color-bg-soft);
    box-shadow: var(--q_shadow-sm);
    height: 100%;
    box-sizing: border-box;
    min-height: 0;
    gap: var(--q_global-gap-md);
}

.q_Infload-header {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--q_global-gap-sm);
}

.q_Infload-content {
    position: relative; 
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: var(--q_global-border-radius-sm);
    min-height: 0;
    background: var(--q_color-bg);
    border: var(--q_global-border-width-xs) var(--q_global-border-style-solid) var(--q_color-border-muted);
    cursor: default;
}

.q_Infload-content[data-tab-content="files"] {
    flex-grow: 1 !important;
}

.q_Infload-content.hidden {
    display: none;
}

/* ------------------------- */
/* SCROLLBAR */
/* ------------------------- */

.q_Infload-content::-webkit-scrollbar {
    width: 8px;
}

.q_Infload-content::-webkit-scrollbar-thumb {
    background-color: var(--q_color-border-muted);
    border-radius: 4px;
}

.q_Infload-content::-webkit-scrollbar-track {
    background: transparent;
}

.q_Infload-breadcrumb::-webkit-scrollbar {
    height: 6px;
}

.q_Infload-breadcrumb::-webkit-scrollbar-thumb {
    background-color: var(--q_color-scroll-thumb, #ccc);
    border-radius: 3px;
}

.q_Infload-breadcrumb::-webkit-scrollbar-track {
    background: transparent;
}

/* ------------------------- */
/* VISTA VENTANA MODAL */
/* ------------------------- */

.q_modal-wrapper {
    z-index: var(--q_global-z-index-tab);
    position: fixed;
    top: 10vh;
    left: 10vw;
    width: 80vw;
    height: 80vh;
    background: var(--q_color-bg);
    box-shadow: var(--q_shadow-lg);
    display: flex;
    flex-direction: column;
    resize: both;
    overflow: hidden;
}

.q_modal-wrapper.maximizado {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
}

.q_modal-header {
    padding: 10px;
    background: var(--q_color-primary);
    color: var(--q_color-bg-inverse);
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.q_modal-header .q_modal-actions {
    display: flex;
    gap: 4px;
}

.q_modal-header button {
    background: var(--q_color-bg-inverse);
    color: var(--q_color-primary);
    border: none;
    padding: 4px 8px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
}

.q_modal-header button:hover {
    background: var(--q_hover-primary);
    color: var(--q_hover-primary-text);
}

/* ------------------------- */
/* VISTA GRID DE ARCHIVOS */
/* ------------------------- */

.q_Infload-grid {
    display: flex;
    position: relative;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-start;
    gap: var(--q_global-gap-sm);
    padding: 12px;
    overflow-y: visible; 
    flex-grow: 1;
    min-height: 0;
    max-height: none;
}

.q_Infload-item {
    width: 90px;
    height: auto;
    display: flex;
    padding: 5px 0 0 0;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: var(--q_color-bg);
    position: relative;
    overflow: visible;
    transition: all 0.2s ease;
}

.q_Infload-context-item.q_disabled {
    cursor: not-allowed;
    user-select: none;
    opacity: 0.4;
}

.q_Infload-item:hover {
    background: var(--q_color-bg-strong);
    border-color: var(--q_color-primary);
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.q_Infload-item:active {
    transform: translateY(0);
}

.q_Infload-item img {
    width: 65px;
    height: 65px;
    object-fit: contain;
    margin-bottom: 6px;
    transition: transform 0.2s ease;
}

.q_Infload-item img.q_lazzy-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;         /* cuadrado, ajusta si prefieres 4/3, 16/9, etc. */
  object-fit: cover;
  display: block;
}

.q_Infload-item:hover img {
    transform: scale(1.05);
}

.q_Infload-item-name{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  white-space: normal;
  overflow: hidden;              /* evita que se salga */
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  word-break: break-word;
  width: 100%;
  max-width: 100%;
  text-align: center;
}

/* Estados del item */
.q_Infload-item.selected {
    border-color: var(--q_color-primary);
    background: var(--q_color-bg-primary);
    box-shadow: 0 0 0 2px var(--q_color-primary);
}

.q_Infload-item.selected .q_Infload-item-name {
    color: var(--q_color-bg-primary-text);
    font-weight: bold;
}

.q_Infload-item.destino-highlight {
    outline: 2px dashed var(--q_color-primary, #007bff);
    background-color: rgba(0, 123, 255, 0.1);
}

/* Badge de selección */
.q_Infload-item-selected-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    background: var(--q_color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    opacity: 0;
    transition: opacity var(--q_global-duration-sm) ease;
}

.q_Infload-item.selected .q_Infload-item-selected-badge {
    opacity: 1;
}

/* ------------------------- */
/* BARRA DE NAVEGACIÓN */
/* ------------------------- */

.q_Infload-nav-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--q_color-bg-strong);
    padding: 6px 10px;
    border-radius: var(--q_global-border-radius-sm);
    font-size: var(--q_global-font-size-sm);
    font-weight: var(--q_global-font-weight-regular);
    color: var(--q_color-text-muted);
}

.q_nav-btn {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--q_global-border-radius-sm);
    background: var(--q_color-bg-muted);
    color: var(--q_color-text-muted);
    transition: background 0.2s;
    font-size: 16px;
}

.q_nav-btn:hover:not(.disabled) {
    background: var(--q_hover-neutral);
    color: var(--q_color-text);
}

.q_nav-btn.disabled {
    cursor: not-allowed;
    opacity: 0.4;
    pointer-events: none;
}

.q_Infload-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--q_color-text);
    overflow-x: auto;
    white-space: nowrap;
    flex: 1;
    scrollbar-width: thin;
}

.q_breadcrumb-link {
    cursor: pointer;
    color: var(--q_color-primary);
}

.q_breadcrumb-home {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--q_global-border-radius-sm);
    background: var(--q_color-bg-muted);
    font-weight: var(--q_global-font-weight-medium);
    color: var(--q_color-text);
}

/* ------------------------- */
/* FOOTER */
/* ------------------------- */

.q_Infload-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--q_color-bg-soft);
    border-top: var(--q_global-border-width-xs) solid var(--q_color-border-muted);
    font-size: 12px;
}

.q_Infload-footer.hidden {
    display: none;
}

.q_Infload-footer-info {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-grow: 1;
}

.q_Infload-footer-count {
    font-weight: 500;
    min-width: max-content;
}

.q_Infload-footer-size {
    color: var(--q_color-text-muted);
    flex-grow: 1;
    text-align: right;
}

/* ------------------------- */
/* MENÚ CONTEXTUAL */
/* ------------------------- */

.q_Infload-context-menu,
.q_Infload-submenu {
    position: fixed;
    background: var(--q_color-bg);
    border: 1px solid var(--q_color-border-muted);
    border-radius: var(--q_global-border-radius-sm);
    box-shadow: var(--q_shadow-md);
    padding: 4px 0;
    z-index: var(--q_global-z-index-dropdown);
    font-family: var(--q_global-font-family-sans);
    font-size: var(--q_global-font-size-sm);
    color: var(--q_color-text);
    animation: fadeIn 0.15s ease-out;
}

.q_Infload-submenu {
    min-width: 140px;
    font-size: var(--q_global-font-size-xs);
}

.q_Infload-context-item {
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.q_Infload-context-item:hover {
    background: var(--q_hover-neutral);
    color: var(--q_hover-neutral-text);
}

.q_has-submenu::after {
    content: "▸";
    margin-left: auto;
    font-size: 0.9em;
    opacity: 0.5;
}

.q_Infload_separator {
    height: 1px;
    background-color: var(--q_color-border-muted);
    margin: var(--q_global-margin-xs) 0;
    border: none;
}

/* ------------------------- */
/* DRAG & DROP */
/* ------------------------- */

.q_Infload-drag-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--q_color-primary);
    z-index: var(--q_global-z-index-tab);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--q_global-duration-xs) ease-in-out;
}

.q_Infload-drag-overlay.visible {
    opacity: 0.75;
    pointer-events: all;
}

.q_Infload-drag-content {
    text-align: center;
    color: var(--q_color-primary-text);
    font-family: var(--q_global-font-family-sans);
    font-size: var(--q_global-font-size-xl);
    font-weight: var(--q_global-font-weight-bold);
    padding: var(--q_global-padding-lg);
    border: var(--q_global-border-width-sm) dashed var(--q_color-border-strong);
    border-radius: var(--q_global-border-radius-lg);
    background-color: color-mix(in srgb, var(--q_color-primary) 80%, white);
    box-shadow: var(--q_shadow-lg);
}

.q_Infload-cloud-icon {
    position: relative;
    font-size: var(--q_global-font-size-3xl);
    margin-bottom: var(--q_global-margin-md);
}

.q_Infload-drag-arrow {
    position: absolute;
    left: 50%;
    bottom: -1.2rem;
    transform: translateX(-50%);
    font-size: var(--q_global-font-size-lg);
    opacity: 0.8;
    animation: subirFlecha 1.2s infinite ease-in-out;
    color: var(--q_color-primary-text);
}

.q_drag_select_box {
    position: absolute;
    border: 1px dashed var(--q_color-primary);
    background-color: rgba(0, 123, 255, 0.1);
    pointer-events: none;
    z-index: 10000;
}

/* ------------------------- */
/* EDICIÓN DE NOMBRE */
/* ------------------------- */

.q_Infload-item-rename-input {
    background: transparent;
    border: 1px dashed #999;
    outline: none;
    padding: 2px 4px;
    margin-top: 2px;
    width: 90%;
    font-size: inherit;
    font-family: inherit;
    text-align: center;
}

/* ------------------------- */
/* ELEMENTOS NO EDITABLES */
/* ------------------------- */

.q_Infload-item.no-editable {
    opacity: 0.5;
    filter: grayscale(80%);
    position: relative;
}

.q_Infload-item.no-editable::after {
    content: "🔒";
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 14px;
    color: var(--q_color-danger-text);
    background: var(--q_color-bg-danger);
    border-radius: 50%;
    padding: 2px 6px;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ------------------------- */
/* PROPIEDADES */
/* ------------------------- */

.q_Infload-prop-modal {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--q_color-bg-soft);
    border: 1px solid var(--q_color-border-muted);
    box-shadow: var(--q_shadow-lg);
    border-radius: var(--q_global-border-radius-sm);
    z-index: var(--q_global-z-index-dropdown);
    width: 19rem;
    max-width: 90%;
    font-size: var(--q_global-font-size-sm);
    overflow: hidden;
    transition: all var(--q_global-duration-sm) ease-in-out;
}

.q_Infload-prop-content {
    padding: var(--q_global-padding-md);
    display: flex;
    flex-direction: column;
    gap: var(--q_global-gap-sm);
}

.q_Infload-prop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: var(--q_global-font-weight-semibold);
    font-size: var(--q_global-font-size-md);
    color: var(--q_color-text-strong);
    padding-bottom: var(--q_global-padding-sm);
    border-bottom: 1px solid var(--q_color-border-muted);
}

.q_btn-cerrar-prop {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--q_color-text-muted);
    font-size: 1.2rem;
    transition: color var(--q_global-duration-xs);
}

.q_btn-cerrar-prop:hover {
    color: var(--q_color-danger);
}

.q_Infload-prop-body.console-style div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: var(--q_global-padding-xs) 0;
    border-bottom: 1px dashed var(--q_color-border-muted);
    font-family: var(--q_global-font-family-mono);
    word-break: break-word;
    color: var(--q_color-text-soft);
}

.q_Infload-prop-body.console-style div strong {
    font-weight: var(--q_global-font-weight-medium);
    color: var(--q_color-text);
    font-size: var(--q_global-font-size-sm);
}

.q_Infload-prop-body.console-style div code {
    color: var(--q_color-text-muted);
    word-break: break-word;
    white-space: normal;
    font-family: var(--q_global-font-family-mono);
    font-size: var(--q_global-font-size-sm);
    background: var(--q_color-bg-muted);
    padding: 2px 4px;
    border-radius: var(--q_global-border-radius-xs);
}

.q_Infload-prop-body.console-style .input-permisos {
    font-family: var(--q_global-font-family-mono);
    font-size: var(--q_global-font-size-sm);
    padding: var(--q_global-padding-xs);
    background: var(--q_color-bg-muted);
    border: 1px solid var(--q_color-border-muted);
    border-radius: var(--q_global-border-radius-xs);
    box-sizing: border-box;
    color: var(--q_color-text);
    width: 100%;
}

.q_Infload-prop-body .acciones {
    display: flex;
    justify-content: flex-end;
    gap: var(--q_global-gap-sm);
    margin-top: var(--q_global-margin-md);
}

.q_Infload-prop-body .q_btn-guardar {
    background: var(--q_color-success);
    color: var(--q_color-success-text);
    border: none;
    padding: 6px 14px;
    border-radius: var(--q_global-border-radius-md);
    cursor: pointer;
    font-weight: var(--q_global-font-weight-medium);
    transition: background var(--q_global-duration-sm);
    font-size: var(--q_global-font-size-sm);
}

.q_Infload-prop-body .q_btn-guardar:hover {
    background: var(--q_hover-success);
    color: var(--q_hover-success-text);
}

/* ------------------------- */
/* SIDENAV */
/* ------------------------- */

.q_Infload-content-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* PANEL LATERAL DE FAVORITOS */
.q_Infload-favoritos-panel {
    width: 250px;
    max-width: 250px;
    transition: all 0.2s ease;
    opacity: 1;
    transform: translateX(0);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--q_global-gap-xs);
}

/* CUANDO ESTÉ OCULTO */
.q_Infload-favoritos-panel.hidden {
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
    width: 0 !important;
    max-width: 0 !important;
}

/* ESTILOS DE ITEM DE FAVORITO */
.q_fav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--q_global-border-radius-sm);
    transition: background 0.2s;
}

.q_fav-item:hover {
    background: var(--q_color-bg-muted);
}

.q_fav-open {
    flex: 1;
    background: none;
    border: none;
    font-size: 0.95em;
    color: var(--q_color-text);
    text-align: left;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
}

.q_fav-remove {
    background: var(--q_color-danger);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.q_fav-remove:hover {
    background: var(--q_color-danger-dark, #a00);
}


/* ------------------------- */
/* ANIMACIONES */
/* ------------------------- */

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes subirFlecha {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 0.3;
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 0.3;
    }
}


/* =========================================================
   /* =========================================================
   InfLoad - Searchbar (búsqueda rápida) + Modal avanzada
   ========================================================= */

.q_Infload-searchbar-row{
  display:flex;
  align-items:center;
  gap:10px;
}

.q_Infload-search-modal-row{
  display:flex;
  align-items:center;
  gap:10px;
}

.q_Infload-search-modal-inputwrap{
  flex:1;
  width:100%;
}

.q_Infload-search-check{
  display:flex;
  align-items:center;
  gap:8px;
  user-select:none;
}

.q_Infload-search-check input{
  margin:0;
}

InfLoad - Búsqueda por contenido (modal estilo KodExplorer)
   ========================================================= */

.q_Infload-search-options{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:12px;
  margin-top:8px;
}

.q_Infload-search-filetype{
  display:flex;
  align-items:center;
  gap:8px;
}

.q_Infload-search-filetype-label{
  font-size:var(--q_global-font-size-sm);
  opacity:.9;
  white-space:nowrap;
}

.q_Infload-search-filetype-input{
  width:220px;
  max-width:55vw;
}

/* Modal */
.q_Infload-search-modal .container.q_Infload-search-modal-container{
  width:min(980px, 92vw);
  max-height:86vh;
}

.q_Infload-search-summary{
  padding:8px 10px;
  font-size:var(--q_global-font-size-sm);
  opacity:.9;
}

.q_Infload-search-results{
  padding:0 10px 12px 10px;
}

.q_Infload-sr-group{
  border:1px solid var(--q_color-border);
  border-radius:var(--q_global-border-radius-md);
  overflow:hidden;
  margin:10px 0;
  background:var(--q_color-bg);
}

.q_Infload-sr-header{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  background:var(--q_color-bg-soft);
}

.q_Infload-sr-toggle{
  border:none;
  background:none;
  cursor:pointer;
  font-size:16px;
  width:26px;
  height:26px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:var(--q_global-border-radius-sm);
}

.q_Infload-sr-toggle:hover{
  background:var(--q_color-bg);
}

.q_Infload-sr-file{
  flex:1;
  text-align:left;
  border:none;
  background:none;
  cursor:pointer;
  font-weight:600;
  color:var(--q_color-text-strong);
  padding:6px 8px;
  border-radius:var(--q_global-border-radius-sm);
}

.q_Infload-sr-file:hover{
  background:var(--q_color-bg);
}

.q_Infload-sr-badge{
  font-size:var(--q_global-font-size-xs);
  padding:2px 8px;
  border-radius:999px;
  background:var(--q_color-primary-soft);
  color:var(--q_color-text-strong);
}

.q_Infload-sr-body{
  padding:8px 0;
}

.q_Infload-sr-matches{
  display:flex;
  flex-direction:column;
  gap:0;
}

.q_Infload-sr-match{
  display:grid;
  grid-template-columns:66px 1fr;
  gap:10px;
  align-items:flex-start;
  padding:6px 10px;
  border:none;
  background:none;
  text-align:left;
  cursor:pointer;
}

.q_Infload-sr-match:hover{
  background:var(--q_color-bg-soft);
}

.q_Infload-sr-ln{
  font-family:var(--q_global-font-family-mono);
  font-size:var(--q_global-font-size-xs);
  opacity:.75;
}

.q_Infload-sr-sn{
  font-family:var(--q_global-font-family-mono);
  font-size:var(--q_global-font-size-sm);
  overflow-wrap:anywhere;
}

.q_Infload-sr-mark{
  padding:0 2px;
  border-radius:3px;
}

.q_Infload-search-empty,
.q_Infload-search-error{
  padding:10px;
  opacity:.9;
}

/* ============================================================================
 * Transferencias (modal de subidas/descargas con progreso)
 * ============================================================================ */

.q_Infload-transfer-modal .container{
  max-width:720px;
  width:min(92vw,720px);
}

.q_Infload-transfer-modal .header{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.q_Infload-transfer-modal .header .title{
  font-size:var(--q_global-font-size-lg);
  font-weight:700;
}

.q_Infload-transfer-subtitle{
  opacity:.8;
  font-size:var(--q_global-font-size-sm);
}

.q_Infload-transfer-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:min(60vh,520px);
  overflow:auto;
  padding-right:4px;
}

.q_Infload-transfer-item{
  border:1px solid var(--q_color-border);
  border-radius:var(--q_global-border-radius-sm);
  padding:10px;
  background:var(--q_color-bg);
}

.q_Infload-transfer-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.q_Infload-transfer-title{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:600;
  overflow:hidden;
}

.q_Infload-transfer-title .txt{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.q_Infload-transfer-actions{
  display:flex;
  gap:6px;
}

.q_Infload-transfer-progress{
  margin-top:8px;
}

.q_Infload-transfer-meta{
  margin-top:6px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  font-size:var(--q_global-font-size-xs);
  opacity:.85;
}

.q_Infload-transfer-footnote{
  margin-top:10px;
  font-size:var(--q_global-font-size-xs);
  opacity:.75;
}

.q_Infload-transfer-footer{
  margin-top:12px;
  display:flex;
  justify-content:flex-end;
  gap:8px;
}

/* Barra indeterminada: se anima el width para dar sensación de avance */
.q_Infload-transfer-indeterminate{
  animation:q_infload_indet 1s ease-in-out infinite;
}

@keyframes q_infload_indet{
  0%{transform:translateX(-20%);}
  50%{transform:translateX(40%);}
  100%{transform:translateX(-20%);}
}

.q_Infload-transfer-item.is-done{
  border-color:var(--q_color-success-border, var(--q_color-border));
}
.q_Infload-transfer-item.is-error{
  border-color:var(--q_color-danger-border, var(--q_color-border));
}
.q_Infload-transfer-item.is-canceled{
  opacity:.85;
}

