/* File-manager specific styles extracted from styles.css to keep concerns separated */
/* Apply this file from archivos.html via <link rel="stylesheet" href="fm.css"> */

/* File manager specific styles to match captura */
.file-manager { 
    /* darker, bluish medium-dark panel to match request */
    background: linear-gradient(180deg,#071133 0%, #060a1a 100%);
    padding:20px;
    border-radius:8px;
    border: 1px solid rgba(255,255,255,0.03);
 }
.fm-header { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.fm-toolbar { display:flex; gap:8px; align-items:center; }
.fm-body { display:flex; gap:18px; margin-top:16px; flex-wrap:wrap; align-items:flex-start; }
.fm-list { 
    flex:1 1 360px; 
    display:flex; 
    flex-direction:column; 
    gap:8px; 
    min-width:240px; 
    background: #080E2E; /* Dark blue background for the listing area */
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}
.fm-item {
    display:flex;
    align-items:center;
    gap:12px;
    padding:12px;
    background: linear-gradient(180deg,#08162f, #0b2a4d);
    border-radius:8px;
    color:#fff;
    cursor:pointer;
    transition:background .15s ease, transform .12s ease;
    position: relative;
    z-index: 0; /* ensure items don't outrank the menu */
}
.fm-item:hover { background: linear-gradient(180deg,#0b2a4d, #0d3a66); transform:translateY(-2px); }
.fm-item i { width:34px; height:34px; display:flex; align-items:center; justify-content:center; background:#5b46d9; border-radius:6px; color:#fff; }
.fm-item .fm-name {
    background: rgba(10,34,70,0.35);
    padding: 6px 10px;
    border-radius: 8px;
    display: inline-block;
    color: #eaf0ff;
}
.fm-item i {
    background: rgba(91,70,217,0.12);
    color: #cfcfff;
    width:36px;
    height:36px;
    border-radius:8px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
}
.fm-name { font-weight:600; color:#ffffff; }

/* Expandable folder children area (simulated) */
.fm-children {
    display: none;
    margin-top: 8px;
    margin-left: 46px; /* align under name */
    padding: 8px 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 6px;
    color: #bfcfe6;
    font-size: 0.95rem;
}
.fm-item.open + .fm-children { display: block; }
.fm-item .caret { margin-left: 8px; color: #b5bac1; font-size: 0.9rem; }
.fm-item.open .caret { transform: rotate(90deg); transition: transform .12s ease; }

/* blue rectangle for name+icon (folders and files) */
.fm-info-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1; /* Allows it to take up space */
    padding: 6px 10px;
    background: rgba(10,34,70,0.65); /* Dark blue rectangle */
    border-radius: 8px;
}

.fm-info-block .fm-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 1rem;
}

.fm-info-block .fm-type {
    color: #b5bac1;
    font-size: 0.85rem;
    font-weight: 400;
}

/* three-dots trigger and contextual menu */
.fm-actions { margin-left: auto; display:flex; gap:8px; align-items:center; position:relative; z-index:0; }
.three-dots {
    background: transparent;
    border: none;
    color: #e6e6e6;
    font-size: 20px;
    width:36px;
    height:36px;
    border-radius:6px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
}
.three-dots:hover { background: rgba(255,255,255,0.02); }
.fm-menu {
    position: absolute;
    right: 0;
    top: 44px;
    min-width:160px;
    background: #071133;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 8px 28px rgba(0,0,0,0.6);
    border-radius:8px;
    display:none;
    flex-direction:column;
    padding:8px;
    z-index: 99999 !important; /* raised so menu always overlays other rows/panels */
}
.fm-menu.active { display:flex; z-index: 99999 !important; }
.fm-menu .fm-menu-item {
    background: transparent;
    border: none;
    color:#eaf0ff;
    padding:8px 10px;
    text-align:left;
    display:flex;
    gap:8px;
    align-items:center;
    font-size:0.95rem;
    border-radius:6px;
    cursor:pointer;
}
.fm-menu .fm-menu-item:hover { background: rgba(255,255,255,0.02); color:#ffffff; }
/* on small screens ensure menu appears above and not cut off */
@media (max-width:600px){
    .fm-menu { top: 40px; right: 0; min-width: 150px; }
}

/* small action group for rows (rename/delete) */
.fm-item .fm-actions button {
    background:#313338;
    border: none;
    color:#fff;
    padding:6px 8px;
    border-radius:6px;
    cursor:pointer;
    font-size:0.9rem;
}
.fm-item .fm-actions button:hover{ background:#3a3b40; }

/* Ensure buttons in fm-toolbar scale on small screens */
@media (max-width:600px){ .fm-toolbar { width:100%; justify-content:flex-start; } .fm-actions { width:100%; display:flex; gap:8px; } }

/* Make upload button larger and readable (icon + label) */
.toolbar-upload-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg,#7D4FFF 0%, #B87CFF 50%, #6A4BFF 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 8px 22px rgba(125,79,255,0.14);
    cursor: pointer;
    text-decoration: none; /* for label usage */
}
.toolbar-upload-button i { font-size:1.05rem; }

/* Dialog styling (fm-dialog) */
.fm-dialog {
    position: fixed;
    inset: 0;
    display: none; /* controlled by JS: openDialog() sets display: flex */
    align-items: center;
    justify-content: center;
    z-index: 3000;
    background: rgba(0,0,0,0.85); /* Increased opacity for isolation */
}

.fm-dialog-box {
    width: 90%;
    max-width: 400px;
    background: #111533;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.9);
    color: #ffffff;
}

@media (max-width:600px){
    .fm-dialog-box {
        width: 95%;
    }
}