/* === Artivo Transfer — Styles === */

:root {
  --primary: #A020F0;
  --primary-light: #B44DF5;
  --primary-glow: rgba(160, 32, 240, 0.3);
  --bg: #0A0A10;
  --card: #111118;
  --border: #1C1C28;
  --muted: #6E6E82;
  --text: #E4E4ED;
  --white: #FFFFFF;
  --danger: #E53E3E;
  --danger-hover: #C53030;
  --success: #38A169;
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* === Logo === */

.logo-link {
  text-decoration: none;
  cursor: pointer;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary-glow);
}

.logo-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: 8px;
}

.header-title {
  font-size: 1.1rem;
  color: var(--muted);
  margin-left: 8px;
  font-weight: 500;
}

/* === Buttons === */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  box-shadow: 0 4px 24px var(--primary-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 32px rgba(160, 32, 240, 0.5);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--card);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-large { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-icon {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}

.btn-icon:hover { background: var(--card); color: var(--text); }

/* === Forms === */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group input::placeholder { color: var(--muted); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* === Alert === */

.alert {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(229, 62, 62, 0.1);
  border: 1px solid rgba(229, 62, 62, 0.3);
  color: #FC8181;
}

/* === Login Page === */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-text {
  font-size: 2rem;
}

.login-logo .logo-subtitle {
  display: block;
  margin-left: 0;
  margin-top: 4px;
}

.login-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 24px;
}

/* === App Layout === */

.app-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
}

/* === Stats === */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(160, 32, 240, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.stat-info { display: flex; flex-direction: column; min-width: 0; }
.stat-value { font-size: 1.3rem; font-weight: 700; color: var(--white); }
.stat-label { font-size: 0.82rem; color: var(--muted); }

/* Disk progress bar in stat cards */
.disk-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.disk-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.disk-progress-fill.warning {
  background: #e6a817;
}
.disk-progress-fill.critical {
  background: #e63946;
}

/* === Disk Selector === */
.disk-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.disk-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.disk-tab:hover {
  color: var(--white);
  border-color: var(--primary);
}
.disk-tab.active {
  background: rgba(160, 32, 240, 0.12);
  border-color: var(--primary);
  color: var(--primary-light);
}

/* Disk tab drag-over state */
.disk-tab.drag-over {
  background: rgba(160, 32, 240, 0.2) !important;
  border-color: var(--primary) !important;
  color: var(--primary-light) !important;
  box-shadow: 0 0 12px var(--primary-glow);
}

/* === Tabs === */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover { color: var(--text); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* === Toolbar === */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

/* === Breadcrumb === */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.breadcrumb-item {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.breadcrumb-item:hover { background: var(--card); color: var(--text); }
.breadcrumb-item.active { color: var(--text); font-weight: 600; }

.breadcrumb-sep {
  color: var(--muted);
  font-size: 0.8rem;
}

/* === Drop Zone === */

.drop-zone {
  display: none;
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  background: rgba(160, 32, 240, 0.05);
  margin-bottom: 16px;
}

.drop-zone.active { display: block; }

.drop-zone-content {
  color: var(--primary);
}

.drop-zone-content p {
  margin-top: 12px;
  color: var(--muted);
}

/* === Upload Progress (per-file rows) === */

.upload-container {
  display: block;
  position: relative;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: visible;
}

.upload-container-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.upload-container-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--white);
}

.btn-cancel-upload {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.82rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-cancel-upload:hover {
  background: rgba(229, 62, 62, 0.1);
  color: var(--danger);
}

.upload-items {
  display: flex;
  flex-direction: column;
  max-height: 360px;
  overflow-y: auto;
  width: 100%;
}

/* Individual file upload row */
.upload-item {
  display: block;
  position: relative;
  width: 100%;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
  flex-shrink: 0;
  overflow: hidden;
}

.upload-item:last-child { border-bottom: none; }

.upload-item-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  width: 100%;
}

.upload-item-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 0%;
}

.upload-item-status {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  flex: 0 0 auto;
}

.upload-item-detail {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  width: 100%;
}

