/* ============================================================
   CodeAj Drive — Main Stylesheet
   Google Drive-inspired, built with CSS custom properties
   ============================================================ */

/* ── Variables ──────────────────────────────────────────── */
:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --surface: #fff;
  --surface-2: #f8f9fa;
  --surface-hover: #f1f3f4;
  --border: #dadce0;
  --text: #202124;
  --text-2: #5f6368;
  --text-3: #80868b;
  --danger: #d93025;
  --danger-light: #fce8e6;
  --success: #1e8e3e;
  --success-light: #e6f4ea;
  --warning: #f29900;
  --warning-light: #fef3e2;
  --shadow-sm: 0 1px 2px rgba(60,64,67,.3),0 1px 3px 1px rgba(60,64,67,.15);
  --shadow-md: 0 1px 3px rgba(60,64,67,.3),0 4px 8px 3px rgba(60,64,67,.15);
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 16px;
  --sidebar-width: 256px;
  --header-height: 64px;
  --transition: .15s ease;
}

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

body {
  font-family: 'Google Sans', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #bdc1c6; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #80868b; }

/* ── Layout ─────────────────────────────────────────────── */
#app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  padding: 8px 0;
  flex-shrink: 0;
  overflow-y: auto;
  transition: width var(--transition);
  z-index: 100;
}
#sidebar.collapsed { width: 72px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 20px;
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-logo .logo-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--primary);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
}
.sidebar-logo span { transition: opacity var(--transition); }
#sidebar.collapsed .sidebar-logo span { opacity: 0; pointer-events: none; }

.btn-new {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 16px 12px;
  padding: 18px 24px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: box-shadow var(--transition);
  white-space: nowrap;
  overflow: hidden;
}
.btn-new:hover { box-shadow: var(--shadow-md); }
.btn-new .material-icons-round { font-size: 22px; flex-shrink: 0; }

#sidebar.collapsed .btn-new { padding: 18px; justify-content: center; margin: 0 8px 12px; }
#sidebar.collapsed .btn-new .btn-new-label { display: none; }

.sidebar-nav { flex: 1; padding: 0 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  border-radius: var(--radius-lg);
  user-select: none;
}
.nav-item:hover { background: var(--surface-hover); }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); }
.nav-item .material-icons-round { font-size: 20px; flex-shrink: 0; }
#sidebar.collapsed .nav-item { padding: 10px; justify-content: center; }
#sidebar.collapsed .nav-item .nav-label { display: none; }

.sidebar-storage {
  padding: 16px;
  margin-top: auto;
}
.storage-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.storage-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width .5s ease;
}
.storage-bar-fill.warn { background: var(--warning); }
.storage-bar-fill.danger { background: var(--danger); }
.storage-text {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
}
#sidebar.collapsed .sidebar-storage { display: none; }

/* ── Main content area ──────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Header ─────────────────────────────────────────────── */
#header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 16px;
  background: var(--surface-2);
  flex-shrink: 0;
}

.header-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-2);
  transition: background var(--transition);
  flex-shrink: 0;
}
.header-toggle:hover { background: var(--surface-hover); }

.search-bar {
  flex: 1;
  max-width: 720px;
  position: relative;
}
.search-bar input {
  width: 100%;
  padding: 10px 16px 10px 48px;
  background: var(--surface-hover);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.search-bar input:focus {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.search-bar .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
  pointer-events: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-2);
  transition: background var(--transition);
  position: relative;
}
.icon-btn:hover { background: var(--surface-hover); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Content area ───────────────────────────────────────── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.content-inner {
  padding: 0 16px 80px;
}

/* ── Breadcrumb ─────────────────────────────────────────── */
#breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 24px 4px;
  font-size: 20px;
  color: var(--text);
  flex-wrap: wrap;
}
.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.breadcrumb-item:hover { background: var(--surface-hover); }
.breadcrumb-item:last-child { font-weight: 500; cursor: default; }
.breadcrumb-item:last-child:hover { background: none; }
.breadcrumb-sep { color: var(--text-3); font-size: 20px; }

