/* ============ Category Colors ============ */
:root {
    --cat-image: #ec4899;
    --cat-video: #8b5cf6;
    --cat-audio: #f59e0b;
    --cat-document: #3b82f6;
    --cat-archive: #6b7280;
    --cat-code: #10b981;
    --cat-text: #94a3b8;
    --cat-other: #64748b;
    --cat-folder: #f59e0b;
}

/* ============ View Controls ============ */
.view-controls {
    display: flex;
    gap: 2px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 2px;
    border: 1px solid var(--border);
}

.btn-icon {
    padding: 6px 10px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.15s;
    line-height: 1;
    font-family: inherit;
}

.btn-icon:hover {
    color: var(--text);
}

.btn-icon.active {
    background: var(--primary);
    color: white;
}

/* ============ Sort Select ============ */
.sort-select {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    min-width: 150px;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============ Filter Chips ============ */
.filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.chip {
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.chip:hover {
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-1px);
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ============ File Type Badges ============ */
.file-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    font-family: var(--font-mono);
}

.file-type-badge.image { background: rgba(236, 72, 153, 0.15); color: var(--cat-image); }
.file-type-badge.video { background: rgba(139, 92, 246, 0.15); color: var(--cat-video); }
.file-type-badge.audio { background: rgba(245, 158, 11, 0.15); color: var(--cat-audio); }
.file-type-badge.document { background: rgba(59, 130, 246, 0.15); color: var(--cat-document); }
.file-type-badge.archive { background: rgba(107, 114, 128, 0.15); color: var(--cat-archive); }
.file-type-badge.code { background: rgba(16, 185, 129, 0.15); color: var(--cat-code); }
.file-type-badge.text { background: rgba(148, 163, 184, 0.15); color: var(--cat-text); }
.file-type-badge.other { background: rgba(100, 116, 139, 0.15); color: var(--cat-other); }
.file-type-badge.folder { background: rgba(245, 158, 11, 0.15); color: var(--cat-folder); }

.file-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* ============ Grid View ============ */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 4px;
}

.file-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
    position: relative;
    user-select: none;
    animation: fadeInUp 0.32s var(--ease) both;
}

.file-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--accent-glow);
}

.file-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.file-card-thumb {
    width: 100%;
    height: 140px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.file-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-card-thumb .file-card-icon {
    font-size: 48px;
    opacity: 0.6;
}

.file-card-body {
    padding: 12px;
}

.file-card-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

.file-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Quick action overlay on hover */
.file-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.file-card:hover .file-card-actions {
    opacity: 1;
}

.file-card-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s;
    padding: 0;
}

.file-card-action:hover {
    background: var(--primary);
}

