/* Custom Scrollbar for better UI feel */
::-webkit-scrollbar { 
    width: 6px; 
    height: 6px; 
}
::-webkit-scrollbar-track { 
    background: transparent; 
}
::-webkit-scrollbar-thumb { 
    background: #cbd5e1; 
    border-radius: 4px; 
}
.dark ::-webkit-scrollbar-thumb { 
    background: #2d2d34; 
}

/* Consistent sizing for SVG sprite icons (icons.svg) */
svg use { pointer-events: none; }

/* Right-Click / Tap Context Menu */
.context-menu {
    position: fixed;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    padding: 4px;
    z-index: 1000;
    min-width: 190px;
    display: none;
}
.dark .context-menu { 
    background: #1f1f23; 
    border-color: #2d2d34; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
}

.context-menu-item {
    padding: 9px 12px;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.1s, color 0.1s;
}
.dark .context-menu-item { color: #d1d5db; }

.context-menu-item:hover { background: #3b82f6; color: white; }
.context-menu-item:hover svg { color: white; }
.context-menu-danger:hover { background: #ef4444; color: white; }

/* File Card Selection Logic (desktop: reveal on hover) */
.file-card .file-checkbox,
.file-card .file-menu-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

.file-card:hover .file-checkbox,
.file-card:hover .file-menu-btn,
.file-card .file-checkbox:checked {
    opacity: 1;
}

/* Touch devices (phones/tablets): always show checkbox & ⋮ menu since there is no hover */
@media (hover: none), (max-width: 767px) {
    .file-card .file-checkbox,
    .file-card .file-menu-btn {
        opacity: 1;
    }
    .file-card .file-checkbox {
        width: 1.1rem;
        height: 1.1rem;
    }
    .context-menu-item {
        padding: 12px 14px;
        font-size: 14px;
    }
}

/* Hide horizontal scrollbar on toolbar rows on mobile but keep them scrollable */
#explorer-controls-bar > div,
#breadcrumb-trail,
#multi-action-bar {
    scrollbar-width: none;
}
#explorer-controls-bar > div::-webkit-scrollbar,
#breadcrumb-trail::-webkit-scrollbar,
#multi-action-bar::-webkit-scrollbar {
    display: none;
}

/* Respect iPhone home indicator / safe areas on the mobile bottom nav */
@supports (padding: max(0px)) {
    #screen-dashboard main > nav {
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    }
}
