/* =========================================================
   Windows 11 Fluent OS Explorer Design System
   StashBox - upload.th-pp.win
   100% Thai Language Support - Asia/Bangkok
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
  --font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
  
  /* Windows 11 Fluent Palette */
  --win-bg: #1c1f24;
  --win-surface: #20242b;
  --win-surface-alt: #282d37;
  --win-card: #2c323d;
  --win-card-hover: #363d4a;
  --win-border: rgba(255, 255, 255, 0.08);
  --win-border-light: rgba(255, 255, 255, 0.14);
  
  /* Text */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  /* Accent & Status */
  --accent: #0078d4;
  --accent-hover: #1084d8;
  --accent-light: rgba(0, 120, 212, 0.15);
  --success: #107c41;
  --warning: #ffb900;
  --danger: #d83b01;
  --purple: #5c2d91;
  --teal: #008272;
  --pink: #e3008c;

  /* Shadows & Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 16px 36px rgba(0,0,0,0.5), 0 0 1px rgba(255,255,255,0.1);
  --shadow-context: 0 12px 28px rgba(0,0,0,0.45);
}

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

body {
  font-family: var(--font-family);
  background: radial-gradient(circle at 50% 20%, #1e2638 0%, #0d1117 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

/* =========================================================
   Windows Desktop & Window Frame
   ========================================================= */

.desktop-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 10px 14px 14px 14px;
  max-width: 1700px;
  margin: 0 auto;
  width: 100%;
}

.window-frame {
  background: var(--win-surface);
  border: 1px solid var(--win-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(20px);
}

/* Window Titlebar */
.window-titlebar {
  height: 42px;
  background: rgba(28, 31, 37, 0.85);
  border-bottom: 1px solid var(--win-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.titlebar-title {
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.titlebar-badge {
  background: rgba(0, 120, 212, 0.2);
  color: #60cdff;
  border: 1px solid rgba(0, 120, 212, 0.4);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.titlebar-center {
  flex: 1;
  max-width: 480px;
  margin: 0 20px;
}

.search-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

.search-input {
  width: 100%;
  height: 28px;
  background: var(--win-surface-alt);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 0 30px 0 32px;
  color: var(--text-main);
  font-size: 12.5px;
  font-family: var(--font-family);
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #313744;
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.3);
}

.clear-search-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  font-size: 14px;
}

.clear-search-btn.active {
  display: block;
}

.titlebar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.thai-clock {
  font-size: 11.5px;
  color: #60cdff;
  background: rgba(96, 205, 255, 0.1);
  border: 1px solid rgba(96, 205, 255, 0.25);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.admin-link-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #d1d5db;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  border: 1px solid var(--win-border);
  transition: background 0.15s;
}

.admin-link-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.window-controls {
  display: flex;
  align-items: center;
  margin-left: 6px;
}

.win-btn {
  width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.win-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.win-btn.close:hover {
  background: #c42b1c;
  color: #fff;
}

/* =========================================================
   Command Bar / Ribbon Toolbar
   ========================================================= */

.window-toolbar {
  height: 48px;
  background: var(--win-surface);
  border-bottom: 1px solid var(--win-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 8px;
  overflow-x: auto;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--win-border);
}

.tool-btn:active {
  background: rgba(255, 255, 255, 0.14);
}

.tool-btn.primary {
  background: var(--accent);
  color: #ffffff;
}

.tool-btn.primary:hover {
  background: var(--accent-hover);
}

.tool-btn.danger {
  color: #ff6b6b;
}

.tool-btn.danger:hover {
  background: rgba(216, 59, 1, 0.2);
  border-color: rgba(216, 59, 1, 0.4);
}

.tool-separator {
  width: 1px;
  height: 22px;
  background: var(--win-border);
  margin: 0 4px;
}

.select-dropdown {
  background: var(--win-surface-alt);
  color: var(--text-main);
  border: 1px solid var(--win-border);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-family);
  font-size: 12.5px;
  cursor: pointer;
}

.select-dropdown:focus {
  outline: none;
  border-color: var(--accent);
}

/* Breadcrumbs bar */
.window-breadcrumb {
  height: 34px;
  background: rgba(32, 36, 43, 0.6);
  border-bottom: 1px solid var(--win-border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  gap: 8px;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--text-muted);
}

.breadcrumb-item:hover {
  color: var(--text-main);
}

.breadcrumb-item.active {
  color: #60cdff;
  font-weight: 600;
}

.breadcrumb-sep {
  opacity: 0.4;
  font-size: 10px;
}

/* =========================================================
   Main Explorer Body (Sidebar + Content Canvas)
   ========================================================= */

.window-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Sidebar Navigation Pane */
.window-sidebar {
  width: 250px;
  background: rgba(24, 27, 33, 0.9);
  border-right: 1px solid var(--win-border);
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 16px;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 0 10px 4px 10px;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-item.active {
  background: rgba(0, 120, 212, 0.2);
  border-color: rgba(0, 120, 212, 0.4);
  color: #60cdff;
  font-weight: 600;
}

.sidebar-item.drag-target-hover {
  background: rgba(16, 124, 65, 0.35) !important;
  border: 2px dashed #107c41 !important;
  transform: scale(1.02);
}

.sidebar-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 7px;
  border-radius: 10px;
  color: var(--text-muted);
}

.sidebar-storage-card {
  margin-top: auto;
  background: var(--win-surface-alt);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 12px;
}

.storage-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-weight: 500;
}

.storage-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.storage-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0078d4, #60cdff);
  width: 5%;
  transition: width 0.3s ease;
}

/* Explorer Canvas */
.window-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--win-bg);
  position: relative;
}

