/* ===== COSS UI DESIGN SYSTEM ===== */
/* Inspired by https://coss.com/ui/ - Modern, minimalist design language */
/* Key principles: Subtle shadows, focus rings, semantic colors, accessibility-first */

/* ===== DESIGN TOKENS ===== */
:root {
  /* Base Grid Unit - All spacing is a multiple of this */
  --grid-unit: 4px;

  /* Colors */
  --bg: #0a0d12;
  --bg-elevated: #0f1419;
  --bg-panel: #141920;
  --bg-panel-hover: #1a2028;
  --ink: #e8f0fe;
  --ink-muted: #9eb2c9;
  --ink-subtle: #6b7d95;
  --stroke: #1f2833;
  --stroke-strong: #2a3441;
  --acc: #4ea1ff;
  --acc-hover: #5fb0ff;
  --acc-light: rgba(78, 161, 255, 0.1);
  --ok: #22d3ee;
  --warn: #ffd166;
  --danger: #ef4444;

  /* Spacing Scale - Based on 4px grid unit */
  --space-0: 0;
  --space-1: calc(var(--grid-unit) * 1); /* 4px */
  --space-2: calc(var(--grid-unit) * 2); /* 8px */
  --space-3: calc(var(--grid-unit) * 3); /* 12px */
  --space-4: calc(var(--grid-unit) * 4); /* 16px */
  --space-5: calc(var(--grid-unit) * 5); /* 20px */
  --space-6: calc(var(--grid-unit) * 6); /* 24px */
  --space-8: calc(var(--grid-unit) * 8); /* 32px */
  --space-10: calc(var(--grid-unit) * 10); /* 40px */
  --space-12: calc(var(--grid-unit) * 12); /* 48px */
  --space-16: calc(var(--grid-unit) * 16); /* 64px */

  /* Legacy spacing tokens (mapped to grid system) */
  --space-xs: var(--space-1); /* 4px */
  --space-sm: var(--space-2); /* 8px */
  --space-md: var(--space-3); /* 12px */
  --space-lg: var(--space-4); /* 16px */
  --space-xl: var(--space-6); /* 24px */
  --space-2xl: var(--space-8); /* 32px */
  --space-3xl: var(--space-12); /* 48px */
  --space-4xl: var(--space-16); /* 64px */

  /* Border Radius - Based on grid unit */
  --radius-sm: var(--space-2); /* 8px */
  --radius-md: var(--space-3); /* 12px */
  --radius-lg: var(--space-4); /* 16px */
  --radius-xl: var(--space-5); /* 20px */
  --radius-full: 9999px;

  /* Shadows - COSS UI: Subtle and layered */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05), 0 1px 1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08);

  /* Focus ring - COSS UI style */
  --ring-width: 2px;
  --ring-offset: 2px;
  --ring-color: var(--acc);
  --ring-opacity: 0.5;

  /* Typography */
  --font:
    'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', ui-monospace, 'Cascadia Code', 'Consolas', monospace;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Grid System */
  --grid-columns: 12;
  --grid-gap: var(--space-4); /* 16px */
  --container-max-width: 1280px;
  --container-padding: var(--space-6); /* 24px */

  /* Vertical Spacing System - Standardized section spacing */
  --section-spacing: var(--space-4); /* 16px - Standard spacing between sections */
  --section-spacing-large: var(--space-6); /* 24px - Large spacing for major sections */
  --section-spacing-small: var(--space-3); /* 12px - Small spacing for related sections */
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafbfc;
    --bg-elevated: #ffffff;
    --bg-panel: #ffffff;
    --bg-panel-hover: #f8f9fa;
    --ink: #0f1721;
    --ink-muted: #5b6b7e;
    --ink-subtle: #8b9aad;
    --stroke: #e6edf5;
    --stroke-strong: #d1d9e6;
    --acc-light: rgba(78, 161, 255, 0.08);
  }
}

html:not(.dark) {
  --bg: #fafbfc;
  --bg-elevated: #ffffff;
  --bg-panel: #ffffff;
  --bg-panel-hover: #f8f9fa;
  --ink: #0f1721;
  --ink-muted: #5b6b7e;
  --ink-subtle: #8b9aad;
  --stroke: #e6edf5;
  --stroke-strong: #d1d9e6;
  --acc-light: rgba(78, 161, 255, 0.08);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== GRID SYSTEM ===== */
/* Container - Uses grid system for consistent alignment */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: var(--container-padding);
  width: 100%;
}

/* Grid Container */
.grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  gap: var(--grid-gap);
  width: 100%;
}

/* Grid Column Spans */
.col-1 {
  grid-column: span 1;
}
.col-2 {
  grid-column: span 2;
}
.col-3 {
  grid-column: span 3;
}
.col-4 {
  grid-column: span 4;
}
.col-5 {
  grid-column: span 5;
}
.col-6 {
  grid-column: span 6;
}
.col-7 {
  grid-column: span 7;
}
.col-8 {
  grid-column: span 8;
}
.col-9 {
  grid-column: span 9;
}
.col-10 {
  grid-column: span 10;
}
.col-11 {
  grid-column: span 11;
}
.col-12 {
  grid-column: span 12;
}

/* Grid Column Start/End */
.col-start-1 {
  grid-column-start: 1;
}
.col-start-2 {
  grid-column-start: 2;
}
.col-start-3 {
  grid-column-start: 3;
}
.col-start-4 {
  grid-column-start: 4;
}
.col-start-5 {
  grid-column-start: 5;
}
.col-start-6 {
  grid-column-start: 6;
}
.col-start-7 {
  grid-column-start: 7;
}
.col-start-8 {
  grid-column-start: 8;
}
.col-start-9 {
  grid-column-start: 9;
}
.col-start-10 {
  grid-column-start: 10;
}
.col-start-11 {
  grid-column-start: 11;
}
.col-start-12 {
  grid-column-start: 12;
}

/* Spacing Utilities - Margin */
.m-0 {
  margin: var(--space-0);
}
.m-1 {
  margin: var(--space-1);
}
.m-2 {
  margin: var(--space-2);
}
.m-3 {
  margin: var(--space-3);
}
.m-4 {
  margin: var(--space-4);
}
.m-6 {
  margin: var(--space-6);
}
.m-8 {
  margin: var(--space-8);
}

.mx-0 {
  margin-left: var(--space-0);
  margin-right: var(--space-0);
}
.mx-1 {
  margin-left: var(--space-1);
  margin-right: var(--space-1);
}
.mx-2 {
  margin-left: var(--space-2);
  margin-right: var(--space-2);
}
.mx-3 {
  margin-left: var(--space-3);
  margin-right: var(--space-3);
}
.mx-4 {
  margin-left: var(--space-4);
  margin-right: var(--space-4);
}
.mx-6 {
  margin-left: var(--space-6);
  margin-right: var(--space-6);
}
.mx-8 {
  margin-left: var(--space-8);
  margin-right: var(--space-8);
}

.my-0 {
  margin-top: var(--space-0);
  margin-bottom: var(--space-0);
}
.my-1 {
  margin-top: var(--space-1);
  margin-bottom: var(--space-1);
}
.my-2 {
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}
.my-3 {
  margin-top: var(--space-3);
  margin-bottom: var(--space-3);
}
.my-4 {
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
}
.my-6 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-6);
}
.my-8 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

/* Spacing Utilities - Padding */
.p-0 {
  padding: var(--space-0);
}
.p-1 {
  padding: var(--space-1);
}
.p-2 {
  padding: var(--space-2);
}
.p-3 {
  padding: var(--space-3);
}
.p-4 {
  padding: var(--space-4);
}
.p-6 {
  padding: var(--space-6);
}
.p-8 {
  padding: var(--space-8);
}

.px-0 {
  padding-left: var(--space-0);
  padding-right: var(--space-0);
}
.px-1 {
  padding-left: var(--space-1);
  padding-right: var(--space-1);
}
.px-2 {
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}
.px-3 {
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}
.px-4 {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}
.px-6 {
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}
.px-8 {
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}

.py-0 {
  padding-top: var(--space-0);
  padding-bottom: var(--space-0);
}
.py-1 {
  padding-top: var(--space-1);
  padding-bottom: var(--space-1);
}
.py-2 {
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}
.py-3 {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}
.py-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}
.py-6 {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}
.py-8 {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

/* Gap Utilities */
.gap-0 {
  gap: var(--space-0);
}
.gap-1 {
  gap: var(--space-1);
}
.gap-2 {
  gap: var(--space-2);
}
.gap-3 {
  gap: var(--space-3);
}
.gap-4 {
  gap: var(--space-4);
}
.gap-6 {
  gap: var(--space-6);
}
.gap-8 {
  gap: var(--space-8);
}

/* Responsive Grid - Auto-fit with minmax */
.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--grid-gap);
}

/* Responsive Grid - Auto-fill */
.grid-auto-fill {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--grid-gap);
}

/* Skip to content link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--acc);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 10000;
  border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
  top: 0;
}

/* Material Icons */
.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 880px at 90% -10%, rgba(20, 34, 53, 0.4) 0%, transparent 60%),
    radial-gradient(800px 640px at -10% -20%, rgba(22, 29, 42, 0.3) 0%, transparent 55%);
  min-height: 100vh;
  transition:
    background-color var(--transition-base),
    color var(--transition-base);
}

a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
}

/* ===== NAVIGATION ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  /* COSS UI: Enhanced backdrop blur for frosted glass effect */
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(10, 13, 18, 0.75);
  border-bottom: 1px solid var(--stroke);
  /* COSS UI: Subtle shadow for depth */
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 1px 3px rgba(0, 0, 0, 0.02);
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

html:not(.dark) .nav {
  background: rgba(250, 251, 252, 0.85);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-left: var(--space-6);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  transition: opacity 150ms ease;
}

