/**
 * High 5 Connect CRM — V2 Files Styles
 * File manager with grid, folders, preview.
 */

/* ─── Files Section ─────────────────────────────────────────── */
.files-section {
  padding: var(--s2) 0;
}

.files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s3);
}

.files-header h4 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.files-header-actions {
  display: flex;
  gap: var(--s2);
}

.files-folders {
  display: flex;
  gap: var(--s2);
  margin-bottom: var(--s3);
  overflow-x: auto;
  padding-bottom: var(--s1);
}

/* ─── File Grid ─────────────────────────────────────────────── */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s3);
}

.file-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: box-shadow var(--t-fast);
}

.file-card:hover {
  box-shadow: var(--shadow-md);
}

.file-preview {
  height: 100px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

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

.file-icon {
  font-size: 36px;
  opacity: 0.5;
}

.file-hero-badge {
  position: absolute;
  top: var(--s1);
  right: var(--s1);
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 9px;
  font-weight: 700;
  padding: 1px var(--s1);
  border-radius: var(--r-xs);
  text-transform: uppercase;
}

.file-info {
  padding: var(--s2);
  display: flex;
  flex-direction: column;
}

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

.file-meta {
  font-size: var(--text-xs);
  color: var(--text-label);
  margin-top: 2px;
}

.file-card > .btn {
  position: absolute;
  top: var(--s1);
  right: var(--s1);
  opacity: 0;
}

.file-card:hover > .btn {
  opacity: 1;
}

/* ─── File Preview Modal ────────────────────────────────────── */
.file-preview-modal {
  text-align: center;
}

.file-preview-modal img {
  max-height: 70vh;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: var(--s2);
  }

  .file-preview {
    height: 80px;
  }
}

/* ─── File Preview Modal ─────────────────────────────── */
.file-preview-img {
  max-width: 100%;
  border-radius: var(--r-md);
}

@media (min-width: 1025px) {
  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ─── Batch Upload Progress ──────────────────────────────── */
.batch-upload-progress {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) 0;
}

.batch-upload-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--r-full);
  overflow: hidden;
}

.batch-upload-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--teal-light, #0ea5e9));
  border-radius: var(--r-full);
  transition: width 200ms ease;
}

.batch-upload-text {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