.explorer-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  position: relative;
}

/* Fullscreen Drag and Drop Overlay */
.dropzone-overlay {
  position: absolute;
  inset: 12px;
  border: 3px dashed #60cdff;
  background: rgba(0, 120, 212, 0.25);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 100;
  pointer-events: none;
  animation: pulseDropzone 1.5s infinite;
}

.dropzone-overlay.active {
  display: flex;
  pointer-events: all;
}

@keyframes pulseDropzone {
  0% { transform: scale(0.995); opacity: 0.9; }
  50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.995); opacity: 0.9; }
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  color: #60cdff;
}

.dropzone-text {
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
}

.dropzone-sub {
  font-size: 14px;
  color: #e5e7eb;
}

/* =========================================================
   Grid View Layout (Windows 11 Tiles)
   ========================================================= */

.files-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.file-card {
  background: var(--win-surface-alt);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  user-select: none;
}

.file-card:hover {
  background: var(--win-card-hover);
  border-color: var(--win-border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.file-card.selected {
  background: rgba(0, 120, 212, 0.22);
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

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

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.file-icon-box {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

.url-favicon-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
}

.file-ext-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #111827;
  color: #9ca3af;
  border: 1px solid var(--win-border);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}

.card-badges {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.lock-badge {
  color: #ffb900;
  display: flex;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.card-original-name {
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-category-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--win-border);
  padding-top: 8px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.card-quick-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 120, 212, 0.15);
  color: #60cdff;
  border: 1px solid rgba(0, 120, 212, 0.4);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.card-quick-open-btn:hover {
  background: #0078d4;
  color: #ffffff;
  border-color: #0078d4;
  transform: translateY(-1px);
}

.table-quick-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 120, 212, 0.15);
  color: #60cdff;
  border: 1px solid rgba(0, 120, 212, 0.35);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 6px;
}

.table-quick-open-btn:hover {
  background: #0078d4;
  color: #ffffff;
  border-color: #0078d4;
}

.fluent-context-menu .menu-item.primary-action {
  font-weight: 600;
  color: #60cdff;
}


/* =========================================================
   Table View Layout (Windows 11 Details)
   ========================================================= */

.files-table-container {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.files-table-container th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--win-border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  background: var(--win-surface);
  position: sticky;
  top: 0;
  z-index: 10;
  cursor: pointer;
}

.files-table-container th:hover {
  color: var(--text-main);
}

.files-table-container td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

.table-row {
  cursor: pointer;
  transition: background 0.12s;
}

.table-row:hover {
  background: var(--win-card-hover);
}

.table-row.selected {
  background: rgba(0, 120, 212, 0.22);
}

.table-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-file-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-name-texts {
  display: flex;
  flex-direction: column;
}

.table-title {
  font-weight: 600;
}

.table-sub {
  font-size: 11px;
  color: var(--text-dim);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  gap: 12px;
  text-align: center;
}

.empty-icon {
  opacity: 0.35;
  width: 80px;
  height: 80px;
}

/* =========================================================
   Windows Status Bar
   ========================================================= */

.window-statusbar {
  height: 28px;
  background: rgba(24, 27, 33, 0.95);
  border-top: 1px solid var(--win-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.statusbar-left, .statusbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* =========================================================
   Windows 11 Fluent Context Menu
   ========================================================= */

.fluent-context-menu {
  position: fixed;
  background: rgba(36, 41, 51, 0.96);
  border: 1px solid var(--win-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-context);
  backdrop-filter: blur(16px);
  padding: 6px;
  min-width: 220px;
  z-index: 1000;
  display: none !important;
}

.fluent-context-menu.active {
  display: block !important;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.menu-item.danger:hover {
  background: rgba(216, 59, 1, 0.25);
  color: #ff6b6b;
}

.menu-separator {
  height: 1px;
  background: var(--win-border);
  margin: 4px 6px;
}

/* =========================================================
   Modals & Windows
   ========================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-window {
  background: var(--win-surface);
  border: 1px solid var(--win-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  height: 44px;
  background: var(--win-surface-alt);
  border-bottom: 1px solid var(--win-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 12px 20px;
  background: var(--win-surface-alt);
  border-top: 1px solid var(--win-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--win-surface-alt);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  color: var(--text-main);
  font-size: 13.5px;
  font-family: var(--font-family);
  transition: border-color 0.15s;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.25);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--win-border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

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

.btn-danger {
  background: #c42b1c;
  color: #fff;
}

.btn-danger:hover {
  background: #d83b01;
}

/* Upload Progress Modal Items */
.upload-dropzone {
  border: 2px dashed var(--win-border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: #60cdff;
  background: rgba(0, 120, 212, 0.12);
}

.upload-queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.queue-item {
  background: var(--win-surface-alt);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.queue-item-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.queue-item-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}

.queue-progress-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.queue-progress-fill {
  height: 100%;
  background: #107c41;
  width: 0%;
  transition: width 0.15s ease;
}

.overall-progress-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: rgba(0, 120, 212, 0.1);
  border: 1px solid rgba(0, 120, 212, 0.3);
  border-radius: var(--radius-md);
}

/* Preview Modal Elements */
.preview-window {
  max-width: 880px;
  width: 90vw;
}

.preview-media-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  max-height: 550px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.preview-media-container img {
  max-width: 100%;
  max-height: 540px;
  object-fit: contain;
}

.preview-media-container video {
  max-width: 100%;
  max-height: 540px;
  outline: none;
}

.preview-media-container audio {
  width: 90%;
}

.preview-note-box {
  background: #1e1e1e;
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: monospace;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow-y: auto;
  user-select: text;
  color: #e5e7eb;
}

.preview-url-card {
  background: var(--win-surface-alt);
  border: 1px solid var(--win-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-url-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-url-favicon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
}

/* PIN Screen */
.pin-pad-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
}

.pin-display-input {
  width: 240px;
  height: 50px;
  font-size: 26px;
  letter-spacing: 12px;
  text-align: center;
  background: #11141a;
  border: 2px solid var(--accent);
  color: #ffffff;
  border-radius: var(--radius-md);
}

.pin-error-text {
  color: #ff6b6b;
  font-size: 13px;
  font-weight: 500;
  display: none;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 45px;
  right: 25px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: rgba(32, 36, 43, 0.95);
  border: 1px solid var(--win-border-light);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  box-shadow: var(--shadow-context);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  animation: toastSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

@keyframes toastSlide {
  0% { transform: translateY(15px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--accent); }

/* Responsive adjustments */
@media (max-width: 768px) {
  .desktop-container {
    padding: 0;
  }
  .window-frame {
    border-radius: 0;
    border: none;
  }
  .window-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -260px;
    z-index: 50;
    transition: left 0.25s ease;
  }
  .window-sidebar.mobile-open {
    left: 0;
    box-shadow: 10px 0 30px rgba(0,0,0,0.8);
  }
  .search-box-wrap {
    max-width: 140px;
  }
  .files-grid-container {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* =========================================================
   Realtime Live Status & Highlight Animations
   ========================================================= */

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #107c41;
  box-shadow: 0 0 6px #107c41;
  display: inline-block;
  animation: liveDotPulse 2s infinite ease-in-out;
}

.live-dot.disconnected {
  background: #d83b01;
  box-shadow: 0 0 6px #d83b01;
  animation: none;
}

@keyframes liveDotPulse {
  0% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.35); opacity: 0.45; }
  100% { transform: scale(1); opacity: 0.95; }
}

@keyframes newItemPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(96, 205, 255, 0.9), 0 0 25px rgba(96, 205, 255, 0.7);
    border-color: #60cdff;
  }
  35% {
    transform: scale(1.03);
    box-shadow: 0 0 0 8px rgba(96, 205, 255, 0), 0 0 35px rgba(96, 205, 255, 0.85);
    border-color: #60cdff;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 16px rgba(96, 205, 255, 0.35);
    border-color: rgba(96, 205, 255, 0.6);
  }
}

.file-card.new-item-glow,
.table-row.new-item-glow {
  animation: newItemPulse 1.6s ease-out 2;
  border-color: #60cdff !important;
  background: rgba(96, 205, 255, 0.12) !important;
}

