/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    /* Color Palette */
    --bg-base: #080a10;
    --bg-surface: #0f131f;
    --bg-surface-hover: #171d2f;
    --bg-glass: rgba(15, 19, 31, 0.7);
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(99, 102, 241, 0.4);
    
    --accent: #6366f1; /* Indigo */
    --accent-glow: rgba(99, 102, 241, 0.35);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    
    --success: #10b981; /* Emerald */
    --success-glow: rgba(16, 185, 129, 0.2);
    --warning: #f59e0b; /* Amber */
    --danger: #ef4444; /* Rose */
    --danger-hover: #dc2626;
    --danger-glow: rgba(239, 68, 68, 0.2);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Layout & Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease-out;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-surface-hover);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Helpers */
.hidden {
    display: none !important;
}

/* ==========================================================================
   GLASSMORPHISM & GLASS PANEL
   ========================================================================== */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: var(--bg-glass);
    border-color: var(--accent);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 14px var(--danger-glow);
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
}

.btn-text:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.btn-icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 !important;
    transition: var(--transition-smooth);
}

.btn-icon-only:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--bg-surface-hover);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

.upload-btn-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.upload-btn-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

/* ==========================================================================
   AUTH SCREEN (LOGIN)
   ========================================================================== */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.12) 0%, transparent 40%),
                var(--bg-base);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-badge {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 20px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px var(--accent-glow);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: white;
}

.auth-header h2 {
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition-fast);
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

.input-wrapper input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--border-focus);
    background: var(--bg-surface-hover);
}

.input-wrapper input:focus + .input-icon {
    color: var(--accent);
}

.password-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
}

.password-toggle:hover {
    color: var(--text-primary);
}

.error-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--danger-glow);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 12px;
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 0.88rem;
    margin-bottom: 20px;
    animation: shake 0.4s ease-in-out;
}

/* ==========================================================================
   APP LAYOUT (WORKSPACE)
   ========================================================================== */
