/* ============================================================
   FileDrive Portal — style.css
   Modern, dark-themed HFS-style file download portal
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Custom Properties (Design Tokens) ────────────────── */
:root {
  /* Colors */
  --bg-primary:      #0d1117;
  --bg-secondary:    #161b22;
  --bg-tertiary:     #21262d;
  --bg-card:         #1c2128;
  --border-color:    #30363d;
  --border-subtle:   #21262d;

  --text-primary:    #e6edf3;
  --text-secondary:  #8b949e;
  --text-muted:      #6e7681;
  --text-accent:     #58a6ff;

  --accent-blue:     #1f6feb;
  --accent-blue-h:   #388bfd;
  --accent-green:    #238636;
  --accent-green-h:  #2ea043;
  --accent-purple:   #6e40c9;
  --accent-orange:   #d29922;

  --glow-blue:       rgba(31, 111, 235, 0.3);
  --glow-green:      rgba(35, 134, 54, 0.4);

  /* Spacing */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: #79c0ff; }

/* ── Animated Background ──────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(31,111,235,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(110,64,201,0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout Wrapper ───────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Site Header ──────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Logo area */
.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--glow-blue);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.logo-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Header meta */
.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-green-h);
  border-radius: 50%;
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(46, 160, 67, 0.6); }
  50%       { opacity: 0.8; box-shadow: 0 0 0 5px rgba(46, 160, 67, 0); }
}

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  padding: 40px 0 80px;
}

/* ── Breadcrumb / Path Bar ────────────────────────────────── */
.path-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.path-bar span { color: var(--text-muted); }
.path-bar .path-current { color: var(--text-primary); font-weight: 500; }

/* ── Stats Strip ──────────────────────────────────────────── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color var(--transition-base), transform var(--transition-base);
}

.stat-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.stat-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-info { display: flex; flex-direction: column; }
.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  font-family: 'JetBrains Mono', monospace;
}
.stat-label {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Section Header ───────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-purple));
  border-radius: 2px;
}

/* Search input */
.search-wrap {
  position: relative;
}

.search-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  padding: 8px 12px 8px 36px;
  width: 220px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--glow-blue);
}

.search-input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* ── File Table ───────────────────────────────────────────── */
.file-table-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

/* Table Head */
.file-table thead {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.file-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.file-table thead th:hover { color: var(--text-primary); }

.file-table thead th .th-inner {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sort-icon { font-size: 0.7rem; opacity: 0.5; }

/* Table Body Rows */
.file-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
  cursor: default;
}

.file-table tbody tr:last-child { border-bottom: none; }

.file-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.file-table tbody td {
  padding: 14px 16px;
  vertical-align: middle;
}

/* ── File Name Cell ───────────────────────────────────────── */
.file-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Icon color variants by type */
.file-icon-wrap.type-iso {
  background: rgba(31,111,235,0.12);
  border: 1px solid rgba(31,111,235,0.25);
}
.file-icon-wrap.type-zip {
  background: rgba(210,153,34,0.12);
  border: 1px solid rgba(210,153,34,0.25);
}
.file-icon-wrap.type-archive {
  background: rgba(110,64,201,0.12);
  border: 1px solid rgba(110,64,201,0.25);
}
.file-icon-wrap.type-generic {
  background: rgba(139,148,158,0.12);
  border: 1px solid rgba(139,148,158,0.2);
}
.file-icon-wrap.type-pdf {
  background: rgba(220,53,69,0.12);
  border: 1px solid rgba(220,53,69,0.25);
}
.file-icon-wrap.type-doc {
  background: rgba(43,87,154,0.12);
  border: 1px solid rgba(43,87,154,0.25);
}
.file-icon-wrap.type-xls {
  background: rgba(33,115,70,0.12);
  border: 1px solid rgba(33,115,70,0.25);
}
.file-icon-wrap.type-ppt {
  background: rgba(200,80,40,0.12);
  border: 1px solid rgba(200,80,40,0.25);
}
.file-icon-wrap.type-text {
  background: rgba(139,148,158,0.12);
  border: 1px solid rgba(139,148,158,0.2);
}
.file-icon-wrap.type-image {
  background: rgba(45,180,120,0.12);
  border: 1px solid rgba(45,180,120,0.25);
}
.file-icon-wrap.type-audio {
  background: rgba(255,107,107,0.12);
  border: 1px solid rgba(255,107,107,0.25);
}
.file-icon-wrap.type-video {
  background: rgba(168,85,247,0.12);
  border: 1px solid rgba(168,85,247,0.25);
}
.file-icon-wrap.type-code {
  background: rgba(56,189,248,0.12);
  border: 1px solid rgba(56,189,248,0.25);
}
.file-icon-wrap.type-exe {
  background: rgba(251,146,60,0.12);
  border: 1px solid rgba(251,146,60,0.25);
}

.file-info { display: flex; flex-direction: column; gap: 2px; }

.file-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.01em;
}