.brand:hover {
  opacity: 0.8;
}

.logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--acc), #2b6cb0);
  box-shadow: 0 2px 8px rgba(78, 161, 255, 0.3);
}

.logo .material-icons {
  font-size: 18px;
  color: white;
}

.spacer {
  flex: 1;
}

/* ===== BUTTONS ===== */
.btn {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 20px;
  min-height: 44px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--stroke);
  background: var(--bg-panel);
  color: var(--ink);
  transition: all var(--transition-fast);
  user-select: none;
  box-sizing: border-box;
  /* COSS UI: Subtle inset shadow for depth */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.btn:hover:not(:disabled) {
  background: var(--bg-panel-hover);
  border-color: var(--stroke-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Focus indicators for keyboard navigation - COSS UI style */
.btn:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: var(--ring-width) solid var(--ring-color);
  outline-offset: var(--ring-offset);
}

.btn:focus-visible:not(:disabled) {
  box-shadow:
    0 0 0 calc(var(--ring-width) + var(--ring-offset)) rgba(78, 161, 255, var(--ring-opacity)),
    var(--shadow-sm);
}

.btn.primary {
  background: linear-gradient(135deg, var(--acc), #2b6cb0);
  border-color: var(--acc);
  color: white;
  /* COSS UI: Enhanced shadow for primary actions */
  box-shadow:
    0 1px 2px rgba(78, 161, 255, 0.15),
    0 2px 4px rgba(78, 161, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Consistent styling for all "Dosya Seç" buttons */
.btn.primary[data-file-select],
#pick.btn.primary {
  width: auto;
  display: inline-flex;
  padding: 8px 14px;
  max-width: fit-content;
  min-width: auto;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 6px rgba(78, 161, 255, 0.3);
  transition: all var(--transition-fast);
  justify-content: center;
  text-align: center;
  margin: 0;
}

/* Add margin-top for empty state button */
.empty-state .btn.primary[data-file-select] {
  margin-top: var(--space-md);
}

.btn.primary[data-file-select]:hover,
#pick.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(78, 161, 255, 0.4);
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--acc-hover), #357abd);
  /* COSS UI: Elevated shadow on hover */
  box-shadow:
    0 2px 4px rgba(78, 161, 255, 0.2),
    0 4px 8px rgba(78, 161, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn.primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.15),
    0 1px 2px rgba(78, 161, 255, 0.2);
}

/* Copy button feedback */
.btn.copied {
  background: var(--ok) !important;
  color: var(--bg) !important;
}

.btn.copied .material-icons {
  color: var(--bg) !important;
}

.btn.destruct {
  border: 1px solid var(--stroke);
  background: var(--bg-panel);
  color: var(--ink);
}

.btn.destruct:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
  transform: translateY(-1px);
}

.btn.destruct:active:not(:disabled) {
  transform: translateY(0);
}

.btn.destruct .material-icons {
  font-size: 18px;
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-muted);
  padding: 6px 8px;
  min-width: 32px;
  height: 32px;
}

.btn.ghost:hover:not(:disabled) {
  background: var(--bg-panel-hover);
  border-color: var(--stroke);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn.ghost:active:not(:disabled) {
  transform: translateY(0);
}

.btn.ghost .material-icons {
  font-size: 18px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--ink);
}

.theme-toggle:hover {
  background: var(--bg-panel-hover);
  border-color: var(--stroke-strong);
}

.theme-toggle .material-icons {
  font-size: 18px;
}

/* ===== LAYOUT ===== */
/* Container is now defined in Grid System section above */

/* Standardized Section Spacing */
section.panel + section.panel {
  margin-top: var(--section-spacing);
}

/* Main container spacing */
main.container > section:first-child {
  margin-top: 0;
}

main.container > section:not(:first-child) {
  margin-top: var(--section-spacing);
}

/* Large spacing for major section breaks */
section.panel.section-large {
  margin-top: var(--section-spacing-large) !important;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  /* COSS UI: Layered subtle shadows */
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition-base);
  transform: translateZ(0); /* Force GPU acceleration to prevent clipping */
  will-change: transform;
}

.panel:hover {
  /* COSS UI: Elevated on hover */
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.06);
  transform: translateZ(0) translateY(-1px);
}

/* ===== DROPZONE ===== */
.drop-wrap {
  padding: var(--space-xl) var(--space-lg); /* Match horizontal padding with .bar */
  margin: var(--space-sm) 0 var(--space-xs) 0; /* Add margin to accommodate drag scale effect, reduced bottom margin */
}

.drop {
  border: 2px dashed var(--stroke);
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: var(--space-2xl);
  transition: all var(--transition-base);
  cursor: pointer;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
  transform: translateZ(0); /* Force GPU acceleration to prevent clipping */
  /* COSS UI: Subtle inset shadow */
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.drop::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--acc-light);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.drop:hover {
  border-color: var(--acc);
  background: var(--bg-panel);
}

.drop:hover::before {
  opacity: 1;
}

.drop.drag {
  border-color: var(--acc);
  background: var(--acc-light);
  transform: translateZ(0) scale(1.01);
  /* COSS UI: Enhanced drag shadow */
  box-shadow:
    0 4px 8px rgba(78, 161, 255, 0.15),
    0 2px 4px rgba(78, 161, 255, 0.1);
}

.drop.drag::before {
  opacity: 1;
}

.drop-icon {
  width: 64px;
  height: 64px;
  color: var(--acc);
  margin: 0 auto var(--space-md);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-icon .material-icons {
  font-size: 64px;
  color: var(--acc);
  display: block;
  line-height: 1;
  width: 64px;
  height: 64px;
}

.drop h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  position: relative;
  z-index: 1;
}

.mut {
  color: var(--ink-muted);
  font-size: 14px;
  position: relative;
  z-index: 1;
  margin-top: var(--space-sm);
}

/* ===== TOOLBAR ===== */
.bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--stroke);
  flex-wrap: wrap;
}

.search {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 10px var(--space-md);
  transition: all var(--transition-fast);
  flex-wrap: wrap;
  /* COSS UI: Subtle inset shadow */
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

#filterControls {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
}

.filter-dropdown-btn {
  flex-shrink: 0;
}

.view {
  flex-shrink: 0;
}

.search:hover {
  border-color: var(--stroke-strong);
}

.search:focus-within {
  border-color: var(--acc);
  /* COSS UI: Ring with offset */
  box-shadow:
    0 0 0 var(--ring-offset) var(--bg-panel),
    0 0 0 calc(var(--ring-width) + var(--ring-offset)) rgba(78, 161, 255, var(--ring-opacity)),
    inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.search .material-icons {
  font-size: 18px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.search input {
  all: unset;
  flex: 1;
  font-size: 14px;
  color: var(--ink);
  padding-right: 32px; /* Space for clear button */
}

.search-clear {
  display: none;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.search-clear:hover {
  opacity: 1;
  color: var(--ink);
}

.search-clear:focus {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

.search input::placeholder {
  color: var(--ink-subtle);
}

.view {
  display: flex;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
  align-self: stretch;
  min-height: 100%;
}

.view button {
  all: unset;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--ink-muted);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  box-sizing: border-box;
  min-height: 38px; /* Match search bar height: 10px padding top + ~18px input height + 10px padding bottom */
}

.view button .material-icons {
  font-size: 18px;
}

.view button.active {
  background: var(--bg-panel);
  color: var(--ink);
}

.view button:hover:not(.active) {
  background: var(--bg-panel-hover);
  color: var(--ink);
}

/* ===== FILES GRID/LIST ===== */
#filesWrap.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-lg); /* Match horizontal padding with .bar */
}

@media (max-width: 1200px) {
  #filesWrap.grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  #filesWrap.grid {
    grid-template-columns: 1fr;
  }
}

#filesWrap.list {
  display: block;
  padding: var(--space-lg) var(--space-lg); /* Match horizontal padding with .bar */
  width: 100%;
}

/* Files section dropzone styles */
#filesWrap.dropzone-active {
  position: relative;
}

#filesWrap.dropzone-active::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px dashed var(--acc);
  border-radius: var(--radius-lg);
  background: var(--acc-light);
  opacity: 0.3;
  z-index: 1;
  pointer-events: none;
  animation: pulse-border 1.5s ease-in-out infinite;
}

.dropzone-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-elevated);
  color: var(--acc);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 16px;
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  white-space: nowrap;
}

.dropzone-message .material-icons {
  font-size: 24px;
}

@keyframes pulse-border {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.01);
  }
}

#filesWrap.list .files-table {
  display: table;
  width: 100%;
}

.file-card {
  width: 100%;
  min-height: 200px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  background: var(--bg-elevated);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  transition: all var(--transition-base);
  animation: fadeIn 0.3s ease-out;
  overflow: hidden;
  min-width: 0;
  position: relative;
  cursor: grab;
  /* COSS UI: Subtle card shadow */
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.04);
}

.file-card:active {
  cursor: grabbing;
}

.file-card.pinned {
  border-color: var(--warn);
  background: linear-gradient(135deg, var(--bg-elevated), rgba(255, 209, 102, 0.05));
  /* COSS UI: Enhanced shadow for pinned items */
  box-shadow:
    0 2px 4px rgba(255, 209, 102, 0.15),
    0 1px 2px rgba(0, 0, 0, 0.06);
}

.file-card.pinned::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--warn), #ffb84d);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.file-card.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.file-card.drag-over {
  border-color: var(--acc);
  /* COSS UI: Ring effect for drag target */
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--acc-light);
}

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

.file-card:hover {
  border-color: var(--stroke-strong);
  /* COSS UI: Elevated card on hover */
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.file-card .row {
  min-width: 0;
  width: 100%;
  gap: var(--space-md);
}

.file-card .btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 8px;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
}

/* Full width buttons in card view actions */
.file-card > .row:last-child {
  flex-direction: column;
}