.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    height: 100%;
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-glass);
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.brand-icon {
    width: 20px;
    height: 20px;
    color: #fff;
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.sidebar-actions {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-nav {
    flex: 1;
    padding: 0 16px;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
}

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

.nav-item.active a {
    background: var(--bg-surface-hover);
    color: var(--accent);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-glass);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-info .username {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-info .role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-icon-logout {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.btn-icon-logout:hover {
    color: var(--danger);
    background: var(--danger-glow);
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 60%),
                var(--bg-base);
}

/* Header */
.app-header {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-glass);
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 10px 40px 10px 38px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.search-bar input:focus {
    border-color: var(--accent);
    background: var(--bg-surface-hover);
}

#clear-search {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

#clear-search:hover {
    color: var(--text-primary);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-text {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--success);
}

/* Explorer Wrapper */
.explorer-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 32px;
    overflow: hidden;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 500;
}

.breadcrumb-item {
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.breadcrumb-item:hover {
    color: var(--accent);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    cursor: default;
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-weight: 300;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Explorer Body */
.explorer-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 40px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.01);
    border: 1.5px dashed var(--border-glass);
    border-radius: var(--radius-lg);
}

.empty-illustration {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: var(--bg-surface-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.empty-icon {
    width: 38px;
    height: 38px;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Loading Skeletons */
.loading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.skeleton-card {
    height: 80px;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-surface-hover) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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

/* Files & Folders Grid */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.explorer-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    cursor: pointer;
    position: relative;
    user-select: none;
    transition: var(--transition-smooth);
}

.explorer-item:hover {
    background: var(--bg-surface-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.item-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.folder-item .item-icon-wrapper {
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent);
}

.folder-item:hover .item-icon-wrapper {
    background: var(--accent);
    color: white;
}

.file-item .item-icon-wrapper {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

/* Colored file extensions */
.file-image .item-icon-wrapper {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}
.file-video .item-icon-wrapper {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
}
.file-pdf .item-icon-wrapper {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.file-archive .item-icon-wrapper {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}
.file-code .item-icon-wrapper {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    position: absolute;
    right: 8px;
    background: var(--bg-surface-hover);
    padding-left: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.explorer-item:hover .item-actions {
    opacity: 1;
}

.btn-item-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-item-action:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.btn-item-action.delete:hover {
    color: var(--danger);
    background: var(--danger-glow);
}

/* ==========================================================================
   MODALS / DIALOGS
   ========================================================================== */
.modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-card {
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.btn-close-modal:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.modal-body {
    margin-bottom: 24px;
}

.modal-body p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.warning-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--warning);
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
}

.modal-body input[type=text] {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: var(--transition-smooth);
}

.modal-body input[type=text]:focus {
    border-color: var(--accent);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Preview Modal Specifics */
.preview-modal-card {
    max-width: 900px;
    width: 90%;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.preview-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

#preview-icon {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

#preview-filename {
    font-size: 1.15rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 500px;
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #040509;
    border-radius: var(--radius-md);
    margin-bottom: 0;
    position: relative;
}

.preview-content-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 10px;
}

.preview-content-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.preview-content-container video {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius-sm);
    outline: none;
}

.preview-text-viewer {
    width: 100%;
    height: 100%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    background: transparent;
    color: #e2e8f0;
    border: none;
    outline: none;
    resize: none;
    padding: 20px;
    white-space: pre;
    tab-size: 4;
}

/* ==========================================================================
   FLOATING UPLOAD MANAGER
   ========================================================================== */
.upload-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 360px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    z-index: 90;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-widget.minimized {
    transform: translateY(calc(100% - 48px));
}

.widget-header {
    background: var(--bg-surface-hover);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-glass);
    cursor: pointer;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.widget-title i {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

#btn-minimize-upload {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

#btn-minimize-upload:hover {
    color: var(--text-primary);
}

.widget-body {
    max-height: 280px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.upload-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    flex: 1;
}

.upload-item-status-icon {
    width: 16px;
    height: 16px;
}

.upload-item-status-icon.loading {
    animation: rotate 1s linear infinite;
    color: var(--accent);
}
.upload-item-status-icon.success {
    color: var(--success);
}
.upload-item-status-icon.error {
    color: var(--danger);
}

.progress-bar-container {
    height: 4px;
    background: var(--bg-surface-hover);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 0.15s ease-out;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 110;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: rgba(15, 19, 31, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 280px;
    max-width: 380px;
    animation: slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast.success {
    border-left: 4px solid var(--success);
}
.toast.success i {
    color: var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}
.toast.error i {
    color: var(--danger);
}

.toast.info {
    border-left: 4px solid var(--accent);
}
.toast.info i {
    color: var(--accent);
}

@keyframes slide-in {
    0% { transform: translateX(120%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes fade-out {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* ==========================================================================
   DRAG AND DROP OVERLAY
   ========================================================================== */
#drop-zone-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(99, 102, 241, 0.12);
    backdrop-filter: blur(8px);
    z-index: 105;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px dashed var(--accent);
    margin: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.overlay-content {
    text-align: center;
    animation: float 2s ease-in-out infinite;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--accent);
    margin-bottom: 16px;
}

.overlay-content p {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-scale {
    animation: scale-up 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scale-up {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.animate-glow {
    animation: glow-pulse 2s infinite alternate;
}

@keyframes glow-pulse {
    0% { filter: drop-shadow(0 0 2px rgba(255,255,255,0.4)); }
    100% { filter: drop-shadow(0 0 12px rgba(255,255,255,0.8)); }
}

/* Responsive Grid Tweaks */
@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none; /* In a real mobile app, we would add a toggle burger */
    }
}

/* Ensure all Lucide icons (both i and svg) have correct sizing in their parent containers */
.btn-icon-only i, .btn-icon-only svg {
    width: 20px !important;
    height: 20px !important;
}
.user-avatar i, .user-avatar svg {
    width: 20px !important;
    height: 20px !important;
}
.nav-item a i, .nav-item a svg {
    width: 20px !important;
    height: 20px !important;
}
.item-icon-wrapper i, .item-icon-wrapper svg {
    width: 24px !important;
    height: 24px !important;
}
.btn-close-modal i, .btn-close-modal svg {
    width: 18px !important;
    height: 18px !important;
}
.btn-item-action i, .btn-item-action svg {
    width: 16px !important;
    height: 16px !important;
}
.widget-title i, .widget-title svg {
    width: 18px !important;
    height: 18px !important;
}
.toast i, .toast svg {
    width: 20px !important;
    height: 20px !important;
}
.btn i, .btn svg {
    width: 18px !important;
    height: 18px !important;
}

/* Colored file extensions */
.file-audio .item-icon-wrapper {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

/* Standalone Audio Player */
audio#preview-audio-element {
    width: 85%;
    max-width: 500px;
    outline: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: var(--shadow-md);
}

/* Disabled styling states */
.disabled-btn, .btn:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.disabled-wrapper {
    cursor: not-allowed !important;
}

/* Toolbar Alignment and Stats Badge */
.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.folder-stats-badge {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Sort dropdown selection */
.sort-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    padding: 8px 32px 8px 12px;
    border-radius: var(--radius-md);
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}

.sort-select:focus {
    border-color: var(--accent);
    color: var(--text-primary);
}

.sort-select option {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Custom Item Checkbox for Bulk Actions */
.item-checkbox-wrapper {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: none;
}

.explorer-item:hover .item-checkbox-wrapper,
.explorer-item.selected .item-checkbox-wrapper {
    display: block;
}

.item-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--text-muted);
    background: rgba(15, 19, 31, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

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

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

.item-checkbox.checked::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.explorer-item.selected {
    border-color: var(--accent) !important;
    background: rgba(99, 102, 241, 0.05) !important;
}

/* Floating Bulk Action Bar */
.bulk-action-bar {
    position: fixed;
    bottom: 30px;
    left: 55%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    z-index: 100;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 19, 31, 0.85);
    animation: slide-up-bar 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slide-up-bar {
    0% {
        bottom: -80px;
        opacity: 0;
    }
    100% {
        bottom: 30px;
        opacity: 1;
    }
}

.bulk-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.bulk-icon {
    color: var(--accent);
    width: 18px !important;
    height: 18px !important;
}

.bulk-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Select All Button */
.btn-select-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    outline: none;
}

.btn-select-all:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.btn-select-all i {
    width: 14px !important;
    height: 14px !important;
}
