@use 'mixins' as *;

/* ══════════════════════════════════
   FILES PANEL
   ══════════════════════════════════ */
.files-toolbar {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg1);
}
.files-toolbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}
.files-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    font-family: var(--mono);
    font-size: 12px;
}
.bc-part {
    color: var(--text1);
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
}
.bc-part:hover {
    background: var(--bg3);
    color: var(--text0);
}
.bc-part.root {
    color: var(--accent);
}
.bc-sep {
    color: var(--text2);
}

/* search */
.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.search-wrap svg {
    position: absolute;
    left: 8px;
    color: var(--text2);
    width: 13px;
    height: 13px;
    pointer-events: none;
}
.search-input {
    @include input-base;
    font-size: 13px;
    padding: 5px 10px 5px 27px;
    width: 180px;
    transition:
        border-color var(--transition-normal),
        width var(--transition-slow);
}
.search-input:focus {
    border-color: var(--accent);
    width: 240px;
}
.search-input::placeholder {
    color: var(--text2);
}

/* file table */
.files-scroll {
    @include panel-scroll;
}
.file-table {
    width: 100%;
    border-collapse: collapse;
}
.file-table thead tr {
    background: var(--bg1);
    position: sticky;
    top: 0;
    z-index: 5;
}
.file-table th {
    padding: 8px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.file-table th:hover {
    color: var(--text1);
}
.file-table th.sorted {
    color: var(--accent);
}
.file-table th .sort-arrow {
    display: inline-block;
    margin-left: 4px;
    opacity: 0.5;
    font-size: 10px;
}
.file-table th.sorted .sort-arrow {
    opacity: 1;
    color: var(--accent);
}
.file-table td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.file-table tr:last-child td {
    border-bottom: none;
}
.file-table tbody tr {
    transition: background var(--transition-fast);
}
.file-table tbody tr:hover {
    background: var(--bg2);
}
.file-table tbody tr.selected {
    background: var(--accent-dim);
}

/* file row cells */
.fc-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.fc-name a {
    color: var(--text0);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color var(--transition-normal);
}
.fc-name a:hover {
    color: var(--accent);
}
.file-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text2);
}
.file-icon.dir {
    color: var(--warn);
}
.file-icon.img {
    color: var(--purple);
}
.file-icon.doc {
    color: var(--info);
}
.file-icon.arch {
    color: var(--danger);
}
.file-icon.code {
    color: var(--green);
}
.file-icon.vid {
    color: var(--purple);
}
.file-icon.bin {
    color: var(--text2);
}
.fc-size,
.fc-mtime {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text2);
    white-space: nowrap;
}
.fc-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}
.file-table tbody tr:hover .fc-actions {
    opacity: 1;
}

/* row checkbox */
.row-check {
    width: 32px;
}
.row-check input[type="checkbox"] {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* file type tag */
.ftype {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── drop zone ── */
.dropzone-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.dropzone-overlay.active {
    display: flex;
}
.dropzone-box {
    border: 2px dashed var(--accent);
    border-radius: var(--r-lg);
    padding: 60px 80px;
    text-align: center;
    background: var(--accent-dim);
    animation: pulse-border 1.5s ease-in-out infinite;
}
@keyframes pulse-border {
    0%,
    100% {
        border-color: var(--accent);
    }
    50% {
        border-color: var(--accent-hover);
    }
}
.dropzone-box svg {
    width: 48px;
    height: 48px;
    color: var(--accent);
    margin-bottom: 12px;
}
.dropzone-box p {
    color: var(--text0);
    font-size: 16px;
    font-weight: 600;
}
.dropzone-box small {
    color: var(--text2);
    font-size: 13px;
}

/* ── upload modal parts (drop-area, file list, progress) ── */
.drop-area {
    border: 2px dashed var(--border);
    border-radius: var(--r);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition:
        border-color var(--transition-normal),
        background var(--transition-normal);
    position: relative;
}
.drop-area:hover,
.drop-area.hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.drop-area input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.drop-area svg {
    width: 28px;
    height: 28px;
    color: var(--text2);
    margin-bottom: 6px;
}
.drop-area p {
    font-size: 13px;
    color: var(--text2);
}
.drop-area .hint {
    font-size: 11px;
    color: var(--text2);
    margin-top: 4px;
}
#upload-file-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
}
.upload-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg2);
    border-radius: var(--r);
    font-size: 13px;
}
.upload-file-item .fname {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--mono);
}
.upload-file-item .fsize {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text2);
    white-space: nowrap;
}
.upload-file-item .fremove {
    background: none;
    border: none;
    color: var(--text2);
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
}
.upload-file-item .fremove:hover {
    color: var(--danger);
}
.progress-bar-wrap {
    height: 4px;
    background: var(--bg3);
    border-radius: 2px;
    overflow: hidden;
    display: none;
}
.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width var(--transition-slow);
    width: 0;
}

/* ── mkdir modal input ── */
.form-label {
    font-size: 12px;
    color: var(--text2);
    margin-bottom: 4px;
    display: block;
}
.form-input {
    @include input-base;
    width: 100%;
    padding: 8px 12px;
}

/* ── bulk actions bar ── */
.bulk-bar {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--accent-dim);
    border-bottom: 1px solid var(--accent);
    flex-shrink: 0;
}
.bulk-bar.show {
    display: flex;
}
.bulk-bar-label {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    font-family: var(--mono);
}
.bulk-bar-spacer {
    flex: 1;
}
