        /*  - Modern File Manager */
        /* Default to dark theme */
        :root {
            --bg-primary: #1e1e2d;
            --bg-secondary: #151521;
            --bg-tertiary: #1a1a27;
            --bg-hover: #2b2b40;
            --bg-active: #2b2b40;
            --text-primary: #ffffff;
            --text-secondary: #92929f;
            --text-muted: #565674;
            --border-color: #2b2b40;
            --border-light: #323248;
            --accent-color: #009ef7;
            --accent-hover: #0095e8;
            --success-color: #50cd89;
            --danger-color: #f1416c;
            --warning-color: #ffc700;
            --info-color: #7239ea;
            --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
            --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
            --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 6px 10px rgba(0, 0, 0, 0.08);
            --shadow-glow: 0 0 20px rgba(0, 158, 247, 0.15);
            --radius-sm: 0.425rem;
            --radius: 0.625rem;
            --radius-lg: 1rem;
            --transition: all 0.3s ease;
        }

        [data-theme="light"] {
            --bg-primary: #ffffff;
            --bg-secondary: #f5f8fa;
            --bg-tertiary: #ffffff;
            --bg-hover: #f3f6f9;
            --bg-active: #e8f5ff;
            --text-primary: #181c32;
            --text-secondary: #5e6278;
            --text-muted: #a1a5b7;
            --border-color: #eff2f5;
            --border-light: #e4e6ef;
        }

        /* Keep this for backwards compatibility */
        [data-theme="dark"] {
            --bg-primary: #1e1e2d;
            --bg-secondary: #151521;
            --bg-tertiary: #1a1a27;
            --bg-hover: #2b2b40;
            --bg-active: #2b2b40;
            --text-primary: #ffffff;
            --text-secondary: #92929f;
            --text-muted: #565674;
            --border-color: #2b2b40;
            --border-light: #323248;
        }

        /* Font Awesome Icon Colors */
        .fas.fa-home, .fas.fa-folder { color: #f39c12; }
        .fas.fa-file, .fas.fa-file-alt { color: #3498db; }
        .fas.fa-file-pdf { color: #e74c3c; }
        .fas.fa-file-word { color: #2980b9; }
        .fas.fa-file-excel { color: #27ae60; }
        .fas.fa-file-image { color: #9b59b6; }
        .fas.fa-file-audio { color: #e67e22; }
        .fas.fa-file-video { color: #e74c3c; }
        .fas.fa-file-archive { color: #95a5a6; }
        .fas.fa-file-code { color: #8e44ad; }
        .fab.fa-html5 { color: #e34f26; }
        .fab.fa-css3-alt { color: #1572b6; }
        .fab.fa-js-square { color: #f7df1e; }
        .fab.fa-php { color: #777bb4; }
        .fab.fa-python { color: #3776ab; }
        .fab.fa-java { color: #f89820; }
        .fab.fa-git-alt { color: #f05032; }
        .fab.fa-docker { color: #2496ed; }
        .fab.fa-markdown { color: #000000; }
        .fas.fa-database { color: #336791; }
        .fas.fa-cog { color: #7f8c8d; }
        .fas.fa-lock { color: #e74c3c; }
        .fas.fa-hammer { color: #95a5a6; }
        .fas.fa-book-open { color: #3498db; }
        .fas.fa-certificate { color: #f39c12; }
        .fas.fa-clipboard-list { color: #2ecc71; }
        .fas.fa-edit { color: #f39c12; }
        .fas.fa-trash { color: #e74c3c; }
        .fas.fa-download { color: #27ae60; }
        .fas.fa-arrows-alt { color: #3498db; }
        .fas.fa-upload { color: #2ecc71; }
        .fas.fa-sync-alt { color: #3498db; }
        .fas.fa-moon { color: #f39c12; }
        .fas.fa-undo { color: #95a5a6; }
        .fas.fa-eye { color: #9b59b6; }
        .fas.fa-paint-brush { color: #e67e22; }
        .fas.fa-code { color: #2c3e50; }
        .fas.fa-spinner { color: #3498db; }
        .fas.fa-arrow-up { color: #95a5a6; }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
            background: var(--bg-secondary);
            color: var(--text-primary);
            font-size: 13px;
            line-height: 1.5;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* Main Layout */
        .file-manager-container {
            display: flex;
            height: 100vh;
            overflow: hidden;
        }

        /* Sidebar */
        .sidebar {
            width: 265px;
            background: var(--bg-primary);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            transition: var(--transition);
        }

        .sidebar-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .sidebar-logo {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .sidebar-close-btn {
            display: none;
            background: none;
            border: none;
            font-size: 1.5rem;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 0.25rem;
            border-radius: var(--radius);
            transition: var(--transition);
        }

        .sidebar-close-btn:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
        }

        .sidebar-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 99;
            display: none;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .sidebar-overlay.show {
            display: block;
            opacity: 1;
        }

        .sidebar-nav {
            padding: 1.5rem 1rem;
            flex: 1;
            overflow-y: auto;
        }

        .nav-section {
            margin-bottom: 2rem;
        }

        .nav-section-title {
            color: var(--text-muted);
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 0.75rem;
            padding: 0 0.5rem;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.625rem 0.75rem;
            border-radius: var(--radius);
            color: var(--text-secondary);
            text-decoration: none;
            transition: var(--transition);
            margin-bottom: 0.25rem;
            cursor: pointer;
            /* Button reset styles */
            background: transparent;
            border: none;
            font-family: inherit;
            font-size: inherit;
            text-align: left;
            width: 100%;
        }

        .nav-item:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
        }

        .nav-item.active {
            background: var(--bg-active);
            color: var(--accent-color);
            font-weight: 500;
            position: relative;
        }

        .nav-item.active::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 3px;
            height: 60%;
            background: var(--accent-color);
            border-radius: 0 3px 3px 0;
        }

        /* Main Content */
        .main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        /* Toolbar */
        .toolbar {
            background: var(--bg-primary);
            border-bottom: 1px solid var(--border-color);
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            min-height: 70px;
            overflow: hidden;
            width: 100%;
            box-sizing: border-box;
        }

        .toolbar-left {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex: 1;
            min-width: 0;
            overflow: hidden;
        }

        .toolbar-right {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex-wrap: wrap;
            min-width: 0;
            flex-shrink: 1;
            position: relative;
        }

        /* Breadcrumb */
        .breadcrumb {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            color: var(--text-secondary);
            font-size: 0.875rem;
        }

        .breadcrumb-item {
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }

        .breadcrumb-item::after {
            content: '/';
            margin-left: 0.5rem;
            color: var(--text-muted);
            opacity: 0.5;
            font-weight: 300;
        }

        .breadcrumb-item:last-child::after {
            display: none;
        }

        .breadcrumb-link {
            color: var(--text-secondary);
            text-decoration: none;
            transition: all 0.15s ease;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 6px;
            /* Button reset styles */
            background: transparent;
            border: none;
            font-family: inherit;
            font-size: inherit;
        }

        .breadcrumb-link:hover {
            color: var(--accent-color);
            background: var(--bg-hover);
        }

        .breadcrumb-separator {
            color: var(--text-muted);
            opacity: 0.5;
        }

        /* Search Box */
        .search-box {
            position: relative;
            width: 250px;
        }

        .search-input {
            width: 100%;
            padding: 0.5rem 2.5rem 0.5rem 0.75rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius);
            color: var(--text-primary);
            font-size: 0.875rem;
            transition: var(--transition);
        }

        .search-input:focus {
            outline: none;
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px rgba(0, 158, 247, 0.15);
        }

        .search-icon {
            position: absolute;
            right: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            cursor: pointer;
        }

        /* Buttons */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            border: none;
            border-radius: var(--radius);
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            white-space: nowrap;
            position: relative;
            overflow: hidden;
        }

        .btn::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(rgba(255,255,255,0.1), transparent);
            opacity: 0;
            transition: opacity 0.2s;
        }

        .btn:hover::after {
            opacity: 1;
        }

        .btn:active {
            transform: scale(0.97);
        }

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

        .btn-primary:hover {
            background: var(--accent-hover);
            transform: translateY(-1px);
        }

        .btn-light {
            background: var(--bg-secondary);
            color: var(--text-secondary);
            border: 1px solid var(--border-light);
        }

        .btn-light:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
        }

        .btn-success {
            background: var(--success-color);
            color: white;
        }

        .btn-sm {
            padding: 0.375rem 0.75rem;
            font-size: 0.875rem;
        }

        .btn-danger {
            background: var(--danger-color);
            color: white;
        }

        .btn-danger i {
            color: white !important;
        }

        .btn-icon-only {
            padding: 0.5rem;
            width: 36px;
            height: 36px;
        }

        /* File List Container */
        .file-list-container {
            flex: 1;
            overflow: auto;
            background: var(--bg-secondary);
            padding: 1.5rem;
        }

        /* View Toggle */
        .view-toggle {
            display: flex;
            background: var(--bg-secondary);
            border-radius: var(--radius);
            padding: 2px;
        }

        .view-toggle-btn {
            padding: 0.375rem 0.75rem;
            background: transparent;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            border-radius: var(--radius-sm);
            transition: var(--transition);
        }

        .view-toggle-btn.active {
            background: var(--bg-primary);
            color: var(--text-primary);
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        /* File Grid View */
        .file-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 1rem;
        }

        .file-grid-item {
            background: var(--bg-primary);
            border: 2px solid transparent;
            border-radius: var(--radius-lg);
            padding: 1.5rem 1rem;
            text-align: center;
            cursor: pointer;
            transition: var(--transition);
            position: relative;
        }

        .file-grid-item:hover {
            transform: translateY(-4px) scale(1.02);
            box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
            border-color: var(--accent-color);
        }

        .file-grid-item.selected {
            background: var(--bg-active);
            border-color: var(--accent-color);
        }

        .file-grid-checkbox {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            width: 18px;
            height: 18px;
        }

        .file-grid-icon {
            font-size: 3rem;
            margin-bottom: 0.75rem;
        }

        .file-grid-name {
            font-size: 0.875rem;
            color: var(--text-primary);
            font-weight: 500;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .file-grid-size {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 0.25rem;
        }

        /* File List View */
        .file-list-table {
            width: 100%;
            background: var(--bg-primary);
            border-radius: var(--radius-lg);
            overflow: hidden;
        }

        .file-list-header {
            display: grid;
            grid-template-columns: 46px 28px 40px 1fr 120px 150px 150px 100px;
            padding: 1rem 1.5rem;
            background: var(--bg-tertiary);
            border-bottom: 2px solid var(--border-color);
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .sortable-header {
            cursor: pointer;
            user-select: none;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }

        .sortable-header:hover {
            color: var(--accent-color);
        }

        .sort-indicator {
            font-size: 0.6rem;
            opacity: 0.5;
        }

        .sortable-header.active {
            color: var(--accent-color);
        }

        .sortable-header.active .sort-indicator {
            opacity: 1;
        }

        .file-list-item {
            display: grid;
            grid-template-columns: 46px 28px 40px 1fr 120px 150px 150px 100px;
            padding: 0.75rem 1.5rem;
            border-bottom: 1px solid var(--border-color);
            border-left: 3px solid transparent;
            align-items: center;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .file-list-item:hover {
            background: var(--bg-hover);
            transform: translateX(4px);
            border-left-color: var(--accent-color);
        }

        .file-list-item.selected {
            background: var(--bg-active);
        }

        .file-grid-item.parent-dir,
        .file-list-item.parent-dir {
            opacity: 0.8;
            font-weight: 600;
        }

        .file-grid-item.parent-dir:hover,
        .file-list-item.parent-dir:hover {
            opacity: 1;
            background: var(--bg-hover);
        }

        .file-checkbox {
            appearance: none;
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            border: 2px solid var(--border-light);
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s ease;
            position: relative;
            background: var(--bg-secondary);
        }

        .file-checkbox:hover {
            border-color: var(--accent-color);
        }

        .file-checkbox:checked {
            background: var(--accent-color);
            border-color: var(--accent-color);
        }

        .file-checkbox:checked::after {
            content: '';
            position: absolute;
            left: 5px;
            top: 2px;
            width: 4px;
            height: 8px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }

        #selectAllCheckbox {
            appearance: none;
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            border: 2px solid var(--border-light);
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s ease;
            position: relative;
            background: var(--bg-secondary);
        }

        #selectAllCheckbox:hover {
            border-color: var(--accent-color);
        }

        #selectAllCheckbox:checked {
            background: var(--accent-color);
            border-color: var(--accent-color);
        }

        #selectAllCheckbox:checked::after {
            content: '';
            position: absolute;
            left: 5px;
            top: 2px;
            width: 4px;
            height: 8px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }

        .file-icon {
            font-size: 1.5rem;
        }

        .file-name {
            font-weight: 500;
            color: var(--text-primary);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .file-date, .file-size, .file-extension {
            color: var(--text-secondary);
            font-size: 0.875rem;
        }

        .file-actions {
            display: flex;
            gap: 0.25rem;
            opacity: 0;
            transition: var(--transition);
        }

        .file-list-item:hover .file-actions {
            opacity: 1;
        }

        .action-btn {
            padding: 0.25rem;
            background: transparent;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            border-radius: var(--radius-sm);
            transition: var(--transition);
        }

        .action-btn:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
        }

        /* Status Bar */
        .status-bar {
            background: linear-gradient(to right, var(--bg-primary), var(--bg-tertiary));
            border-top: 1px solid var(--border-color);
            padding: 0.75rem 1.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        .status-left span,
        .status-right span {
            padding: 4px 10px;
            background: var(--bg-secondary);
            border-radius: 12px;
            font-size: 0.7rem;
            font-weight: 500;
        }

        /* Modals */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal.show {
            display: flex;
            animation: fadeIn 0.2s ease;
        }

        .modal-content {
            background: rgba(30, 30, 45, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-lg);
            max-width: 500px;
            width: 90%;
            max-height: 90vh;
            overflow: auto;
            box-shadow: var(--shadow-lg);
            animation: slideUp 0.3s ease;
        }

        [data-theme="light"] .modal-content {
            background: rgba(255, 255, 255, 0.95);
            border: 1px solid rgba(0, 0, 0, 0.1);
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .modal-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--border-color);
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .modal-body {
            padding: 1.5rem;
        }

        .modal-footer {
            padding: 1.5rem;
            border-top: 1px solid var(--border-color);
            display: flex;
            justify-content: flex-end;
            gap: 0.75rem;
        }

        /* Form Elements */
        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
            color: var(--text-primary);
        }

        .form-control {
            width: 100%;
            padding: 0.625rem 0.75rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius);
            color: var(--text-primary);
            font-size: 0.875rem;
            transition: var(--transition);
        }

        .form-control:focus {
            outline: none;
            border-color: var(--accent-color);
            background: var(--bg-primary);
            box-shadow: 0 0 0 3px rgba(0, 158, 247, 0.15);
        }
        
        /* Move items styling */
        .move-item {
            padding: 0.5rem 0.75rem;
            background: var(--bg-secondary);
            border-radius: var(--radius);
            margin-bottom: 0.5rem;
            border: 1px solid var(--border-light);
            font-size: 0.875rem;
            color: var(--text-primary);
        }
        
        .form-text {
            color: var(--text-muted);
            font-size: 0.75rem;
            margin-top: 0.25rem;
        }
        
        /* Move modal styling */
        .move-destination-options {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }
        
        .folder-picker {
            border: 1px solid var(--border-light);
            border-radius: var(--radius);
            background: var(--bg-secondary);
            max-height: 200px;
            overflow-y: auto;
            padding: 0.5rem;
        }
        
        .folder-picker-item {
            padding: 0.5rem 0.75rem;
            cursor: pointer;
            border-radius: var(--radius);
            margin-bottom: 0.25rem;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: var(--text-primary);
            /* Make focusable */
            outline: none;
        }

        .folder-picker-item[tabindex] {
            cursor: pointer;
        }
        
        .folder-picker-item:hover {
            background: var(--bg-hover);
        }
        
        .folder-picker-item.selected {
            background: var(--accent-color);
            color: white;
        }
        
        .folder-picker-item.current-folder {
            background: var(--bg-primary);
            border: 2px solid var(--accent-color);
            font-weight: bold;
            color: var(--text-primary);
        }
        
        .folder-breadcrumb {
            padding: 0.5rem;
            background: var(--bg-secondary);
            border-radius: var(--radius);
            margin-bottom: 0.5rem;
            font-size: 0.875rem;
            color: var(--text-primary);
        }
        
        .folder-breadcrumb .breadcrumb-link {
            color: var(--accent-color);
            cursor: pointer;
            text-decoration: none;
            /* Button reset */
            background: transparent;
            border: none;
            padding: 2px 4px;
            font-family: inherit;
            font-size: inherit;
        }

        .folder-breadcrumb .breadcrumb-link:hover {
            text-decoration: underline;
        }

        .folder-breadcrumb .breadcrumb-link:focus-visible {
            outline: 2px solid var(--accent-color);
            outline-offset: 2px;
        }
        
        .selected-path {
            padding: 0.5rem;
            background: var(--bg-primary);
            border-radius: var(--radius);
            margin-top: 0.5rem;
            font-size: 0.875rem;
            color: var(--text-primary);
        }
        
        .folder-picker-loading {
            text-align: center;
            padding: 1rem;
            color: var(--text-muted);
        }

        /* Loading Spinner */
        .spinner {
            width: 20px;
            height: 20px;
            border: 2px solid var(--border-light);
            border-top-color: var(--accent-color);
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
            display: inline-block;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .loading-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(21, 21, 33, 0.95);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 100;
        }

        [data-theme="light"] .loading-overlay {
            background: rgba(255, 255, 255, 0.9);
        }

        /* Mobile Menu Toggle */
        .mobile-menu-toggle {
            display: none;
            padding: 0.5rem;
            background: transparent;
            border: none;
            color: var(--text-primary);
            font-size: 1.5rem;
            cursor: pointer;
        }

        /* Responsive */
        /* Responsive toolbar - progressive button hiding */
        @media (max-width: 1300px) {
            /* Hide Move, show More button */
            .toolbar-btn-move {
                display: none;
            }
            .mobile-more-btn {
                display: inline-block !important;
            }
        }
        
        @media (max-width: 1100px) {
            /* Hide Download, Move */
            .toolbar-btn-download,
            .toolbar-btn-move {
                display: none;
            }
            .toolbar {
                gap: 0.5rem;
            }
            .toolbar-right {
                gap: 0.25rem;
            }
            .toolbar .btn {
                padding: 0.5rem 0.75rem;
                font-size: 13px;
            }
        }
        
        @media (max-width: 900px) {
            /* Hide Edit, Download, Move */
            .toolbar-btn-edit,
            .toolbar-btn-download,
            .toolbar-btn-move {
                display: none;
            }
        }
        
        @media (max-width: 1024px) {
            .sidebar {
                position: fixed;
                left: -265px;
                z-index: 100;
                height: 100vh;
                box-shadow: var(--shadow-lg);
                transition: transform 0.3s ease;
            }
            
            .sidebar.open {
                transform: translateX(265px);
            }
            
            .mobile-menu-toggle {
                display: block;
            }
            
            .sidebar-close-btn {
                display: block;
            }
            
            .search-box {
                width: 200px;
            }
        }

        @media (max-width: 768px) {
            .file-grid {
                grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            }
            
            .toolbar {
                padding: 0.5rem;
                flex-wrap: wrap;
                min-height: auto;
                gap: 0.5rem;
            }
            
            .toolbar-left {
                width: 100%;
                margin-bottom: 0.5rem;
                flex-wrap: wrap;
                gap: 0.5rem;
            }
            
            .toolbar-right {
                width: 100%;
                justify-content: center;
                flex-wrap: wrap;
                gap: 0.25rem;
            }
            
            .toolbar .btn {
                padding: 0.375rem 0.5rem;
                font-size: 12px;
                margin: 0;
                min-width: auto;
            }
            
            .search-box {
                width: 100%;
                max-width: none;
                margin-top: 0.5rem;
            }
            
            .search-input {
                font-size: 14px;
                padding: 0.5rem;
            }
            
            .mobile-menu-toggle {
                padding: 0.5rem;
                font-size: 16px;
            }
            
            .view-toggle {
                gap: 2px;
            }
            
            .view-toggle-btn {
                padding: 0.375rem 0.5rem;
                font-size: 12px;
            }
            
            .file-list-header,
            .file-list-item {
                grid-template-columns: 46px 28px 40px 1fr 80px;
            }

            .file-date, .file-extension, .file-actions {
                display: none;
            }
            
            .breadcrumb {
                display: none;
            }
            
            /* Mobile editor modal improvements */
            #editorModal .modal-content {
                max-width: 100% !important;
                width: 100% !important;
                height: 100vh !important;
                margin: 0 !important;
                border-radius: 0 !important;
                max-height: 100vh !important;
            }
            
            #editorModal .modal-header {
                flex-wrap: wrap;
                padding: 0.5rem !important;
                min-height: auto;
            }
            
            #editorModal .modal-header > div:first-child {
                font-size: 14px;
                margin-bottom: 0.5rem;
                width: 100%;
            }
            
            #editorModal .modal-header > div:last-child {
                gap: 5px !important;
                width: 100%;
                justify-content: flex-start;
            }
            
            #editorModal .modal-header .btn {
                padding: 0.25rem 0.5rem;
                font-size: 12px;
            }
            
            #editorModal .modal-body {
                height: calc(100vh - 140px) !important;
                padding: 0 !important;
                margin-bottom: 80px; /* Account for fixed footer */
            }
            
            #editorModal .modal-footer {
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                background: var(--bg-primary);
                border-top: 2px solid var(--border-color);
                z-index: 1001;
                padding: 0.75rem !important;
                flex-wrap: wrap;
                box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            }
            
            #editorModal .modal-footer > div {
                width: 100%;
                margin-bottom: 0.5rem;
            }
            
            #editorModal .modal-footer > div:last-child {
                justify-content: center;
                margin-bottom: 0;
            }
            
            #editorModal .modal-footer .btn {
                padding: 0.5rem 1rem;
                margin: 0 0.25rem;
                font-size: 14px;
                min-width: 80px;
            }
            
            #editorModal #codeEditor {
                font-size: 12px !important;
                padding: 10px !important;
            }
            
            #editorModal #editorStatus {
                font-size: 12px;
                text-align: center;
                display: block;
            }
        }

        /* Mobile Actions Dropdown */
        .mobile-actions-dropdown {
            background: var(--bg-primary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            padding: 0.5rem;
            max-height: 300px;
            overflow-y: auto;
        }
        
        .mobile-actions-dropdown .btn {
            width: 100%;
            margin-bottom: 0.25rem;
            justify-content: flex-start;
            text-align: left;
            background: var(--bg-secondary);
            border: 1px solid var(--border-light);
            color: var(--text-primary);
        }
        
        .mobile-actions-dropdown .btn:hover {
            background: var(--bg-hover);
        }
        
        .mobile-actions-dropdown .btn:last-child {
            margin-bottom: 0;
        }

        @media (max-width: 480px) {
            /* Extra small screens - hide most toolbar buttons and show more button */
            .toolbar-btn-newfile,
            .toolbar-btn-newfolder,
            .toolbar-btn-edit,
            .toolbar-btn-download,
            .toolbar-btn-move {
                display: none;
            }
            
            .mobile-more-btn {
                display: inline-block !important;
            }
            
            .toolbar .btn {
                padding: 0.25rem 0.375rem;
                font-size: 11px;
            }
            
            .breadcrumb {
                font-size: 12px;
            }
            
            .search-box {
                margin-top: 0.25rem;
            }
            
            .toolbar {
                padding: 0.25rem;
                position: relative;
            }
            
            .toolbar-left {
                margin-bottom: 0.25rem;
            }
        }

        /* Auto-completion hint styling */
        .CodeMirror-hints {
            max-height: 200px;
            overflow-y: auto;
            font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
            font-size: 13px;
            z-index: 10000 !important; /* Higher than modal (1001) */
            position: absolute !important;
            background: white;
            border: 1px solid #ddd;
            box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        }

        .CodeMirror-hint {
            padding: 4px 8px;
            border-radius: 3px;
            cursor: pointer;
            position: relative;
            z-index: 10001;
        }

        .CodeMirror-hint-active {
            background: #007acc;
            color: white;
        }

        .cm-variable-hint {
            color: #e06c75;
            font-weight: 500;
        }

        .cm-function-hint {
            color: #61afef;
            font-weight: 500;
        }

        .cm-builtin-hint {
            color: #c678dd;
            font-weight: 500;
        }

        .cm-word-hint {
            color: #98c379;
            font-weight: normal;
        }

        /* Dark theme hints */
        body[data-theme="dark"] .CodeMirror-hints {
            background: #2b2b2b;
            border: 1px solid #444;
            z-index: 10000 !important; /* Maintain high z-index in dark theme */
        }

        body[data-theme="dark"] .CodeMirror-hint {
            color: #abb2bf;
        }

        body[data-theme="dark"] .CodeMirror-hint.CodeMirror-hint-active {
            background: #3e4451;
            color: #ffffff;
        }

        /* Variable/selection highlighting styles */
        .cm-matchhighlight {
            background: #ffd700;
            background: rgba(255, 215, 0, 0.4);
            border-radius: 2px;
            animation: highlightPulse 0.3s ease-in-out;
        }

        .CodeMirror-selectedtext {
            background: #3390ff !important;
            background: rgba(51, 144, 255, 0.3) !important;
            color: inherit !important;
        }

        /* Scrollbar match annotations */
        .CodeMirror-search-match {
            background: #ffff00;
            border: 1px solid #999;
        }

        /* Dark theme match highlighting */
        body[data-theme="dark"] .cm-matchhighlight {
            background: #4a4a00;
            background: rgba(255, 215, 0, 0.3);
        }

        body[data-theme="dark"] .CodeMirror-selectedtext {
            background: #1a4480 !important;
            background: rgba(51, 144, 255, 0.4) !important;
        }

        /* Highlight pulse animation */
        @keyframes highlightPulse {
            0% { background: rgba(255, 215, 0, 0.8); }
            100% { background: rgba(255, 215, 0, 0.4); }
        }

        /* Context Menu */
        .context-menu {
            position: fixed;
            background: var(--bg-primary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
            box-shadow: var(--shadow-lg);
            min-width: 200px;
            z-index: 10000;
            overflow: hidden;
            animation: contextMenuFadeIn 0.15s ease;
        }

        @keyframes contextMenuFadeIn {
            from {
                opacity: 0;
                transform: scale(0.95);
            }
            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        .context-menu-item {
            padding: 0.625rem 1rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            color: var(--text-primary);
            font-size: 0.875rem;
            transition: background 0.15s ease;
            user-select: none;
            /* Button reset styles */
            background: transparent;
            border: none;
            font-family: inherit;
            width: 100%;
            text-align: left;
        }

        .context-menu-item:hover {
            background: var(--bg-hover);
        }

        .context-menu-item i {
            width: 16px;
            text-align: center;
            color: var(--text-muted);
        }

        .context-menu-divider {
            height: 1px;
            background: var(--border-light);
            margin: 0.25rem 0;
        }

        .context-menu-item.disabled {
            opacity: 0.5;
            cursor: not-allowed;
            pointer-events: none;
        }

        /* Dark theme context menu */
        body[data-theme="dark"] .context-menu {
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
        }

        /* Drag selection rectangle */
        .drag-selection-rect {
            position: fixed;
            border: 2px solid var(--accent-color);
            background: rgba(0, 158, 247, 0.1);
            pointer-events: none;
            z-index: 10000;
            border-radius: 2px;
        }

        /* Prevent text selection during drag */
        .drag-selecting {
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
        }

        /* Drag and drop styles */
        .file-grid-item.dragging,
        .file-list-item.dragging {
            opacity: 0.5;
            cursor: move;
        }

        .file-grid-item.drag-over,
        .file-list-item.drag-over {
            background: var(--accent-color) !important;
            border: 2px dashed var(--accent-color);
            opacity: 0.8;
        }

        .file-grid-item.drag-over .file-grid-name,
        .file-list-item.drag-over .file-name {
            color: white;
            font-weight: bold;
        }

        /* Drop zone for individual breadcrumb items */
        .breadcrumb-item.breadcrumb-item-drop-active {
            background: var(--accent-color);
            border: 2px solid rgba(255, 255, 255, 0.8);
            border-radius: 6px;
            box-shadow: 0 0 12px rgba(0, 158, 247, 0.6);
            transform: scale(1.08);
            transition: all 0.15s ease;
            padding: 2px 8px;
            margin: -2px -8px; /* Compensate for padding */
        }

        .breadcrumb-item.breadcrumb-item-drop-active .breadcrumb-link {
            color: white !important;
            font-weight: bold;
        }

        .breadcrumb-drop-target {
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .breadcrumb-drop-target:hover {
            opacity: 0.8;
        }

        .file-grid-item[draggable="true"],
        .file-list-item[draggable="true"] {
            cursor: pointer;
        }

        /* Expandable folder tree styles */
        .folder-expand-icon {
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: var(--text-secondary);
            transition: var(--transition);
            font-size: 14px;
            font-weight: 600;
        }

        .folder-expand-icon:hover {
            color: var(--accent-color);
            background: var(--bg-hover);
            border-radius: 4px;
        }

        .folder-expand-icon.expanded {
            transform: rotate(90deg);
        }

        .file-list-item[data-depth] {
            padding-left: calc(1.5rem + var(--indent-level) * 25px);
        }

        .file-list-item.nested {
            background: var(--bg-secondary);
        }

        .file-list-item.nested:hover {
            background: var(--bg-hover);
        }

        .folder-expand-icon.loading {
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /* Empty State */
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 4rem 2rem;
            color: var(--text-muted);
            text-align: center;
        }

        .empty-state-icon {
            font-size: 4rem;
            margin-bottom: 1rem;
            opacity: 0.3;
            color: var(--text-secondary);
        }

        .empty-state-text {
            font-size: 1.1rem;
            margin-bottom: 0.5rem;
            color: var(--text-secondary);
        }

        .empty-state-hint {
            font-size: 0.875rem;
            opacity: 0.7;
        }

        /* File Extension Badges */
        .file-extension-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 0.65rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .file-extension-badge[data-ext="php"] { background: rgba(119, 123, 180, 0.2); color: #777bb4; }
        .file-extension-badge[data-ext="js"] { background: rgba(247, 223, 30, 0.2); color: #f0db4f; }
        .file-extension-badge[data-ext="css"] { background: rgba(21, 114, 182, 0.2); color: #1572b6; }
        .file-extension-badge[data-ext="html"] { background: rgba(227, 79, 38, 0.2); color: #e34f26; }
        .file-extension-badge[data-ext="json"] { background: rgba(128, 128, 128, 0.2); color: #808080; }
        .file-extension-badge[data-ext="md"] { background: rgba(0, 0, 0, 0.15); color: var(--text-secondary); }
        .file-extension-badge[data-ext="txt"] { background: rgba(128, 128, 128, 0.15); color: var(--text-secondary); }
        .file-extension-badge[data-ext="py"] { background: rgba(55, 118, 171, 0.2); color: #3776ab; }
        .file-extension-badge[data-ext="sql"] { background: rgba(51, 103, 145, 0.2); color: #336791; }
        .file-extension-badge[data-ext="xml"] { background: rgba(227, 79, 38, 0.15); color: #e34f26; }
        .file-extension-badge[data-ext="yml"],
        .file-extension-badge[data-ext="yaml"] { background: rgba(203, 56, 55, 0.2); color: #cb3837; }
        .file-extension-badge[data-ext="jpg"],
        .file-extension-badge[data-ext="jpeg"],
        .file-extension-badge[data-ext="png"],
        .file-extension-badge[data-ext="gif"],
        .file-extension-badge[data-ext="svg"],
        .file-extension-badge[data-ext="webp"] { background: rgba(155, 89, 182, 0.2); color: #9b59b6; }
        .file-extension-badge[data-ext="pdf"] { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
        .file-extension-badge[data-ext="zip"],
        .file-extension-badge[data-ext="rar"],
        .file-extension-badge[data-ext="7z"],
        .file-extension-badge[data-ext="tar"],
        .file-extension-badge[data-ext="gz"] { background: rgba(149, 165, 166, 0.2); color: #95a5a6; }

        /* Skeleton Loading Animation */
        .skeleton {
            background: linear-gradient(
                90deg,
                var(--bg-secondary) 25%,
                var(--bg-hover) 50%,
                var(--bg-secondary) 75%
            );
            background-size: 200% 100%;
            animation: shimmer 1.5s infinite;
            border-radius: var(--radius);
        }

        .skeleton-row {
            height: 50px;
            margin-bottom: 8px;
            border-radius: var(--radius);
        }

        .skeleton-grid-item {
            height: 120px;
            border-radius: var(--radius-lg);
        }

        @keyframes shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        /* Visually hidden class for screen readers */
        .visually-hidden {
            position: absolute !important;
            width: 1px !important;
            height: 1px !important;
            padding: 0 !important;
            margin: -1px !important;
            overflow: hidden !important;
            clip: rect(0, 0, 0, 0) !important;
            white-space: nowrap !important;
            border: 0 !important;
        }

        /* Skip link for keyboard navigation */
        .skip-link {
            position: absolute;
            top: -40px;
            left: 0;
            background: var(--accent-color);
            color: white;
            padding: 8px 16px;
            z-index: 10001;
            text-decoration: none;
            font-weight: 600;
            border-radius: 0 0 var(--radius) 0;
            transition: top 0.3s ease;
        }

        .skip-link:focus {
            top: 0;
            outline: 2px solid white;
            outline-offset: 2px;
        }

        /* Focus ring for accessibility - Enhanced */
        .btn:focus-visible,
        .file-checkbox:focus-visible,
        .form-control:focus-visible,
        .nav-item:focus-visible,
        .view-toggle-btn:focus-visible,
        .action-btn:focus-visible,
        .breadcrumb-link:focus-visible,
        .context-menu-item:focus-visible,
        .folder-picker-item:focus-visible,
        .mobile-menu-toggle:focus-visible,
        .sidebar-close-btn:focus-visible {
            outline: 2px solid var(--accent-color);
            outline-offset: 2px;
        }

        /* Focus visible on file items */
        .file-list-item:focus-visible,
        .file-grid-item:focus-visible {
            outline: 2px solid var(--accent-color);
            outline-offset: -2px;
            background: var(--bg-hover);
        }

        /* Focus visible on file list container */
        #fileList:focus-visible {
            outline: 2px solid var(--accent-color);
            outline-offset: 2px;
        }

        /* Focus visible on context menu */
        .context-menu-item:focus,
        .context-menu-item:focus-visible {
            background: var(--bg-hover);
            outline: 2px solid var(--accent-color);
            outline-offset: -2px;
        }

        /* Focus visible on folder picker items */
        .folder-picker-item:focus,
        .folder-picker-item:focus-visible {
            outline: 2px solid var(--accent-color);
            outline-offset: -2px;
            background: var(--bg-hover);
        }

        /* Keyboard focus indicator for file items */
        .file-list-item.keyboard-focus,
        .file-grid-item.keyboard-focus {
            outline: 2px solid var(--accent-color);
            outline-offset: -2px;
            background: var(--bg-hover);
        }

        /* Remove default focus outline only when using custom focus styles */
        .btn:focus:not(:focus-visible),
        .nav-item:focus:not(:focus-visible),
        .action-btn:focus:not(:focus-visible) {
            outline: none;
        }

        /* High contrast mode support */
        @media (prefers-contrast: high) {
            .btn:focus-visible,
            .file-list-item:focus-visible,
            .file-grid-item:focus-visible,
            .nav-item:focus-visible,
            .context-menu-item:focus-visible {
                outline: 3px solid currentColor;
                outline-offset: 2px;
            }
        }

        /* Reduced motion support */
        @media (prefers-reduced-motion: reduce) {
            *,
            *::before,
            *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }

        /* Smooth scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        ::-webkit-scrollbar-track {
            background: var(--bg-secondary);
            border-radius: 4px;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--border-light);
            border-radius: 4px;
            transition: background 0.2s;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--text-muted);
        }

        /* Keyboard shortcut key styling */
        kbd {
            display: inline-block;
            padding: 3px 8px;
            font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
            font-size: 12px;
            line-height: 1.2;
            color: var(--text-primary);
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 4px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
            white-space: nowrap;
            min-width: 20px;
            text-align: center;
        }

        .shortcut-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            color: var(--text-secondary);
        }

        .shortcut-item kbd {
            flex-shrink: 0;
        }

        /* Selection highlight color */
        ::selection {
            background: var(--accent-color);
            color: white;
        }