/* Progress bar (shared) */
.progress-bar {
  display: block;
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.progress-fill {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  transition: width 0.3s;
  width: 0%;
}

/* Upload item states */
.upload-item.upload-waiting .upload-item-status { color: var(--muted); }
.upload-item.upload-waiting .progress-fill { width: 0%; }

.upload-item.upload-active { background: rgba(160, 32, 240, 0.03); }
.upload-item.upload-active .upload-item-status { color: var(--primary-light); }
.upload-item.upload-active .upload-item-name { color: var(--white); }

.upload-item.upload-assembling { background: rgba(160, 32, 240, 0.03); }
.upload-item.upload-assembling .upload-item-status { color: #F59E0B; }
.upload-item.upload-assembling .progress-fill {
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
  animation: pulse-bar 1s ease-in-out infinite;
}

.upload-item.upload-done .upload-item-status { color: var(--success); }
.upload-item.upload-done .progress-fill { background: var(--success); }
.upload-item.upload-done .upload-item-name { color: var(--muted); }

.upload-item.upload-error .upload-item-status { color: var(--danger); }
.upload-item.upload-error .progress-fill { background: var(--danger); }

@keyframes pulse-bar {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Download progress (for share page) */
.download-progress {
  margin-bottom: 16px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.preview-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
}

.preview-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* === File List === */

.file-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.file-item {
  display: grid;
  grid-template-columns: 40px 1fr 100px 140px 120px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  gap: 12px;
}

.file-item:last-child { border-bottom: none; }
.file-item:hover { background: rgba(160, 32, 240, 0.03); }

.file-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-icon.folder { background: rgba(160, 32, 240, 0.1); color: var(--primary); }
.file-icon.video { background: rgba(239, 68, 68, 0.1); color: #EF4444; }
.file-icon.image { background: rgba(16, 185, 129, 0.1); color: #10B981; }
.file-icon.audio { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.file-icon.archive { background: rgba(99, 102, 241, 0.1); color: #6366F1; }
.file-icon.document { background: rgba(59, 130, 246, 0.1); color: #3B82F6; }
.file-icon.generic { background: rgba(107, 114, 128, 0.1); color: #6B7280; }

.file-name {
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  min-width: 0;
}

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

.fname-start {
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.fname-end {
  flex-shrink: 0;
  white-space: nowrap;
}

.file-size {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

.file-date {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

.file-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.file-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}

.loading {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

/* === Links List === */

.links-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.link-item {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.link-item:last-child { border-bottom: none; }
.link-item:hover { background: rgba(160, 32, 240, 0.02); }

.link-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.link-type-icon {
  flex-shrink: 0;
  display: inline-flex;
  color: var(--muted);
}

.link-filename {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 1;
}

.link-details-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-size: 0.82rem;
  line-height: 1.6;
}

.link-detail {
  color: var(--muted);
  white-space: nowrap;
}

.link-detail-sep {
  color: var(--border);
  margin: 0 8px;
  font-size: 0.65rem;
  user-select: none;
}

.link-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.btn-xs {
  font-size: 0.8rem;
  padding: 5px 12px;
  gap: 5px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  line-height: 1;
}

.link-delete-btn {
  color: var(--danger) !important;
  border-color: rgba(229, 62, 62, 0.2) !important;
}
.link-delete-btn:hover {
  background: rgba(229, 62, 62, 0.1) !important;
  border-color: rgba(229, 62, 62, 0.3) !important;
}

/* Status badges */
.link-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
}

.status-aktívny { background: rgba(56, 161, 105, 0.15); color: #48BB78; }
.status-vypršaný, .status-vyčerpaný { background: rgba(229, 62, 62, 0.12); color: #FC8181; }
.status-deaktivovaný { background: rgba(107, 114, 128, 0.12); color: #9CA3AF; }

.links-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}

/* === Activity Log === */

.activity-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.activity-item {
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  gap: 6px;
}

.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: rgba(160, 32, 240, 0.02); }

.activity-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.activity-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
}

.activity-success { background: rgba(56, 161, 105, 0.15); color: #48BB78; }
.activity-fail { background: rgba(229, 62, 62, 0.12); color: #FC8181; }

.activity-date {
  font-size: 0.85rem;
  color: var(--muted);
}

.activity-details-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-size: 0.82rem;
  line-height: 1.6;
}

.activity-detail {
  color: var(--muted);
  white-space: nowrap;
}

.activity-detail strong {
  color: var(--text);
  font-weight: 500;
}

.activity-detail-sep {
  color: var(--border);
  margin: 0 8px;
  font-size: 0.65rem;
  user-select: none;
}

.activity-ua {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.activity-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}

/* === Modal === */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-large {
  max-width: 800px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.text-muted { color: var(--muted); font-size: 0.9rem; }

/* === Share Modal === */

.share-filename {
  font-weight: 600;
  color: var(--white);
  margin-bottom: 20px;
  word-break: break-all;
}

.share-result {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.share-result label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.share-link-row {
  display: flex;
  gap: 8px;
}

.share-link-row input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
}

/* === Share/Client Page === */

.share-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.share-container {
  width: 100%;
  max-width: 560px;
  text-align: center;
}

.share-branding {
  margin-bottom: 32px;
}

.share-branding .logo-text {
  font-size: 2rem;
}

.share-branding .logo-subtitle {
  display: block;
  margin-left: 0;
  margin-top: 4px;
}

.share-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

.share-error svg { margin-bottom: 16px; }
.share-error h2 { font-size: 1.3rem; color: var(--white); margin-bottom: 8px; }
.share-error p { color: var(--muted); }

/* Preview areas */
.share-preview {
  margin-bottom: 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}

.share-video video {
  width: 100%;
  max-height: 360px;
  display: block;
}

.share-image img {
  max-width: 100%;
  max-height: 400px;
  display: block;
  margin: 0 auto;
}

.share-audio {
  padding: 32px 20px;
}

.share-audio .audio-icon { margin-bottom: 16px; }
.share-audio audio { width: 100%; }

.share-generic {
  padding: 40px;
}

.share-info {
  margin-bottom: 24px;
}

.share-info .share-filename {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
  word-break: break-all;
}

.share-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.meta-sep { margin: 0 6px; }

.share-downloads-left {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 8px;
}

.download-btn {
  margin-bottom: 16px;
}

.share-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.8rem;
}

.share-footer {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.8rem;
}

/* === Folder Share === */

.share-container-folder {
  max-width: 640px;
}

.share-card-folder {
  text-align: left;
}

.share-folder-header {
  text-align: center;
  margin-bottom: 24px;
}

.share-folder-header svg {
  margin-bottom: 12px;
}

.share-folder-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
  word-break: break-all;
}

.share-folder-empty {
  text-align: center;
  color: var(--muted);
  padding: 32px;
}

.share-folder-files {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 24px;
  max-height: 400px;
  overflow-y: auto;
}

.share-file-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.share-file-item:last-child { border-bottom: none; }
.share-file-item:hover { background: rgba(160, 32, 240, 0.03); }

.share-file-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.share-file-icon.video { background: rgba(239, 68, 68, 0.1); color: #EF4444; }
.share-file-icon.image { background: rgba(16, 185, 129, 0.1); color: #10B981; }
.share-file-icon.audio { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.share-file-icon.archive { background: rgba(99, 102, 241, 0.1); color: #6366F1; }
.share-file-icon.document { background: rgba(59, 130, 246, 0.1); color: #3B82F6; }
.share-file-icon.generic { background: rgba(107, 114, 128, 0.1); color: #6B7280; }

.share-file-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.share-file-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-file-size {
  font-size: 0.78rem;
  color: var(--muted);
}

.share-file-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Video fallback (unsupported format) */
.video-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

.video-fallback p {
  margin: 0;
  font-size: 0.95rem;
}

.video-fallback .video-fallback-hint {
  font-size: 0.82rem;
  opacity: 0.7;
}

.video-fallback .btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Preview modal overlay */
.share-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.share-preview-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.share-preview-content {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-preview-content img,
.share-preview-content video {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.share-preview-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.share-preview-close:hover {
  background: var(--border);
}

/* === Context Menu === */

.context-menu {
  display: none;
  position: fixed;
  z-index: 2000;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  padding: 6px 0;
  overflow: hidden;
}

.context-menu.active { display: block; }

.context-menu-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.context-menu-item:hover {
  background: rgba(160, 32, 240, 0.08);
  color: var(--white);
}

.context-menu-item.danger { color: var(--danger); }
.context-menu-item.danger:hover {
  background: rgba(229, 62, 62, 0.1);
  color: var(--danger);
}

.context-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* === Drag & Drop States === */

.file-item.dragging {
  opacity: 0.4;
}

.file-item.drag-over {
  background: rgba(160, 32, 240, 0.1) !important;
  box-shadow: inset 0 0 0 2px var(--primary);
  border-radius: 4px;
}

.file-item {
  cursor: default;
}

.file-item .file-name,
.file-item .file-icon {
  cursor: pointer;
}

.file-item.is-folder .file-name,
.file-item.is-folder .file-icon {
  cursor: pointer;
}

.btn-more {
  opacity: 0;
  transition: opacity 0.15s;
}

.file-item:hover .btn-more {
  opacity: 1;
}

/* === Locked Folders === */

.file-icon.folder-locked {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
}

.file-item.is-locked .file-name {
  color: var(--muted);
}

.file-item.is-locked .file-name:hover {
  color: #F59E0B;
}

.file-item.is-locked {
  cursor: default;
}

/* Lock modal folder name display */
.lock-folder-name {
  font-weight: 600;
  color: var(--white);
  margin-bottom: 16px;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lock-folder-name svg {
  flex-shrink: 0;
  color: #F59E0B;
}

/* Form error messages inside lock modals */
.form-error {
  background: rgba(229, 62, 62, 0.1);
  border: 1px solid rgba(229, 62, 62, 0.3);
  color: #FC8181;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: none;
}

.form-error.active {
  display: block;
}

/* Lock modal warning text */
.lock-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* === Pinned Folders === */

.pin-badge {
  display: inline-flex;
  align-items: center;
  color: var(--primary-light);
  margin-right: 6px;
  flex-shrink: 0;
}

.file-item.is-pinned .file-icon.folder {
  background: rgba(160, 32, 240, 0.15);
}

/* === Preview Navigation === */

.preview-nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(17, 17, 24, 0.85);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.preview-nav:hover {
  background: rgba(160, 32, 240, 0.2);
  border-color: var(--primary);
  color: var(--white);
}

.preview-nav-prev {
  left: 16px;
}

.preview-nav-next {
  right: 16px;
}

.preview-counter {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  margin-right: auto;
  margin-left: 12px;
}

.share-preview-modal .preview-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  z-index: 10;
}

/* === Responsive === */

@media (max-width: 768px) {
  .file-item {
    grid-template-columns: 36px 1fr 40px;
    gap: 8px;
    padding: 10px 12px;
  }

  .file-date, .file-size { display: none; }
  .file-actions .btn-more { opacity: 1; }

  /* Links — mobile layout */
  .link-item {
    padding: 14px 14px;
    gap: 8px;
  }

  .link-info-row {
    gap: 8px;
  }

  .link-filename {
    font-size: 0.9rem;
  }

  /* Stack details vertically on mobile */
  .link-details-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 0.78rem;
  }

  .link-detail-sep {
    display: none;
  }

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

  .btn-xs {
    font-size: 0.76rem;
    padding: 5px 10px;
  }

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

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-actions { justify-content: flex-end; }

  .form-row { grid-template-columns: 1fr; }

  .share-card { padding: 24px 16px; }
  .modal-content { width: 95%; }

  /* Folder share — mobile */
  .share-card-folder { padding: 20px 14px; }
  .share-folder-files { max-height: 300px; }
  .share-file-item { gap: 8px; padding: 8px 10px; }
  .share-file-name { font-size: 0.82rem; }

  .preview-nav {
    width: 36px;
    height: 36px;
  }
  .preview-nav-prev { left: 4px; }
  .preview-nav-next { right: 4px; }
  .preview-nav svg { width: 20px; height: 20px; }
}

@media (max-width: 480px) {
  .app-layout { padding: 0 12px 20px; }

  .stat-card { padding: 14px; }
  .stat-value { font-size: 1.1rem; }

  .link-item {
    padding: 12px 12px;
    gap: 6px;
  }

  .link-filename {
    font-size: 0.85rem;
  }

  .link-status {
    font-size: 0.68rem;
    padding: 2px 8px;
  }

  .link-details-row {
    font-size: 0.75rem;
  }

  .btn-xs {
    font-size: 0.74rem;
    padding: 4px 8px;
    gap: 3px;
  }
}