.file-card > .row:last-child .btn {
  flex: none;
  width: 100%;
  justify-content: center;
}

.file-card .btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-muted);
}

.file-card .btn.ghost:hover:not(:disabled) {
  background: var(--bg-panel-hover);
  border-color: var(--stroke);
  color: var(--ink);
}

.file-card .btn.destruct {
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  color: var(--ink);
}

.file-card .btn.destruct:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: var(--danger);
}

/* Download button hover - green icon */
.file-card [data-act='download']:hover:not(:disabled) .material-icons {
  color: var(--ok);
}

/* Action buttons container in file cards */
.file-card > .row:last-child {
  display: flex;
  flex-direction: row;
  gap: var(--space-sm);
}

.file-card .btn .material-icons {
  font-size: 18px;
  flex-shrink: 0;
}

.file-ico {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: var(--acc-light);
  border: 1px solid rgba(78, 161, 255, 0.2);
  flex-shrink: 0;
  position: relative;
}

.file-ico .material-icons {
  font-size: 24px;
  color: var(--acc);
}

/* Preview overlay on hover */
.file-ico.has-preview {
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-ico.has-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(78, 161, 255, 0.3);
  border-color: var(--acc);
}

.file-ico .preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(78, 161, 255, 0.95);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.file-ico.has-preview:hover .preview-overlay {
  opacity: 1;
}

.file-ico .preview-overlay .material-icons {
  color: white;
  font-size: 24px;
}

.file-ico .file-icon {
  z-index: 0;
  position: relative;
}

.file-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  font-weight: 450;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  margin: calc(-1 * var(--space-1)) calc(-1 * var(--space-2));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.file-title:hover {
  background: var(--bg-panel-hover);
  color: var(--acc);
}

.file-title.editing {
  display: block;
  -webkit-line-clamp: unset;
  background: var(--bg-elevated);
  border: 1px solid var(--acc);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: text;
  outline: none;
  overflow: visible;
  word-break: normal;
}

.file-title.editing:focus {
  box-shadow: 0 0 0 3px var(--acc-light);
}

.kv {
  /* Sleek typography for metadata labels */
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.01em;
  line-height: 1.5;
  margin-top: var(--space-1);
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.select {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border: 1px solid var(--stroke);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 8px var(--space-md);
  position: relative;
  cursor: pointer;
  min-width: 140px;
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  /* COSS UI: Subtle inset shadow */
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all var(--transition-fast);
}

.select:hover {
  border-color: var(--stroke-strong);
  background: var(--bg-panel);
}

.select:focus-within {
  border-color: var(--acc);
  /* COSS UI: Ring with offset */
  box-shadow:
    0 0 0 var(--ring-offset) var(--bg-panel),
    0 0 0 calc(var(--ring-width) + var(--ring-offset)) rgba(78, 161, 255, var(--ring-opacity)),
    inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.select .material-icons {
  font-size: 18px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.select:focus-within .material-icons {
  color: var(--acc);
}

select {
  all: unset;
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  padding-right: 28px;
  min-width: 0;
  letter-spacing: 0.2px;
}

select::-ms-expand {
  display: none;
}

/* Custom dropdown arrow */
.select::after {
  content: 'expand_more';
  font-family: 'Material Icons';
  font-size: 20px;
  color: var(--ink-muted);
  position: absolute;
  right: var(--space-md);
  pointer-events: none;
  line-height: 1;
}

.select:focus-within::after {
  color: var(--acc);
}

/* Force white/light background for all select options to override gray */
select option {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #1a1a1a !important;
  padding: 10px var(--space-md);
  font-size: 14px;
  font-weight: 500;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Override default gray/disabled appearance - force white background */
select option:not(:disabled) {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #1a1a1a !important;
}

select option:hover {
  background-color: #f5f5f5 !important;
  background: #f5f5f5 !important;
  color: #1a1a1a !important;
}

select option:checked,
select option:focus {
  background-color: #e3f2fd !important;
  background: #e3f2fd !important;
  color: #1976d2 !important;
  font-weight: 600;
}

/* Remove gray disabled state appearance */
select option:disabled {
  background-color: #f5f5f5 !important;
  background: #f5f5f5 !important;
  color: #999999 !important;
  opacity: 0.6;
}

/* Visibility color coding - Force explicit colors to override gray */
select.vis option[value='private'] {
  color: #6366f1 !important; /* Indigo for Özel (Private) */
  font-weight: 600;
  background-color: #ffffff !important;
  background: #ffffff !important;
}

select.vis option[value='private']:hover {
  background-color: #eef2ff !important;
  background: #eef2ff !important;
  color: #6366f1 !important;
}

select.vis option[value='private']:checked {
  background-color: #e0e7ff !important;
  background: #e0e7ff !important;
  color: #6366f1 !important;
  font-weight: 700;
}

select.vis option[value='public'] {
  color: #10b981 !important; /* Green for Genel (Public) */
  font-weight: 600;
  background-color: #ffffff !important;
  background: #ffffff !important;
}

select.vis option[value='public']:hover {
  background-color: #ecfdf5 !important;
  background: #ecfdf5 !important;
  color: #10b981 !important;
}

select.vis option[value='public']:checked {
  background-color: #d1fae5 !important;
  background: #d1fae5 !important;
  color: #10b981 !important;
  font-weight: 700;
}

select.vis option[value='password'] {
  color: #f59e0b !important; /* Amber/Orange for Şifreli (Password) */
  font-weight: 600;
  background-color: #ffffff !important;
  background: #ffffff !important;
}

select.vis option[value='password']:hover {
  background-color: #fffbeb !important;
  background: #fffbeb !important;
  color: #f59e0b !important;
}

select.vis option[value='password']:checked {
  background-color: #fef3c7 !important;
  background: #fef3c7 !important;
  color: #f59e0b !important;
  font-weight: 700;
}

/* Color the select text based on data-visibility attribute */
.select[data-visibility='private'] select.vis {
  color: #6366f1;
  text-shadow: 0 1px 2px rgba(99, 102, 241, 0.2);
}

.select[data-visibility='public'] select.vis {
  color: #10b981;
  text-shadow: 0 1px 2px rgba(16, 185, 129, 0.2);
}

.select[data-visibility='password'] select.vis {
  color: #f59e0b;
  text-shadow: 0 1px 2px rgba(245, 158, 11, 0.2);
}

/* Visibility Tooltip - Simple CSS-only tooltip */
.select.vis-wrapper {
  position: relative;
  display: flex;
  width: 100%;
  flex: 1;
  min-width: 0;
  align-items: center;
  height: 32px;
}

.select.vis-wrapper .vis-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1;
}

.select.vis-wrapper .vis-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--ink);
}

.select.vis-wrapper:hover .vis-tooltip,
.select.vis-wrapper:focus-within .vis-tooltip {
  opacity: 1;
}

/* Ensure select element is clickable and full width */
.select.vis-wrapper select {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 32px;
  line-height: 32px;
  padding-left: 0;
  padding-top: 0;
  padding-bottom: 0;
  vertical-align: middle;
}

/* Ensure consistent height for vis-wrapper in cards and tables */
.file-card .select.vis-wrapper,
.files-table .select.vis-wrapper {
  height: 32px;
  min-height: 32px;
  max-height: 32px;
}

/* Ensure icon inside vis-wrapper has consistent size and aligns with select text */
.select.vis-wrapper .material-icons {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 32px;
}

/* Update select wrapper border color based on visibility - Modernized */
.select[data-visibility='private'] {
  border-color: rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), var(--bg-elevated));
}

.select[data-visibility='private']:hover {
  border-color: #6366f1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), var(--bg-panel));
  box-shadow:
    0 4px 12px rgba(99, 102, 241, 0.15),
    0 2px 4px rgba(99, 102, 241, 0.1);
}

.select[data-visibility='private']:focus-within {
  box-shadow:
    0 0 0 4px rgba(99, 102, 241, 0.2),
    0 4px 16px rgba(99, 102, 241, 0.25);
}

.select[data-visibility='public'] {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), var(--bg-elevated));
}

.select[data-visibility='public']:hover {
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), var(--bg-panel));
  box-shadow:
    0 4px 12px rgba(16, 185, 129, 0.15),
    0 2px 4px rgba(16, 185, 129, 0.1);
}

.select[data-visibility='public']:focus-within {
  box-shadow:
    0 0 0 4px rgba(16, 185, 129, 0.2),
    0 4px 16px rgba(16, 185, 129, 0.25);
}

.select[data-visibility='password'] {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), var(--bg-elevated));
}

.select[data-visibility='password']:hover {
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), var(--bg-panel));
  box-shadow:
    0 4px 12px rgba(245, 158, 11, 0.15),
    0 2px 4px rgba(245, 158, 11, 0.1);
}

.select[data-visibility='password']:focus-within {
  box-shadow:
    0 0 0 4px rgba(245, 158, 11, 0.2),
    0 4px 16px rgba(245, 158, 11, 0.25);
}

.select[data-visibility='private'] .material-icons {
  color: #6366f1;
  filter: drop-shadow(0 1px 2px rgba(99, 102, 241, 0.3));
}

.select[data-visibility='public'] .material-icons {
  color: #10b981;
  filter: drop-shadow(0 1px 2px rgba(16, 185, 129, 0.3));
}

.select[data-visibility='password'] .material-icons {
  color: #f59e0b;
  filter: drop-shadow(0 1px 2px rgba(245, 158, 11, 0.3));
}

.url {
  width: 100%;
  white-space: nowrap;
  overflow-x: auto;
  padding: 8px var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  background: var(--bg-elevated);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  min-width: 140px;
  height: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  transition: all var(--transition-fast);
}

/* Short-url styling matches file-actions-tabs style - defined below in table section */

.short-url:not(input) {
  cursor: pointer;
}