.file-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

/* ── Size Cell ────────────────────────────────────────────── */
.file-size {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── Type Badge ───────────────────────────────────────────── */
.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.type-badge.iso {
  background: rgba(31,111,235,0.15);
  color: #79c0ff;
  border: 1px solid rgba(31,111,235,0.3);
}
.type-badge.zip {
  background: rgba(210,153,34,0.15);
  color: #e3b341;
  border: 1px solid rgba(210,153,34,0.3);
}
.type-badge.archive {
  background: rgba(110,64,201,0.15);
  color: #b392f0;
  border: 1px solid rgba(110,64,201,0.3);
}
.type-badge.pdf {
  background: rgba(220,53,69,0.15);
  color: #f77;
  border: 1px solid rgba(220,53,69,0.3);
}
.type-badge.doc, .type-badge.docx {
  background: rgba(43,87,154,0.15);
  color: #6ea8fe;
  border: 1px solid rgba(43,87,154,0.3);
}
.type-badge.xls, .type-badge.xlsx, .type-badge.csv {
  background: rgba(33,115,70,0.15);
  color: #63e6be;
  border: 1px solid rgba(33,115,70,0.3);
}
.type-badge.ppt, .type-badge.pptx {
  background: rgba(200,80,40,0.15);
  color: #f0a070;
  border: 1px solid rgba(200,80,40,0.3);
}
.type-badge.txt, .type-badge.rtf, .type-badge.md {
  background: rgba(139,148,158,0.12);
  color: #adb5bd;
  border: 1px solid rgba(139,148,158,0.25);
}
.type-badge.image {
  background: rgba(45,180,120,0.15);
  color: #69db7c;
  border: 1px solid rgba(45,180,120,0.3);
}
.type-badge.audio {
  background: rgba(255,107,107,0.15);
  color: #ff8787;
  border: 1px solid rgba(255,107,107,0.3);
}
.type-badge.video {
  background: rgba(168,85,247,0.15);
  color: #c084fc;
  border: 1px solid rgba(168,85,247,0.3);
}
.type-badge.code {
  background: rgba(56,189,248,0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56,189,248,0.3);
}
.type-badge.exe {
  background: rgba(251,146,60,0.15);
  color: #fdba74;
  border: 1px solid rgba(251,146,60,0.3);
}

/* ── Action Buttons Cell ──────────────────────────────────── */
.actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

/* Download Button */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--accent-green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition:
    background var(--transition-fast),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
}

/* Shine sweep on hover */
.btn-download::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left var(--transition-slow);
}

.btn-download:hover {
  background: var(--accent-green-h);
  box-shadow: 0 0 18px var(--glow-green), 0 4px 12px rgba(0,0,0,0.3);
  transform: translateY(-1px);
  color: #fff;
}

.btn-download:hover::before { left: 150%; }

.btn-download:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-download .btn-icon { font-size: 0.9rem; }

/* Copy Link Button */
.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.btn-copy:hover {
  background: var(--bg-card);
  color: var(--text-accent);
  border-color: var(--accent-blue);
  transform: scale(1.05);
}

.btn-copy:active { transform: scale(0.95); }

/* Tooltip for copy */
.btn-copy .tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-family: 'Inter', sans-serif;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.btn-copy .tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border-color);
}

.btn-copy:hover .tooltip,
.btn-copy.copied .tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.btn-copy.copied {
  color: var(--accent-green-h);
  border-color: var(--accent-green);
}

/* View / Preview Button */
.btn-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-fast);
}

.btn-view::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left var(--transition-slow);
}

.btn-view:hover {
  box-shadow: 0 0 18px rgba(31, 111, 235, 0.4), 0 4px 12px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

.btn-view:hover::before { left: 150%; }
.btn-view:active { transform: translateY(0); box-shadow: none; }
.btn-view .btn-icon { font-size: 0.85rem; }

/* View button tooltip */
.btn-view .tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-family: 'Inter', sans-serif;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.btn-view .tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border-color);
}