/* ── Toolbar ────────────────────────────────────────────── */
#toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px 12px;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: background var(--transition), border-color var(--transition);
}
.toolbar-btn:hover { background: var(--surface-hover); border-color: #c6c9ca; }
.toolbar-btn.primary { background: var(--primary-light); border-color: transparent; color: var(--primary-dark); }
.toolbar-btn.primary:hover { background: #d2e3fc; }
.toolbar-btn .material-icons-round { font-size: 18px; }

.toolbar-sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

.view-toggle {
  display: flex;
  margin-left: auto;
}
.view-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  transition: background var(--transition), color var(--transition);
}
.view-btn:hover { background: var(--surface-hover); }
.view-btn.active { color: var(--primary); }

/* ── File Grid ──────────────────────────────────────────── */
#file-grid {
  padding: 0 16px;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 8px 8px 8px 8px;
  margin-bottom: 4px;
}

/* Grid layout */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-bottom: 24px;
}

.item-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  cursor: pointer;
  transition: box-shadow var(--transition), border-color var(--transition), background var(--transition);
  user-select: none;
  position: relative;
}
.item-card:hover { border-color: #c6c9ca; box-shadow: var(--shadow-sm); }
.item-card.selected { background: var(--primary-light); border-color: var(--primary); }

.item-card-thumb {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  overflow: hidden;
}
.item-card-thumb .material-icons-round {
  font-size: 56px;
  color: var(--text-3);
}
.item-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-card-thumb.folder-thumb { background: none; }
.item-card-thumb.folder-thumb .material-icons-round { font-size: 64px; color: #f6b94d; }

.item-card-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}
.item-card-meta {
  font-size: 12px;
  color: var(--text-2);
}

.item-card-menu {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-2);
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
}
.item-card:hover .item-card-menu,
.item-card.selected .item-card-menu { opacity: 1; }
.item-card-menu:hover { background: rgba(0,0,0,.08); }

/* List layout */
.items-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 24px;
}
.list-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.list-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--surface-hover); }
.list-row.selected { background: var(--primary-light); }

.list-row-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
}
.list-row-name .material-icons-round { font-size: 20px; color: var(--text-3); flex-shrink: 0; }
.list-row-name .material-icons-round.folder { color: #f6b94d; }
.list-row-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-date, .list-row-size {
  font-size: 13px;
  color: var(--text-2);
}
.list-row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.list-row:hover .list-row-actions { opacity: 1; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--text-2);
  text-align: center;
}
.empty-state .material-icons-round {
  font-size: 80px;
  color: var(--border);
  margin-bottom: 16px;
}
.empty-state h3 { font-size: 18px; font-weight: 400; margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 300px; }

/* ── Modals ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 480px;
  padding: 24px;
  transform: scale(.96) translateY(-8px);
  transition: transform var(--transition);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal.wide { max-width: 640px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-2);
  font-size: 18px;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--surface-hover); }

.modal-body { margin-bottom: 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Form elements ───────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}
.form-input.error { border-color: var(--danger); }
.form-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}
.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}
.toggle-row label { font-size: 14px; color: var(--text); }

/* Toggle switch */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #bdc1c6;
  border-radius: 22px;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: .6; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-sm); }
.btn-secondary { background: transparent; color: var(--primary); }
.btn-secondary:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b7271e; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn .material-icons-round { font-size: 18px; }

/* ── Context menu ────────────────────────────────────────── */
#ctx-menu {
  position: fixed;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  padding: 6px 0;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transform: scale(.95);
  transform-origin: top left;
  transition: opacity .1s ease, transform .1s ease;
}
#ctx-menu.active { opacity: 1; pointer-events: all; transform: scale(1); }
.ctx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}
.ctx-item:hover { background: var(--surface-hover); }
.ctx-item .material-icons-round { font-size: 18px; color: var(--text-2); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger .material-icons-round { color: var(--danger); }
.ctx-sep { height: 1px; background: var(--border); margin: 6px 0; }

/* ── Upload panel ────────────────────────────────────────── */
#upload-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 340px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  z-index: 900;
  display: none;
}
#upload-panel.active { display: block; }
.upload-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.upload-panel-body { max-height: 320px; overflow-y: auto; }
.upload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.upload-item:last-child { border-bottom: none; }
.upload-item-icon .material-icons-round { font-size: 20px; color: var(--text-3); }
.upload-item-info { flex: 1; min-width: 0; }
.upload-item-name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width .3s ease;
}
.upload-status {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}
.upload-status.success { color: var(--success); }
.upload-status.error { color: var(--danger); }