.short-url:not(input):active {
  transform: scale(0.98);
}

.url:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-light);
  outline: none;
}

/* Fix input width in modal to prevent highlight overflow */
#linkDlgUrl {
  max-width: 100%;
  box-sizing: border-box;
  width: 100%;
  /* Ensure input doesn't overflow its container */
  margin-left: 0;
  margin-right: 0;
}

/* Reduce focus box-shadow for modal input to prevent visual overflow */
#linkDlgUrl:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 2px var(--acc-light);
  outline: none;
}

.url[readonly] {
  cursor: pointer;
}

.url[readonly]:hover {
  background: var(--bg-panel-hover);
  border-color: var(--stroke-strong);
}

.url[readonly]:active {
  background: var(--bg-panel);
  transform: scale(0.98);
}

.url::-webkit-scrollbar {
  height: 4px;
}

.url::-webkit-scrollbar-thumb {
  background: var(--stroke-strong);
  border-radius: 2px;
}

/* ===== TABLE ===== */
.files-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  animation: fadeIn 0.3s ease-out;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--stroke);
}

.files-table th,
.files-table td {
  border-bottom: 1px solid var(--stroke);
  padding: var(--space-md) var(--space-md);
  text-align: left;
  overflow: visible;
  vertical-align: middle;
}

/* Sleek typography for all table cells */
.files-table td {
  font-size: 14px;
  font-weight: 450;
  line-height: 1.6;
  letter-spacing: -0.005em;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Allow tooltips to overflow table cells */
.files-table td:nth-child(5) {
  overflow: visible;
  position: relative;
  z-index: 1;
}

.files-table th {
  /* Sleek typography for headers */
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-subtle);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  background: var(--bg-panel);
  padding: var(--space-3) var(--space-md);
  border-bottom: 1px solid var(--stroke);
  /* Better number rendering */
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Column widths for headers */
.files-table th:nth-child(1),
.files-table td:nth-child(1) {
  width: 50px;
  min-width: 50px;
  max-width: 50px;
  text-align: center;
}

.files-table th:nth-child(2),
.files-table td:nth-child(2) {
  width: 35%;
  min-width: 220px;
}

.files-table th:nth-child(3),
.files-table td:nth-child(3) {
  width: 10%;
  min-width: 90px;
}

.files-table th:nth-child(4),
.files-table td:nth-child(4) {
  width: 11%;
  min-width: 110px;
}

.files-table th:nth-child(5),
.files-table td:nth-child(5) {
  width: 13%;
  min-width: 130px;
}

.files-table th:nth-child(6),
.files-table td:nth-child(6) {
  width: 12%;
  min-width: 110px;
}

.files-table th:nth-child(7),
.files-table td:nth-child(7) {
  width: 19%;
  min-width: 175px;
  text-align: left;
}

/* Cell-specific styling (not headers) */
.files-table td:nth-child(3),
.files-table td:nth-child(4) {
  /* Sleek typography for metadata columns - match header styling */
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.01em;
  line-height: 1.5;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


.files-table td:nth-child(7) {
  position: relative;
  overflow: visible !important;
}

/* Filename column text handling */
.files-table td:nth-child(2) {
  overflow: hidden;
  position: relative;
}

.files-table td:nth-child(2) .row {
  gap: var(--space-3);
}

.files-table td:nth-child(2) .file-ico {
  width: 40px;
  height: 40px;
}

.files-table td:nth-child(2) .file-ico .material-icons {
  font-size: 20px;
}

.files-table td:nth-child(2) .file-title {
  /* Sleek typography for filenames */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  font-size: 14px;
  font-weight: 450;
  line-height: 1.5;
  letter-spacing: -0.01em;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.files-table td:nth-child(7) .row {
  position: relative;
  z-index: 1;
  overflow: visible;
  gap: var(--space-xs);
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.files-table td:nth-child(7) .btn {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: all var(--transition-fast);
  gap: var(--space-xs);
  min-width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
}

.files-table td:nth-child(7) .btn:hover {
  z-index: 10;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.files-table td:nth-child(7) .btn:active {
  transform: translateY(0);
}

.files-table td:nth-child(7) .btn .material-icons {
  font-size: 18px;
  flex-shrink: 0;
}

.files-table td:nth-child(7) .btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-muted);
}

.files-table td:nth-child(7) .btn.ghost:hover {
  background: var(--bg-panel-hover);
  border-color: var(--stroke);
  color: var(--ink);
}

.files-table td:nth-child(7) .btn.destruct {
  background: transparent;
  border-color: transparent;
  color: var(--ink-muted);
}

.files-table td:nth-child(7) .btn.destruct:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: var(--danger);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

/* Download button hover - green icon */
.files-table td:nth-child(7) [data-act='download']:hover:not(:disabled) .material-icons {
  color: var(--ok);
}

.files-table tbody tr {
  transition: all var(--transition-fast);
  cursor: grab;
}

.files-table tbody tr:active {
  cursor: grabbing;
}

.files-table tbody tr:hover {
  background: var(--bg-panel-hover);
  border-left: 2px solid var(--acc);
}

.files-table tbody tr:hover td:first-child {
  padding-left: calc(var(--space-md) - 2px);
}

.files-table tbody tr:first-child td:first-child {
  border-top-left-radius: var(--radius-lg);
}

.files-table tbody tr:first-child td:last-child {
  border-top-right-radius: var(--radius-lg);
}

.files-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius-lg);
}

.files-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius-lg);
}

.files-table tr.pinned-row {
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.05), transparent);
  border-left: 3px solid var(--warn);
}

.files-table tr.pinned-row td:first-child {
  padding-left: calc(var(--space-md) - 3px);
}

.files-table tr.dragging {
  opacity: 0.5;
}

.files-table tr.drag-over {
  border-top: 2px solid var(--acc);
}

.short-url {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-width: 0;
  height: auto;
  min-height: 32px;
  padding: var(--space-2) var(--space-3);
  box-sizing: border-box;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  /* Sleek typography for URLs */
  font-size: 13px;
  font-weight: 450;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  color: var(--acc);
  transition: all var(--transition-fast);
  font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.short-url:hover {
  background: white;
  color: var(--acc);
  border-color: var(--stroke-hover);
}

.empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--ink-muted);
}

.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  border: 2px dashed var(--stroke);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--acc-light);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.empty-state:hover {
  border-color: var(--acc);
  background: var(--bg-panel);
}

.empty-state:hover::before {
  opacity: 1;
}

.empty-state.drag {
  border-color: var(--acc);
  background: var(--acc-light);
  transform: scale(1.02);
}

.empty-state.drag::before {
  opacity: 1;
}

.empty-state > * {
  position: relative;
  z-index: 1;
}

.empty-icon {
  animation: float 3s ease-in-out infinite;
}

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

/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-panel) 0%,
    var(--bg-panel-hover) 50%,
    var(--bg-panel) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

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

.skeleton-card {
  width: 100%;
  min-height: 160px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
  background: var(--bg-elevated);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.skeleton-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
}

.skeleton-title {
  height: 20px;
  width: 70%;
  margin-bottom: 8px;
}

.skeleton-text {
  height: 14px;
  width: 50%;
}

/* ===== UPLOAD PROGRESS ===== */
.upload-progress-container {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
  padding: 0 var(--space-lg); /* Match .bar padding */
}

.upload-progress-overall {
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

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

.upload-progress-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.upload-progress-percent {
  font-size: 14px;
  font-weight: 600;
  color: var(--acc);
  font-family: var(--font-mono);
}

.upload-cancel-all {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}

.upload-cancel-all:hover {
  background: var(--bg-panel);
  color: var(--danger);
}

.upload-cancel-all .material-icons {
  font-size: 20px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-panel);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  margin-top: var(--space-xs);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--acc), var(--acc-hover));
  border-radius: var(--radius-full);
  transition: width 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progress-shine 1.5s infinite;
}

@keyframes progress-shine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.file-progress-queue {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.file-progress-card {
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: all var(--transition-fast);
  margin-bottom: var(--space-xs);
}

.file-progress-card.uploading {
  border-color: var(--acc);
  background: var(--acc-light);
}

.file-progress-card.completed {
  border-color: var(--ok);
  background: rgba(34, 211, 238, 0.1);
}

.file-progress-card.error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.file-progress-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.file-progress-icon .material-icons {
  font-size: 24px;
  color: var(--acc);
}

.file-progress-card.completed .file-progress-icon .material-icons {
  color: var(--ok);
}

.file-progress-card.error .file-progress-icon .material-icons {
  color: var(--danger);
}

.file-progress-info {
  flex: 1;
  min-width: 0;
}

.file-progress-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: var(--space-sm);
}

.file-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-panel);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.file-progress-fill {
  height: 100%;
  background: var(--acc);
  border-radius: var(--radius-full);
  transition: width 0.2s ease-out;
}

.file-progress-card.completed .file-progress-fill {
  background: var(--ok);
}

.file-progress-card.error .file-progress-fill {
  background: var(--danger);
}

.file-progress-status {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: var(--space-xs);
}

.file-progress-percent {
  font-size: 12px;
  font-weight: 600;
  color: var(--acc);
  font-family: var(--font-mono);
  min-width: 50px;
  text-align: right;
}

.file-progress-cancel {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

.file-progress-cancel:hover {
  background: var(--bg-panel);
  color: var(--danger);
}

.file-progress-cancel .material-icons {
  font-size: 20px;
}

.file-progress-card.completed .file-progress-cancel,
.file-progress-card.error .file-progress-cancel {
  display: none;
}

.file-progress-card.completed .file-progress-percent {
  color: var(--ok);
}

.file-progress-card.error .file-progress-percent {
  color: var(--danger);
}

.file-progress-actions {
  display: flex;
  gap: var(--space-xs);
}

.file-progress-card.hidden {
  display: none;
}

.file-progress-card.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(-20px);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* ===== BATCH OPERATIONS ===== */
.batch-toolbar {
  display: none;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg); /* Match horizontal padding with .bar */
  margin: var(--space-md) var(--space-lg) var(--space-lg); /* Match horizontal margin with padding */
  align-items: center;
  gap: var(--space-lg);
  transition: all var(--transition-base);
}