.btn-view:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ── Preview Modal ────────────────────────────────────────── */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.preview-modal.show {
  opacity: 1;
  pointer-events: all;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.preview-container {
  position: relative;
  width: 94vw;
  height: 92vh;
  max-width: 1400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(31, 111, 235, 0.1);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s ease;
}

.preview-modal.show .preview-container {
  transform: scale(1) translateY(0);
}

/* Preview Header */
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
  flex-wrap: wrap;
}

.preview-title-area {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.preview-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.preview-title-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.preview-filename {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.preview-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

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

.preview-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

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

.preview-action-download {
  background: var(--accent-green);
  color: #fff;
  border-color: var(--accent-green);
}

.preview-action-download:hover {
  background: var(--accent-green-h);
  color: #fff;
  border-color: var(--accent-green-h);
  box-shadow: 0 0 12px var(--glow-green);
}

.preview-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.preview-close-btn:hover {
  background: #da3633;
  color: #fff;
  border-color: #da3633;
}

/* Preview Body */
.preview-body {
  flex: 1;
  position: relative;
  background: var(--bg-primary);
  overflow: hidden;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0;
  will-change: opacity;
  transform: translateZ(0); /* GPU acceleration — prevents flicker on scroll */
}

.preview-iframe.loaded {
  opacity: 1;
}

.preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  z-index: 2;
}

.preview-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Unsupported file type */
.preview-unsupported {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.preview-unsupported .unsupported-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  opacity: 0.6;
}

.preview-unsupported h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.preview-unsupported p {
  font-size: 0.9rem;
  margin-bottom: 8px;
  max-width: 420px;
  line-height: 1.6;
}

.unsupported-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Image Preview ────────────────────────────────────────── */
.preview-body-image {
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px;
}

.preview-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
  cursor: default;
  /* Allow right-click → Copy Image */
  -webkit-user-select: auto;
  user-select: auto;
  pointer-events: auto;
}

.preview-image.loaded {
  opacity: 1;
  transform: scale(1);
}

/* Hint text below image */
.preview-image-wrap::after {
  content: '📌 Right-click image → Copy Image, then paste into Word';
  display: block;
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0.7;
  pointer-events: none;
}

/* Copy Image button style */
.preview-action-copyimg {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  color: #fff;
  border-color: var(--accent-blue);
}

.preview-action-copyimg:hover {
  color: #fff;
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px rgba(110, 64, 201, 0.4);
}

/* ── Progress Bar (visual only) ───────────────────────────── */
.size-bar-wrap {
  margin-top: 4px;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  width: 80px;
}

.size-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  transition: width var(--transition-slow);
}

/* ── No Results ───────────────────────────────────────────── */
.no-results {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  display: none;
}

.no-results .nr-icon { font-size: 2.5rem; margin-bottom: 12px; }
.no-results p { font-size: 0.9rem; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-links a:hover { color: var(--text-accent); }

/* ── Toast Notification ───────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--bg-tertiary);
  border: 1px solid var(--accent-green);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 12px var(--glow-green);
  transform: translateY(80px);
  opacity: 0;
  transition: transform var(--transition-base), opacity var(--transition-base);
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ── Responsive ───────────────────────────────────────────── */

/* Hide description on medium screens */
@media (max-width: 900px) {
  .col-desc { display: none; }
}

/* Collapse table on mobile → card layout */
@media (max-width: 640px) {
  .file-table, .file-table thead, .file-table tbody,
  .file-table tr, .file-table td, .file-table th {
    display: block;
    width: 100%;
  }

  .file-table thead { display: none; } /* hide header row */

  .file-table tbody tr {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    padding: 14px;
    background: var(--bg-card);
  }

  .file-table tbody tr:hover { background: var(--bg-card); }

  .file-table tbody td {
    padding: 6px 0;
    border: none;
  }

  /* Show label before each cell on mobile */
  .file-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
  }

  .file-table-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .search-input { width: 100%; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .search-wrap { width: 100%; }

  .stats-strip { grid-template-columns: 1fr 1fr; }

  .header-meta { display: none; }

  .actions-cell { flex-wrap: wrap; }

  .btn-view {
    font-size: 0.76rem;
    padding: 7px 10px;
  }

  /* Preview modal responsive */
  .preview-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .preview-header {
    padding: 10px 14px;
  }

  .preview-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .preview-action-btn {
    font-size: 0.72rem;
    padding: 6px 10px;
  }

  .preview-filename {
    font-size: 0.82rem;
  }
}

@media (max-width: 400px) {
  .stats-strip { grid-template-columns: 1fr; }
}

/* ── Scrollbar Styling ────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

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