/* ── Drop zone overlay ───────────────────────────────────── */
#drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,115,232,.08);
  border: 3px dashed var(--primary);
  border-radius: var(--radius-lg);
  z-index: 800;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}
#drop-overlay.active { display: flex; }
#drop-overlay .material-icons-round { font-size: 64px; color: var(--primary); }
#drop-overlay p { font-size: 22px; font-weight: 500; color: var(--primary); }

/* ── Toast notifications ─────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  background: #323232;
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: all;
  animation: toast-in .2s ease;
  white-space: nowrap;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--text); }
@keyframes toast-in { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f0fe 0%, #f8f9fa 60%);
  padding: 24px;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.auth-logo .logo-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
}
.auth-logo .logo-text {
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
}
.auth-title {
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 8px;
}
.auth-sub {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 28px;
}
.auth-card .form-input { height: 44px; }
.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
}
.auth-footer a { color: var(--primary); font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }
.auth-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #f5c6c3;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.auth-error.active { display: block; }

/* ── Public share page ───────────────────────────────────── */
.share-page {
  min-height: 100vh;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.share-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
  width: 100%;
  max-width: 480px;
  text-align: center;
}
.share-file-icon .material-icons-round { font-size: 80px; color: var(--text-3); }
.share-file-icon.image .material-icons-round { color: #34a853; }
.share-file-icon.video .material-icons-round { color: #ea4335; }
.share-file-icon.audio .material-icons-round { color: var(--primary); }
.share-file-icon.pdf .material-icons-round { color: #ea4335; }
.share-file-name { font-size: 20px; font-weight: 500; margin: 16px 0 6px; word-break: break-word; }
.share-file-meta { font-size: 14px; color: var(--text-2); margin-bottom: 24px; }
.share-branding { margin-top: 24px; font-size: 12px; color: var(--text-3); }
.share-branding a { color: var(--primary); }
.share-expired {
  padding: 20px;
  background: var(--danger-light);
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── User dropdown ───────────────────────────────────────── */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  padding: 8px 0;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--transition), transform var(--transition);
}
.dropdown.active { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-user {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.dropdown-user .name { font-size: 14px; font-weight: 500; }
.dropdown-user .email { font-size: 12px; color: var(--text-2); }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--surface-hover); }
.dropdown-item .material-icons-round { font-size: 18px; color: var(--text-2); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger .material-icons-round { color: var(--danger); }

/* ── Loading spinner ─────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.spinner-lg { width: 48px; height: 48px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
}

/* ── Share links list (in modal) ─────────────────────────── */
.share-link-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
}
.share-link-item:last-child { margin-bottom: 0; }
.share-link-url {
  font-size: 13px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  word-break: break-all;
  margin: 6px 0;
}
.share-link-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-2);
}
.share-link-badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--text-2);
}
.share-link-badge.active { background: var(--success-light); border-color: var(--success); color: var(--success); }
.share-link-badge.expired { background: var(--danger-light); border-color: var(--danger); color: var(--danger); }

/* ── Drag-select ─────────────────────────────────────────── */
.drag-select-box {
  position: fixed;
  background: rgba(26,115,232,.1);
  border: 1px solid var(--primary);
  border-radius: 2px;
  pointer-events: none;
  z-index: 700;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    height: 100%;
    z-index: 200;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    transition: left var(--transition);
  }
  #sidebar.mobile-open { left: 0; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .list-header, .list-row { grid-template-columns: 2fr auto; }
  .list-row-date, .list-row-size, .list-header .col-date, .list-header .col-size { display: none; }
  #upload-panel { width: calc(100vw - 32px); right: 16px; }
  .auth-card { padding: 28px 20px; }
  .share-card { padding: 28px 20px; }
}