.batch-toolbar.active {
  display: flex;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.batch-info {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-right: var(--space-md);
}

.batch-actions {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

/* ===== BATCH ACTIONS - COMPACT TAB STYLE ===== */
.batch-actions-tabs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-1);
}

.batch-tab {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--ink-muted);
  background: transparent;
  border: none;
  font-family: var(--font);
  white-space: nowrap;
}

.batch-tab:hover:not(:disabled) {
  background: var(--bg-panel-hover);
  color: var(--ink);
}

.batch-tab .material-icons {
  font-size: 18px;
}

.batch-tab-label {
  display: inline-block;
}

.batch-tab-destructive {
  color: var(--danger);
}

.batch-tab-destructive:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.batch-tab-close {
  margin-left: var(--space-2);
  padding: var(--space-2);
  min-width: auto;
}

/* Batch Actions Dropdown */
.batch-actions-dropdown {
  position: relative;
}

.batch-dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);
  z-index: 1000;
  animation: slideDown 0.2s ease-out;
  overflow: hidden;
}

.batch-menu-item {
  all: unset;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--ink);
  font-family: var(--font);
  box-sizing: border-box;
}

.batch-menu-item:first-child {
  border-radius: calc(var(--radius-md) - 2px) calc(var(--radius-md) - 2px) calc(var(--radius-md) - 4px) calc(var(--radius-md) - 4px);
}

.batch-menu-item:last-child {
  border-radius: calc(var(--radius-md) - 4px) calc(var(--radius-md) - 4px) calc(var(--radius-md) - 2px) calc(var(--radius-md) - 2px);
}

.batch-menu-item:only-child {
  border-radius: calc(var(--radius-md) - 2px);
}

.batch-menu-item:hover {
  background: var(--bg-panel-hover);
  color: var(--ink);
}

.batch-menu-item .material-icons {
  font-size: 16px;
}

.batch-menu-item-destructive {
  color: var(--danger);
}

.batch-menu-item-destructive:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* ===== FILE ACTIONS - COMPACT TAB STYLE ===== */
.file-actions-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  box-sizing: border-box;
}

.file-action-tab {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--ink-muted);
  background: transparent;
  border: none;
  min-width: 32px;
  height: 32px;
  box-sizing: border-box;
}

.file-action-tab:hover:not(:disabled) {
  background: var(--bg-panel-hover);
  color: var(--ink);
}

.file-action-tab .material-icons {
  font-size: 18px;
}

/* Downloading state - red cancel icon */
.file-action-tab.downloading .material-icons {
  color: var(--danger);
}

.file-action-tab.downloading:hover .material-icons {
  color: var(--danger);
}

.file-action-tab-label {
  display: inline;
  font-size: 12px;
  white-space: nowrap;
}

/* Hide labels in card view - show icons only */
.file-actions-tabs-card .file-action-tab-label {
  display: none;
}

/* Better spacing and alignment for card view action tabs */
.file-actions-tabs-card {
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2);
}

.file-actions-tabs-card .file-action-tab {
  flex: 1;
  min-width: 0;
  padding: var(--space-2);
  justify-content: center;
}

/* Destructive action styling for card view */
.file-action-tab-destructive {
  color: var(--ink-muted);
}

.file-action-tab-destructive:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.file-action-tab-destructive .material-icons {
  color: inherit;
}

.file-actions-dropdown {
  position: relative;
}

/* Ensure wrapper has higher z-index when dropdown is open */
.file-actions-tabs:has(.file-more-actions[aria-expanded="true"]) {
  z-index: 3002;
}

.file-dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);
  z-index: 1000;
  animation: slideDown 0.2s ease-out;
  box-sizing: border-box;
}

.file-menu-item {
  all: unset;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--ink);
  font-family: var(--font);
  box-sizing: border-box;
}

.file-menu-item:first-child {
  border-radius: calc(var(--radius-md) - 2px) calc(var(--radius-md) - 2px) calc(var(--radius-md) - 4px) calc(var(--radius-md) - 4px);
}

.file-menu-item:last-child {
  border-radius: calc(var(--radius-md) - 4px) calc(var(--radius-md) - 4px) calc(var(--radius-md) - 2px) calc(var(--radius-md) - 2px);
}

.file-menu-item:only-child {
  border-radius: calc(var(--radius-md) - 2px);
}

.file-menu-item:hover {
  background: var(--bg-panel-hover);
  color: var(--ink);
}

.file-menu-item .material-icons {
  font-size: 16px;
}

.file-menu-item-destructive {
  color: var(--danger);
}

.file-menu-item-destructive:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.file-menu-item-destructive .material-icons {
  color: var(--danger);
}

.file-menu-item-destructive:hover .material-icons {
  color: var(--danger);
}

/* ===== VISIBILITY DROPDOWN - COMPACT STYLE ===== */
.vis-dropdown-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

/* Ensure the wrapper and its parent TD have higher z-index when dropdown is open */
.vis-dropdown-wrapper:has(.vis-dropdown-trigger[aria-expanded="true"]) {
  z-index: 3002;
}

/* Also apply z-index to parent table cell when dropdown is open */
td:has(.vis-dropdown-trigger[aria-expanded="true"]) {
  position: relative;
  z-index: 3002;
  overflow: visible;
}

/* Ensure table allows overflow when dropdown is open */
.files-table:has(.vis-dropdown-trigger[aria-expanded="true"]) {
  overflow: visible;
}

/* Ensure card view allows overflow when dropdown is open */
.file-card:has(.vis-dropdown-trigger[aria-expanded="true"]) {
  overflow: visible;
  position: relative;
  z-index: 3001;
}

/* Also handle file actions dropdown */
td:has(.file-more-actions[aria-expanded="true"]) {
  position: relative;
  z-index: 3002;
  overflow: visible;
}

.files-table:has(.file-more-actions[aria-expanded="true"]) {
  overflow: visible;
}

.vis-dropdown-trigger {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
  box-sizing: border-box;
  font-family: var(--font);
}

.vis-dropdown-trigger:hover {
  background: white;
  border-color: var(--stroke-hover);
}

.vis-dropdown-trigger[aria-expanded="true"] {
  background: var(--bg-panel-hover);
  position: relative;
  z-index: 3001;
}

.vis-dropdown-trigger .vis-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.vis-dropdown-trigger .vis-label {
  flex: 1;
  text-align: left;
}

.vis-dropdown-trigger .vis-arrow {
  font-size: 20px;
  color: var(--ink-muted);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.vis-dropdown-trigger[aria-expanded="true"] .vis-arrow {
  transform: rotate(180deg);
}

/* Color the trigger based on visibility */
.vis-dropdown-trigger[data-visibility="private"] {
  color: #6366f1;
}

.vis-dropdown-trigger[data-visibility="private"] .vis-icon {
  color: #6366f1;
}

.vis-dropdown-trigger[data-visibility="public"] {
  color: #10b981;
}

.vis-dropdown-trigger[data-visibility="public"] .vis-icon {
  color: #10b981;
}

.vis-dropdown-trigger[data-visibility="password"] {
  color: #f59e0b;
}

.vis-dropdown-trigger[data-visibility="password"] .vis-icon {
  color: #f59e0b;
}

.vis-dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);
  z-index: 3000;
  animation: slideDown 0.2s ease-out;
}

.vis-menu-item {
  all: unset;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font);
  box-sizing: border-box;
  font-weight: 500;
}

.vis-menu-item .material-symbols-outlined {
  font-size: 18px;
  flex-shrink: 0;
}

/* Private (Özel) - Indigo */
.vis-menu-item[data-visibility="private"] {
  color: #6366f1;
}

.vis-menu-item[data-visibility="private"]:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

/* Public (Genel) - Green */
.vis-menu-item[data-visibility="public"] {
  color: #10b981;
}

.vis-menu-item[data-visibility="public"]:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

/* Password (Şifreli) - Amber */
.vis-menu-item[data-visibility="password"] {
  color: #f59e0b;
}

.vis-menu-item[data-visibility="password"]:hover {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.file-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
}

.file-checkbox .checkbox-icon {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  color: var(--ink-muted);
  transition: all var(--transition-fast);
}

.file-checkbox:hover .checkbox-icon {
  color: var(--acc);
}

.file-checkbox input[type='checkbox'] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
  z-index: 1;
}

.file-checkbox input[type='checkbox']:checked ~ .checkbox-icon,
.file-checkbox.checked .checkbox-icon {
  color: var(--acc);
}

.file-checkbox .checkbox-icon.unchecked {
  display: block;
}

.file-checkbox .checkbox-icon.checked {
  display: none;
}

.file-checkbox input[type='checkbox']:checked ~ .checkbox-icon.unchecked,
.file-checkbox.checked .checkbox-icon.unchecked {
  display: none;
}

.file-checkbox input[type='checkbox']:checked ~ .checkbox-icon.checked,
.file-checkbox.checked .checkbox-icon.checked {
  display: block;
}

.file-card.has-checkbox,
.files-table tr.has-checkbox {
  position: relative;
}

.file-card .file-checkbox-wrapper,
.files-table th:first-child,
.files-table td:first-child {
  position: relative;
}

/* Ensure filename column has proper width and text handling */
.files-table td:nth-child(2) .row {
  min-width: 0;
}

.files-table td:nth-child(2) > .row > div:last-child {
  min-width: 0;
  flex: 1;
}

