/* =================== NÚT BẤM =================== */
.sidebar-action {
    padding: 16px 20px;
}

.btn-main-upload {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 97, 255, 0.2);
}

.btn-main-upload:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 97, 255, 0.3);
}

.btn-secondary-tool {
    width: 100%;
    background-color: var(--bg-hover);
    color: var(--text-main);
    border: 1px dashed var(--border-light);
    padding: 10px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.btn-secondary-tool:hover {
    background-color: #e2e8f0;
    color: var(--primary);
    border-style: solid;
}

.btn-secondary-tool i {
    color: var(--warning);
}

.btn-add-folder {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
    transition: 0.2s;
}

.btn-add-folder:hover {
    background: var(--border-light);
    color: var(--text-main);
}

.btn-secondary, 
.btn-primary {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* =================== ITEM CÂY THƯ MỤC =================== */
.folder-list {
    list-style: none;
    position: relative;
}

.folder-item {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 2px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}

.folder-item::before {
    content: '';
    position: absolute;
    left: calc(var(--depth) * 20px - 3px);
    top: -14px; 
    bottom: 17px; 
    border-left: 1px dashed #cbd5e1;
    display: var(--line-display);
    z-index: 1;
}

.folder-item::after {
    content: '';
    position: absolute;
    left: calc(var(--depth) * 20px - 3px);
    top: 17px;
    width: 10px;
    border-top: 1px dashed #cbd5e1;
    display: var(--line-display);
    z-index: 1;
}

.folder-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

.folder-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.folder-name-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.folder-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-actions {
    display: none;
    gap: 6px;
}

.folder-item:hover .folder-actions {
    display: flex;
}

.folder-actions span {
    padding: 4px;
    border-radius: 4px;
    color: var(--text-muted);
}

.folder-actions span:hover {
    background: #cbd5e1;
    color: var(--text-main);
}

/* =================== THẺ HIỂN THỊ FILE (FILE CARD) =================== */
.file-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.file-preview {
    height: 150px;
    background: var(--bg-app);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
    overflow: hidden;
    position: relative;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.file-card:hover .file-preview img {
    transform: scale(1.05);
}

.file-icon {
    font-size: 48px;
    color: #cbd5e1;
}

.file-info {
    padding: 16px;
}

.file-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.file-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: 6px;
    background: var(--bg-hover);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-copy:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-edit:hover {
    background: #fef3c7;
    color: var(--warning);
}

.btn-delete:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.btn-share:hover {
    background: #e0e7ff;
    color: #4338ca;
}

.btn-info:hover {
    background: #e0f2fe;
    color: #0284c7;
}

.shared-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    z-index: 2;
    pointer-events: none;
}

/* =================== TIẾN TRÌNH & LOADING =================== */
.loading-state, 
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.loading-state i {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--primary);
}

.upload-progress-card {
    margin: 0 20px 16px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.progress-track {
    height: 6px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* =================== TOAST NOTIFICATION =================== */
.toast-stack {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.toast {
    background: var(--bg-surface);
    color: var(--text-main);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    min-width: 280px;
    border-left: 4px solid transparent;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-success {
    border-left-color: var(--success);
}

.toast-success i {
    color: var(--success);
    font-size: 18px;
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-error i {
    color: var(--danger);
    font-size: 18px;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =================== MODAL & ĐĂNG NHẬP =================== */
.modal-backdrop, 
.login-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: all 0.2s ease;
}

.login-backdrop {
    background: var(--bg-app);
    z-index: 99999;
}

.modal-backdrop.hidden, 
.login-backdrop.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-window, 
.login-box {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--border-light);
    transform: scale(1) translateY(0);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-window {
    width: 420px;
}

.login-box {
    width: 380px;
    padding: 40px 30px;
}

.modal-backdrop.hidden .modal-window, 
.login-backdrop.hidden .login-box {
    transform: scale(0.95) translateY(10px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

.btn-close-modal:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
}

#modalContentText {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.custom-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}

.custom-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.modal-footer {
    padding: 16px 24px;
    background: var(--bg-app);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-light);
}


/* Tải xuống và Checkbox */
.btn-dowload {
    background: var(--bg-hover);
    color: var(--text-muted);
    border: none;
    padding: 8px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}
.btn-download:hover { 
    background: #dcfce7; 
    color: #16a34a; 
}

.file-checkbox { 
    position: absolute; 
    top: 12px; left: 12px; 
    width: 18px; height: 18px; 
    z-index: 3; 
    cursor: pointer; 
    accent-color: var(--primary); 
    transform: scale(1.1); 
    opacity: 0; 
    transition: opacity 0.2s; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); 
}
.file-card:hover .file-checkbox, .file-checkbox:checked { opacity: 1; }
.file-card.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.file-card.selected .file-preview::after { content: ''; position: absolute; inset: 0; background: rgba(0,97,255,0.1); pointer-events: none; }

/* DRAG & DROP OVERLAY */
.drag-overlay { position: fixed; inset: 0; background: rgba(0,97,255,0.9); z-index: 100000; display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; transition: all 0.2s; }
.drag-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.drag-overlay i { font-size: 80px; margin-bottom: 20px; animation: bounce 1s infinite alternate; }
.drag-overlay p { margin-top: 10px; opacity: 0.8; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-20px); } }

/* BULK ACTION BAR */
.bulk-action-bar { 
    position: fixed; 
    bottom: 30px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: #0f172a; 
    color: white; padding: 12px 24px; 
    border-radius: 50px; display: flex; 
    align-items: center; gap: 24px; 
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5); 
    z-index: 9999; 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
}
.bulk-action-bar.hidden { opacity: 0; transform: translate(-50%, 50px); pointer-events: none; }
.bulk-actions { display: flex; gap: 10px; }