/* css/file-list.css - 深度美化升级版 */

/* ========== 文件列表容器 ========== */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ========== 文件项 - 现代卡片 ========== */
.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--gradient-card);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  position: relative;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.file-item:hover {
  background: var(--bg-primary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.file-item:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
  transition-duration: 80ms;
}

/* 文件图标 - 圆角方形 */
.file-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: all var(--transition-base);
}

.file-icon svg {
  width: 22px;
  height: 22px;
}

/* 目录悬停效果 */
.file-item.is-directory:hover .file-icon {
  transform: scale(1.08);
}

/* 文件信息 */
.file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.file-name {
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.file-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  font-weight: var(--font-weight-normal);
}

.file-meta .meta-size {
  min-width: 70px;
}

.file-meta .meta-date {
  min-width: 80px;
}

/* ========== 文件类型图标颜色 - 渐变 ========== */
.file-icon.folder {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.15);
}
.file-icon.image {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}
.file-icon.video {
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  color: #db2777;
  box-shadow: 0 2px 8px rgba(219, 39, 119, 0.15);
}
.file-icon.audio {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4f46e5;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}
.file-icon.document {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #16a34a;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15);
}
.file-icon.pdf {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}
.file-icon.code {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #4b5563;
  box-shadow: 0 2px 8px rgba(75, 85, 99, 0.1);
}
.file-icon.archive {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #b45309;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.15);
}
.file-icon.text {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #64748b;
  box-shadow: 0 2px 8px rgba(100, 116, 139, 0.1);
}
.file-icon.spreadsheet {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.15);
}
.file-icon.presentation {
  background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%);
  color: #e11d48;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.15);
}
.file-icon.file {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #64748b;
  box-shadow: 0 2px 8px rgba(100, 116, 139, 0.1);
}

/* 目录名称 */
.file-item.is-directory .file-name {
  color: var(--text-primary);
}

.file-item:hover .file-name {
  color: var(--color-primary);
}

/* ========== 列表视图 ========== */
.file-list.view-list .file-item {
  flex-direction: row;
}

.file-list.view-list .file-info {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.file-list.view-list .file-name {
  flex: 1;
  min-width: 0;
}

/* ========== 网格视图 - 卡片化 ========== */
.file-list.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--spacing-md);
}

.file-list.view-grid .file-item {
  flex-direction: column;
  padding: 24px 16px 20px;
  text-align: center;
  border: 1px solid var(--border-color-light);
  background: var(--bg-primary);
}

.file-list.view-grid .file-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-3px);
}

.file-list.view-grid .file-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 8px;
}

.file-list.view-grid .file-icon svg {
  width: 28px;
  height: 28px;
}

.file-list.view-grid .file-info {
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.file-list.view-grid .file-name {
  text-align: center;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--font-size-sm);
  line-height: 1.4;
}

.file-list.view-grid .file-meta {
  justify-content: center;
  font-size: 10px;
  gap: 8px;
}

/* ========== 文件项入场动画 ========== */
.file-item {
  animation: fileItemIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.file-item:nth-child(1) { animation-delay: 0.02s; }
.file-item:nth-child(2) { animation-delay: 0.04s; }
.file-item:nth-child(3) { animation-delay: 0.06s; }
.file-item:nth-child(4) { animation-delay: 0.08s; }
.file-item:nth-child(5) { animation-delay: 0.10s; }
.file-item:nth-child(6) { animation-delay: 0.12s; }
.file-item:nth-child(7) { animation-delay: 0.14s; }
.file-item:nth-child(8) { animation-delay: 0.16s; }
.file-item:nth-child(9) { animation-delay: 0.18s; }
.file-item:nth-child(10) { animation-delay: 0.20s; }
.file-item:nth-child(n+11) { animation-delay: 0.22s; }

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

/* ========== 欢迎卡片（Demo模式） ========== */
.welcome-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color-light);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  text-align: center;
  margin-bottom: var(--spacing-lg);
  animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-sm);
}

.welcome-card .welcome-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--gradient-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: var(--spacing-md);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
}

.welcome-card .welcome-icon svg {
  width: 32px;
  height: 32px;
}

.welcome-card h2 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  letter-spacing: -0.02em;
}

.welcome-card p {
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--gradient-primary-light);
  color: var(--color-primary);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-md);
  border: 1px solid rgba(102, 126, 234, 0.15);
}