/* ===== FILTER CHIPS ===== */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
  padding: 0 var(--space-lg); /* Match horizontal padding with .bar */
  min-height: 40px;
  align-items: center;
  animation: slideDown 0.3s ease-out;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.filter-chip:hover {
  border-color: var(--stroke-strong);
  background: var(--bg-panel);
}

.filter-chip.active {
  background: var(--acc-light);
  border-color: var(--acc);
  color: var(--acc);
}

.filter-chip .material-icons {
  font-size: 16px;
}

.filter-chip .chip-remove {
  margin-left: var(--space-xs);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.filter-chip .chip-remove:hover {
  opacity: 1;
}

/* Filter buttons active state */
#filterControls .btn.active {
  background: var(--acc-light);
  border-color: var(--acc);
  color: var(--acc);
}

#filterControls .btn:hover {
  background: var(--bg-panel-hover);
  border-color: var(--stroke-strong);
}

.filter-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px var(--space-md);
  white-space: nowrap;
}

.filter-label {
  font-size: 13px;
  font-weight: 500;
}

.filter-dropdown-btn.active .filter-label {
  color: var(--acc);
  font-weight: 600;
}

/* Filter count badge */
.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: var(--acc);
  color: white;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
  line-height: 1;
}

.filter-dropdown-btn.active .filter-badge {
  background: var(--acc);
}

.filter-menu {
  position: fixed;
  background: var(--bg-panel);
  border: 1.5px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.25),
    0 4px 12px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  min-width: 180px;
  z-index: 2147483647;
  padding: var(--space-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  animation: slideDown 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  isolation: isolate;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.filter-dropdown-wrapper {
  position: relative;
  z-index: 1000;
}

.filter-menu-item {
  all: unset;
  display: flex;
  align-items: center;
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  background: transparent;
}

.filter-menu-item:hover {
  background: var(--bg-panel-hover);
  font-weight: 600;
}

.filter-menu-item.active {
  background: var(--acc-light);
  color: var(--acc);
  font-weight: 600;
}

.filter-menu-item.active::before {
  content: 'check';
  font-family: 'Material Icons';
  font-size: 18px;
  margin-right: var(--space-sm);
  color: var(--acc);
}

/* ===== RIPPLE EFFECT ===== */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.btn {
  position: relative;
  overflow: hidden;
}

/* ===== SPINNER ===== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--stroke);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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

.spinner-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-2xl);
}

/* ===== SUCCESS CHECKMARK ===== */
.checkmark-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ok);
  color: white;
  margin-right: var(--space-sm);
  animation: checkmark-pop 0.4s ease-out;
}

@keyframes checkmark-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.toast.ok .checkmark-icon {
  display: inline-flex;
}

/* ===== DRAG FEEDBACK ENHANCEMENTS ===== */
.file-card.dragging,
.files-table tr.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  box-shadow: 0 8px 24px rgba(78, 161, 255, 0.3);
}

.file-card.drag-over,
.files-table tr.drag-over {
  border-color: var(--acc);
  background: var(--acc-light);
  transform: scale(1.02);
}

/* ===== COLOR TRANSITIONS ===== */
* {
  transition:
    color var(--transition-base),
    background-color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

/* ===== PAGE TRANSITIONS ===== */
#filesWrap {
  transition: opacity var(--transition-base);
}

#filesWrap.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

.file-card.slide-up,
.files-table tr.slide-up {
  animation: slideUp 0.3s ease-out;
}

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

.skeleton-text {
  height: 14px;
  width: 50%;
}

.skeleton-row {
  height: 40px;
  width: 100%;
}

.skeleton-table-row {
  height: 60px;
}

.skeleton-table-cell {
  height: 20px;
  width: 80%;
}

/* ===== STATS ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  padding: var(--space-xl) var(--space-lg); /* Match horizontal padding with .bar */
  transform: translateZ(0); /* Force GPU acceleration to prevent clipping */
}

.stat-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.stat-card:hover {
  border-color: var(--stroke-strong);
  background: var(--bg-panel-hover);
}

/* Responsive stats grid */
.stats-responsive {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* Analytics grid uses same styling as stats */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.stat-card-fullwidth {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.stat-storage-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--stroke);
  flex-shrink: 0;
}

/* Storage Progress Bar */
.storage-progress-container {
  width: 100%;
}

.storage-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--stroke);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-xs);
}

.storage-progress-fill {
  height: 100%;
  background: var(--ok);
  border-radius: var(--radius-full);
  transition:
    width var(--transition-base),
    background-color var(--transition-base);
  width: 0%;
}

.storage-progress-fill.warning {
  background: var(--warn);
}

.storage-progress-fill.danger {
  background: var(--danger);
}

.storage-progress-text {
  font-size: 11px;
  color: var(--ink-muted);
  text-align: right;
}

/* Analytics Empty State Message */
.analytics-empty-message {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  padding: var(--space-md);
  margin-top: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
  justify-content: center;
}

.analytics-empty-message .material-icons {
  color: var(--acc);
  opacity: 0.7;
}

@media (max-width: 1024px) {
  .stats-responsive {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Analytics 4-column grid becomes 2-column on tablet */
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

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

  /* Analytics becomes single column on mobile */
  .analytics-grid {
    grid-template-columns: 1fr !important;
  }

  .stat-card-fullwidth {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
  }

  .stat-divider {
    width: 100%;
    height: 1px;
    margin: var(--space-sm) 0;
  }

  .stat-storage-item {
    flex: none;
  }
}

@media (max-width: 480px) {
  :root {
    --container-padding: var(--space-3); /* 12px on small mobile */
    --grid-gap: var(--space-2); /* 8px gap on small mobile */
  }
  .stat-card-fullwidth {
    padding: var(--space-md);
  }

  .stat-storage-item {
    gap: var(--space-sm);
  }
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--acc-light);
  color: var(--acc);
  flex-shrink: 0;
}

.stat-icon .material-icons {
  font-size: 24px;
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-label {
  /* Sleek typography for stat labels */
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: var(--space-xs);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.stat-value {
  /* Sleek typography for stat values */
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== USER MENU ===== */
.userbox {
  position: relative;
}

.userchip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  cursor: pointer;
  color: var(--ink);
  transition: all var(--transition-fast);
}

.userchip:hover {
  background: var(--bg-panel-hover);
  border-color: var(--stroke-strong);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  background: linear-gradient(135deg, var(--acc), #2b6cb0);
  color: white;
  box-shadow: 0 2px 4px rgba(78, 161, 255, 0.2);
}

.avatar.small {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.uname {
  font-weight: 600;
  font-size: 14px;
}

.usermenu {
  position: absolute;
  right: 0;
  margin-top: var(--space-sm);
  min-width: 240px;
  z-index: 50;
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-md);
  display: none;
  animation: slideDown 0.2s ease-out;
}

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

.usermenu.show {
  display: block;
}

.urow {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-sm);
}

.uinfo {
  flex: 1;
  min-width: 0;
}

.uemail {
  color: var(--ink-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ulogout {
  display: block;
  margin-top: var(--space-md);
  padding: 10px;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.ulogout:hover {
  background: var(--bg-panel-hover);
  border-color: var(--stroke-strong);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  right: var(--space-lg);
  bottom: var(--space-lg);
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  /* COSS UI: Enhanced toast shadow */
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.12),
    0 4px 8px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  transition: all var(--transition-base);
  z-index: 1000;
  max-width: 320px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

.toast.ok {
  border-color: var(--ok);
  background: rgba(34, 211, 238, 0.1);
}

.toast.danger {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.toast.toast-large {
  max-width: 420px;
  padding: 16px 20px;
}

.toast.toast-large .btn {
  padding: 10px 16px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

/* ===== UPLOAD PROGRESS ===== */
.upload-progress {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  min-width: 320px;
  max-width: 420px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}

.progress-filename {
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.progress-status {
  font-size: 13px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.progress-bar-container {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--acc), var(--acc-hover));
  transition: width 0.3s ease;
  border-radius: var(--radius-full);
}

.progress-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-muted);
}

@media (max-width: 768px) {
  .upload-progress {
    left: var(--space-md);
    right: var(--space-md);
    top: auto;
    bottom: var(--space-md);
    min-width: auto;
  }
}

/* ===== DIALOG ===== */
dialog {
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  color: var(--ink);
  padding: var(--space-xl);
  max-width: 400px;
  width: 90%;
  /* COSS UI: Enhanced modal shadow with layering */
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.12),
    0 4px 8px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  animation: scaleIn 0.2s ease-out;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 90vh;
}

/* Link dialog - width based on content, using grid system */
#linkDlg {
  width: fit-content;
  min-width: 480px;
  max-width: min(600px, calc(100vw - var(--space-8) * 2));
}

dialog[open] {
  display: block;
}

/* Mobile responsive link dialog */
@media (max-width: 768px) {
  #linkDlg {
    min-width: 0;
    width: calc(100vw - var(--space-md) * 2);
    max-width: calc(100vw - var(--space-md) * 2);
    padding: var(--space-lg);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-height: 85vh;
  }
  
  #linkDlg h3 {
    font-size: 16px;
    margin-bottom: var(--space-sm);
  }
  
  #linkDlg p {
    font-size: 13px;
    margin-bottom: var(--space-md);
  }
  
  #linkDlgUrl {
    font-size: 13px;
    padding: var(--space-sm) var(--space-md);
    word-break: break-all;
  }
  
  #linkDlgExpirySection {
    padding: var(--space-sm) !important;
    margin-top: var(--space-md) !important;
  }
  
  #linkDlgExpirySection label {
    font-size: 13px !important;
  }
  
  #linkDlgExpiry {
    font-size: 14px;
    padding: var(--space-sm) var(--space-md);
  }
  
  #linkDlgExpiryInfo {
    font-size: 12px !important;
    margin-top: var(--space-xs) !important;
  }
  
  #linkDlgCustomExpiry {
    margin-top: var(--space-sm) !important;
  }
  
  #linkDlgCustomDate {
    font-size: 14px;
    padding: var(--space-sm) var(--space-md);
  }
  
  #linkDlg .dialog-actions {
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
  }
  
  #linkDlg .dialog-actions .btn {
    width: 100%;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  #linkDlg {
    width: calc(100vw - var(--space-sm) * 2);
    max-width: calc(100vw - var(--space-sm) * 2);
    padding: var(--space-md);
    max-height: 90vh;
  }
  
  #linkDlg h3 {
    font-size: 15px;
  }
  
  #linkDlgUrl {
    font-size: 12px;
    padding: 8px var(--space-sm);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

