/* ============================================================================
   NATIVE EXPLORER PREMIUM STYLES - ATTO 3 v3.3 (Ultra Responsive)
   ============================================================================ */

#native-explorer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.explorer-container {
    width: 98%;
    max-width: 900px;
    height: auto; /* Adaptativo */
    min-height: 300px;
    max-height: 85vh; /* No pasarse del borde */
    background: #1a1c23;
    border: 1px solid rgba(0, 210, 255, 0.4);
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #fff;
    margin: auto; /* Centrar verticalmente si cabe */
}

/* Cabecera */
.explorer-header {
    padding: 15px 20px;
    background: linear-gradient(90deg, rgba(0, 85, 164, 0.4), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.explorer-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #00d2ff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#explorer-close {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

/* Barra de Ruta (Breadcrumbs) */
.explorer-path {
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.3);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    color: #00ffaa;
    white-space: nowrap;
    overflow-x: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb-item {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.breadcrumb-item:hover {
    background: rgba(0, 255, 170, 0.15);
    border-color: rgba(0, 255, 170, 0.3);
    color: #fff;
    transform: translateY(-1px);
}

.breadcrumb-item:active {
    transform: scale(0.96) translateY(0);
}

.breadcrumb-separator {
    color: rgba(255, 255, 255, 0.2);
    font-size: 1.1rem;
    font-weight: 300;
    margin: 0 2px;
}

/* Contenido Principal (Lista de archivos) */
.explorer-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: grid;
    /* Ajuste responsive del grid: min 90px para móviles, 130px para tablets/car */
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    grid-auto-rows: min-content; /* CLAVE: Para que los items no se estiren en vertical */
    gap: 10px;
}

/* Cada Item (Carpeta/Archivo) */
.file-item {
    padding: 15px 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    transition: all 0.2s;
    cursor: pointer;
    min-height: 100px;
    justify-content: center;
}

.file-item:active {
    background: rgba(0, 210, 255, 0.2);
    transform: scale(0.95);
}

.file-item .bi {
    font-size: 2rem; /* Tamaño normal de icono */
}

.file-name {
    font-size: 0.7rem;
    color: #ddd;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.explorer-full-width {
    grid-column: 1 / -1;
    width: 100%;
}

/* Footer con acciones */
.explorer-footer {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
}

.explorer-btn {
    padding: 8px 24px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.btn-secondary:active { background: rgba(255, 255, 255, 0.2); }

/* Scrollbar para pantallas táctiles */
.explorer-content::-webkit-scrollbar { width: 6px; }
.explorer-content::-webkit-scrollbar-thumb { background: rgba(0, 210, 255, 0.3); border-radius: 10px; }

/* 
   Utility: Visible only on Desktop 
   Hide by default (mobile/car/tablet).
   Show only on screen sizes >= 1200px (XL) AND if NOT in native app.
*/
.desktop-only {
    display: none !important;
}
@media (min-width: 1200px) {
    body:not(.is-native-app) .desktop-only {
        display: inline-block !important;
    }
}