dialog h3 {
  margin: 0 0 var(--space-md) 0;
  font-size: 18px;
  font-weight: 600;
}

dialog p {
  margin-bottom: var(--space-lg);
  color: var(--ink-muted);
  font-size: 14px;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  overflow: hidden;
}

#deleteMessage {
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.5;
}

input[type='password'],
input[type='text'] {
  width: 100%;
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  color: var(--ink);
  font-size: 14px;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-lg);
  /* COSS UI: Subtle inset shadow */
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

input[type='password']:hover,
input[type='text']:hover {
  border-color: var(--stroke-strong);
}

input[type='password']:focus,
input[type='text']:focus {
  outline: none;
  border-color: var(--acc);
  /* COSS UI: Ring with offset */
  box-shadow:
    0 0 0 var(--ring-offset) var(--bg-panel),
    0 0 0 calc(var(--ring-width) + var(--ring-offset)) rgba(78, 161, 255, var(--ring-opacity)),
    inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

/* Link dialog actions - more spacing, keep on same line */
#linkDlg .dialog-actions {
  gap: var(--space-md);
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: 100%;
}

#linkDlg .dialog-actions .btn {
  min-width: auto;
  flex: 0 0 auto;
  padding: 10px 16px;
  white-space: nowrap;
}


/* ===== BATCH TAGS DIALOG ===== */
#batchTagsDlg {
  max-width: 500px;
}

#batchTagsSelectContainer {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  background: var(--bg);
}

#batchTagsSelectContainer:empty {
  padding: var(--space-md);
}

#batchTagsSelectContainer label {
  margin: 0;
}

#batchTagsSelectContainer input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--acc);
}

#batchNewTagInput {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  transition: border-color var(--transition-fast);
}

#batchNewTagInput:focus {
  outline: none;
  border-color: var(--acc) !important;
}

#batchNewTagInput::placeholder {
  color: var(--ink-subtle);
}

/* ===== QR CODE ===== */
#qrCanvas {
  background: white;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
}

#qrCanvas canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

#qrCanvas img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

/* QR Dialog mobile styles */
@media (max-width: 768px) {
  #qrDlg {
    max-width: 95%;
    width: 95%;
    padding: var(--space-lg);
  }
  
  #qrCanvas {
    padding: var(--space-md);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #qrCanvas img {
    max-width: 100%;
    max-height: 300px;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  /* Force grid view on mobile - hide table */
  .files-table {
    display: none !important;
  }
  #filesWrap.list {
    display: grid !important;
    grid-template-columns: 1fr;
  }
  #filesWrap.grid {
    grid-template-columns: 1fr;
  }
  .container {
    padding: var(--space-lg) var(--space-md);
  }
  .bar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
    padding: var(--space-md);
  }
  .drop-wrap {
    padding: var(--space-xl) var(--space-md); /* Match .bar padding on mobile */
  }
  .stats {
    padding: var(--space-xl) var(--space-md); /* Match .bar padding on mobile */
  }
  #filesWrap.list,
  #filesWrap.grid {
    padding: var(--space-lg) var(--space-md); /* Match .bar padding on mobile */
  }
  .filter-chips {
    padding: 0 var(--space-md); /* Match .bar padding on mobile */
  }
  .batch-toolbar {
    padding: var(--space-md) var(--space-md); /* Match .bar padding on mobile */
    margin: var(--space-md) var(--space-md) var(--space-lg); /* Match horizontal margin */
  }
  .upload-progress-container {
    padding: 0 var(--space-md); /* Match .bar padding on mobile */
  }
  .search {
    min-width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }
  .search input {
    width: 100%;
    min-width: 0;
  }
  #filterControls {
    width: 100%;
    margin-left: 0;
    margin-top: var(--space-xs);
    justify-content: flex-start;
  }
  .filter-dropdown-btn {
    font-size: 12px;
    padding: 6px var(--space-sm);
  }
  .filter-label {
    font-size: 12px;
  }

  /* Hide view toggle buttons on mobile - always use cards */
  .view {
    display: none;
  }

  /* Stats cards stack on mobile */
  .stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .bar {
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
  }
  .drop-wrap {
    padding: var(--space-xl) var(--space-md); /* Match .bar padding on tablet */
  }
  .stats {
    padding: var(--space-xl) var(--space-md); /* Match .bar padding on tablet */
  }
  #filesWrap.list,
  #filesWrap.grid {
    padding: var(--space-lg) var(--space-md); /* Match .bar padding on mobile */
  }
  .filter-chips {
    padding: 0 var(--space-md); /* Match .bar padding on tablet */
  }
  .batch-toolbar {
    padding: var(--space-md) var(--space-md); /* Match .bar padding on tablet */
    margin: var(--space-md) var(--space-md) var(--space-lg); /* Match horizontal margin */
  }
  .upload-progress-container {
    padding: 0 var(--space-md); /* Match .bar padding on tablet */
  }
  .search {
    min-width: 0;
    flex: 1 1 100%;
    padding: 8px var(--space-sm);
  }
  #filterControls {
    margin-left: 0;
    width: 100%;
    margin-top: var(--space-xs);
  }
  .view {
    flex: 0 0 auto;
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  /* Base font size adjustment */
  body {
    font-size: 14px;
  }

  /* Navigation */
  .nav-inner {
    padding: var(--space-3) var(--space-4);
  }
  .brand {
    font-size: 16px;
    margin-left: 0;
  }

  /* Dropzone */
  .drop-wrap {
    padding: var(--space-lg);
  }
  .drop {
    min-height: 200px;
    padding: var(--space-xl);
  }
  .drop h3 {
    font-size: 18px;
  }
  .drop .mut {
    font-size: 12px;
  }

  /* Buttons */
  .btn {
    font-size: 13px;
    padding: 8px 12px;
  }

  /* Stats */
  .stat-value {
    font-size: 18px;
  }
  .stat-label {
    font-size: 11px;
  }
  .stat-card {
    padding: var(--space-md);
  }
  .stat-icon {
    width: 40px;
    height: 40px;
  }

  /* File cards - better mobile layout */
  .file-card {
    padding: var(--space-lg);
    min-height: 180px;
    gap: var(--space-md);
  }

  /* Stack action buttons vertically on mobile */
  .file-card > .row:last-child {
    flex-direction: column;
    gap: var(--space-xs);
  }

  .file-card > .row:last-child .btn {
    flex: none;
    width: 100%;
    justify-content: center;
  }
  .file-title {
    font-size: 14px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  .kv {
    font-size: 12px;
  }
  .file-ico {
    width: 36px;
    height: 36px;
  }

  /* Search and toolbar */
  .search input {
    font-size: 14px;
  }

  /* Dialog */
  dialog {
    width: 95%;
    max-width: 95%;
    padding: var(--space-lg);
  }
  dialog h3 {
    font-size: 16px;
  }
  dialog p {
    font-size: 13px;
  }

  /* User menu */
  .uname {
    font-size: 13px;
  }
  .uemail {
    font-size: 11px;
  }

  .bar {
    padding: var(--space-sm);
  }
  .drop-wrap {
    padding: var(--space-xl) var(--space-sm); /* Match .bar padding on small mobile */
  }
  .stats {
    padding: var(--space-xl) var(--space-sm); /* Match .bar padding on small mobile */
  }
  #filesWrap.list,
  #filesWrap.grid {
    padding: var(--space-lg) var(--space-sm); /* Match .bar padding on small mobile */
  }
  .filter-chips {
    padding: 0 var(--space-sm); /* Match .bar padding on small mobile */
  }
  .batch-toolbar {
    padding: var(--space-md) var(--space-sm); /* Match .bar padding on small mobile */
    margin: var(--space-md) var(--space-sm) var(--space-lg); /* Match horizontal margin */
  }
  .upload-progress-container {
    padding: 0 var(--space-sm); /* Match .bar padding on small mobile */
  }

  .search {
    padding: 8px var(--space-sm);
  }

  #filterControls {
    gap: 4px;
  }

  .filter-dropdown-btn {
    padding: 4px var(--space-xs);
    font-size: 11px;
  }

  .filter-dropdown-btn .material-icons {
    font-size: 16px;
  }

  /* Count text */
  .mut {
    font-size: 12px;
  }

  /* Short URL */
  .short-url {
    font-size: 11px;
  }

  /* Bar actions */
  .bar .row {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

/* ===== FILE PREVIEW MODAL ===== */
.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.preview-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.preview-content {
  position: relative;
  width: 90vw;
  max-width: 1400px;
  height: 90vh;
  max-height: 900px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--stroke);
  animation: slideUp 0.3s ease-out;
}

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

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--stroke);
  flex-shrink: 0;
}

.preview-filename {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 60px);
}

.preview-close {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--ink-muted);
  transition: all var(--transition-fast);
}

.preview-close:hover {
  background: var(--bg-panel-hover);
  color: var(--ink);
}

.preview-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  position: relative;
}

.preview-loading,
.preview-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  color: var(--ink-muted);
}

.preview-loading .material-icons,
.preview-error .material-icons {
  font-size: 48px;
  color: var(--ink-muted);
}

.preview-spinner {
  animation: spin 1s linear infinite;
}

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

.preview-error .material-icons {
  color: var(--danger);
}

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

.preview-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.preview-viewer iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-md);
  background: white;
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-top: 1px solid var(--stroke);
  flex-shrink: 0;
  gap: var(--space-4);
}

.preview-info {
  flex: 1;
  text-align: center;
  font-size: 14px;
  color: var(--ink-muted);
}

.preview-nav {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--ink-muted);
  transition: all var(--transition-fast);
  border: 1px solid var(--stroke);
  background: var(--bg-panel);
}

.preview-nav:hover:not(:disabled) {
  background: var(--bg-panel-hover);
  border-color: var(--stroke-strong);
  color: var(--ink);
}

.preview-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.preview-nav .material-icons {
  font-size: 24px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .preview-content {
    width: 95vw;
    height: 95vh;
  }

  .preview-header {
    padding: var(--space-3);
  }

  .preview-body {
    padding: var(--space-2);
  }

  .preview-footer {
    padding: var(--space-3);
  }

  .preview-filename {
    font-size: 16px;
  }
}

/* Plan Banner */
.plan-banner {
  margin-top: var(--space-xl);
  margin-bottom: 0;
  margin-left: var(--space-lg);
  margin-right: var(--space-lg);
  padding: var(--space-lg);
  background: linear-gradient(135deg, rgba(78, 161, 255, 0.1) 0%, rgba(78, 161, 255, 0.05) 100%);
  border: 1px solid rgba(78, 161, 255, 0.2);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  width: calc(100% - var(--space-lg) * 2);
  box-sizing: border-box;
  display: block !important;
  grid-column: unset !important;
  grid-row: unset !important;
}

.plan-banner:hover {
  border-color: rgba(78, 161, 255, 0.3);
  background: linear-gradient(135deg, rgba(78, 161, 255, 0.15) 0%, rgba(78, 161, 255, 0.08) 100%);
}

.plan-banner-content {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.plan-banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(78, 161, 255, 0.15);
  border-radius: var(--radius-md);
  color: #4ea1ff;
  flex-shrink: 0;
}

.plan-banner-icon .material-icons {
  font-size: 24px;
}

.plan-banner-info {
  flex: 1;
  min-width: 200px;
}

.plan-banner-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.plan-banner-label {
  font-size: 0.875rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.plan-banner-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
}

.plan-banner-expiry {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  margin-top: var(--space-xs);
}

.plan-banner-action {
  flex-shrink: 0;
}

.plan-banner-action .btn {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .plan-banner {
    margin-left: var(--space-md);
    margin-right: var(--space-md);
    width: calc(100% - var(--space-md) * 2);
  }

  .plan-banner-content {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .plan-banner-info {
    text-align: center;
  }

  .plan-banner-title {
    justify-content: center;
    flex-wrap: wrap;
  }

  .plan-banner-action {
    width: 100%;
  }

  .plan-banner-action .btn {
    width: 100%;
  }
}

/* ===== TAGS FEATURE ===== */

/* Tag chip display on file cards */
.file-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
  min-height: 20px; /* Reserve space even when empty */
}

/* Tag display in table view - completely hidden */
.table-tags-placeholder {
  display: none;
}

/* Tag icon button in file name column - horizontal layout */
.file-tag-icon-btn {
  all: unset;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--ink-muted);
  margin-left: var(--space-1);
  flex-shrink: 0;
}

.file-tag-icon-btn:hover {
  background: var(--bg-panel-hover);
  color: var(--acc);
}

.file-tag-icon-btn .material-icons {
  font-size: 18px;
  line-height: 1;
}

/* Tag count badge - appears above icon */
.tag-badge {
  background: #4ea1ff;
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  min-width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.file-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  background: var(--acc-light);
  color: var(--acc);
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-tag-chip:hover {
  background: rgba(78, 161, 255, 0.15);
  transform: translateY(-1px);
}

.file-tag-chip.tag-colored {
  /* When tag has custom color */
  background: var(--tag-color);
  color: white;
}

.file-tag-chip .tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  font-size: 10px;
  opacity: 0.7;
  transition: opacity 150ms ease;
}

.file-tag-chip .tag-remove:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.2);
}

/* Remove button for editable tag chips */
.file-tag-chip-editable {
  position: relative;
  padding-right: var(--space-3);
}

.file-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  color: inherit;
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms ease, background 150ms ease;
  flex-shrink: 0;
}

.file-tag-chip-editable:hover .file-tag-remove {
  opacity: 1;
}

.file-tag-remove:hover {
  background: rgba(0, 0, 0, 0.2);
}

.file-tag-chip-editable.tag-colored .file-tag-remove {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.file-tag-chip-editable.tag-colored .file-tag-remove:hover {
  background: rgba(255, 255, 255, 0.3);
}

.file-tags-more {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
}

.file-tags-more:hover {
  color: var(--acc);
  background: var(--acc-light);
  transform: translateY(-1px);
}

.file-add-tag-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px var(--space-2);
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  background: transparent;
  cursor: pointer;
  transition: all 150ms ease;
  line-height: 16px;
}

.file-add-tag-btn:hover {
  color: var(--acc);
  border-color: var(--acc);
  background: var(--acc-light);
}

.file-add-tag-btn .material-icons {
  font-size: 14px;
}

/* Tag input in rename/edit mode */
.tag-input-container {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--stroke);
}

.tag-input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: var(--space-2);
}

.tag-input-wrapper {
  position: relative;
}

.tag-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  transition: all 150ms ease;
}

.tag-input:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-light);
}

.tag-input::placeholder {
  color: var(--ink-subtle);
}

/* Tag autocomplete dropdown */
.tag-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: var(--space-1);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.tag-autocomplete.visible {
  display: block;
}

.tag-autocomplete-item {
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  transition: background 150ms ease;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tag-autocomplete-item:hover,
.tag-autocomplete-item.selected {
  background: var(--bg-panel-hover);
}

.tag-autocomplete-item .tag-name {
  flex: 1;
  font-size: 14px;
  color: var(--ink);
}

.tag-autocomplete-item .tag-count {
  font-size: 12px;
  color: var(--ink-muted);
}

.tag-autocomplete-empty {
  padding: var(--space-3);
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
}

/* Current tags display in edit mode */
.tag-current-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
  min-height: 24px;
}

.tag-current-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-2);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--acc-light);
  color: var(--acc);
}

.tag-current-chip .tag-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  color: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: all 150ms ease;
  padding: 0;
}

.tag-current-chip .tag-remove-btn:hover {
  background: rgba(0, 0, 0, 0.2);
  transform: scale(1.1);
}

/* Tag filter in sidebar */
.filter-tags {
  margin-top: var(--space-3);
}

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

.filter-tags-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-tags-clear {
  font-size: 12px;
  color: var(--acc);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: opacity 150ms ease;
}

.filter-tags-clear:hover {
  opacity: 0.8;
}

.filter-tags-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.filter-tag-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 150ms ease;
  user-select: none;
}

.filter-tag-item:hover {
  background: var(--bg-panel-hover);
}

.filter-tag-item.selected {
  background: var(--acc-light);
}

.filter-tag-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid var(--stroke-strong);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 150ms ease;
}

.filter-tag-item.selected .filter-tag-checkbox {
  background: var(--acc);
  border-color: var(--acc);
}

.filter-tag-checkbox::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 150ms ease;
}

.filter-tag-item.selected .filter-tag-checkbox::after {
  opacity: 1;
}

.filter-tag-name {
  flex: 1;
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-tag-count {
  font-size: 12px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

/* Tag management modal */
.tag-management-modal {
  max-width: 600px;
}

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

.tag-management-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.tag-management-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  max-height: 400px;
  overflow-y: auto;
}

.tag-management-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  transition: all 150ms ease;
}

.tag-management-item:hover {
  background: var(--bg-panel-hover);
  border-color: var(--stroke-strong);
}

.tag-management-color {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--stroke);
  cursor: pointer;
  transition: transform 150ms ease;
  flex-shrink: 0;
}

.tag-management-color:hover {
  transform: scale(1.1);
}

.tag-management-info {
  flex: 1;
  min-width: 0;
}

.tag-management-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-management-count {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.tag-management-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.tag-management-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 150ms ease;
}

.tag-management-btn:hover {
  background: var(--bg-panel-hover);
  border-color: var(--stroke-strong);
  color: var(--ink);
}

.tag-management-btn.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.tag-management-empty {
  text-align: center;
  padding: var(--space-8);
  color: var(--ink-muted);
}

.tag-management-empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-3);
  opacity: 0.5;
}

.tag-management-empty-text {
  font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .file-tag-chip {
    font-size: 10px;
    padding: 2px 6px;
    max-width: 100px;
  }

  .tag-management-item {
    flex-wrap: wrap;
  }

  .tag-management-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ===== LOADING SKELETONS ===== */
/* Skeleton animation */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-panel) 0%,
    var(--bg-panel-hover) 50%,
    var(--bg-panel) 100%
  );
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* Skeleton for file list items */
.skeleton-file-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}

.skeleton-file-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}

.skeleton-file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.skeleton-file-name {
  height: 16px;
  width: 60%;
}

.skeleton-file-meta {
  height: 12px;
  width: 40%;
}

.skeleton-file-actions {
  display: flex;
  gap: var(--space-sm);
}

.skeleton-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

/* Skeleton for stats cards */
.skeleton-stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.skeleton-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
}

.skeleton-stat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.skeleton-stat-label {
  height: 14px;
  width: 60%;
}

.skeleton-stat-value {
  height: 24px;
  width: 40%;
}

/* Grid skeleton for file grid view */
.skeleton-file-grid-item {
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.skeleton-file-preview {
  width: 100%;
  height: 150px;
  border-radius: var(--radius-sm);
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: var(--bg-panel-hover);
  }
}
