@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,700;1,9..40,400&display=swap');

:root {
  --brand-primary: #2A6FE0;
  --brand-secondary: #3B86EF;
  --primary: #2A6FE0;
  --primary-light: #3B86EF;
  --accent: #2A6FE0;
  --accent-light: #3B86EF;
  --bg-main: #F5F8FF;
  --bg-card: #ffffff;
  --bg-hover: #EBF1FF;
  --bg-grid: #EEF3FF;
  --bg-canvas-wrap: #e2e8f0;
  --bg-canvas-area: #dde1e7;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border: rgba(42,111,224,0.14);
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 3px rgba(42,111,224,0.08);
  --shadow-md: 0 4px 12px rgba(42,111,224,0.12);
  --shadow-lg: 0 8px 24px rgba(42,111,224,0.16);
  --radius: 12px;
  --radius-sm: 8px;
  /* Alias vars used in components.css */
  --bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --artemis-accent: #2A6FE0;
}

/* ─── DARK MODE ──────────────────────────────────────────────────────────────── */

.theme-dark {
  --bg-main: #071225;
  --bg-card: #0E1B33;
  --bg-hover: #132443;
  --bg-grid: #071225;
  --bg-canvas-wrap: #0E1B33;
  --bg-canvas-area: #0a1628;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --border: rgba(59,134,239,0.24);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.45);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  /* Alias vars */
  --bg: #0E1B33;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --artemis-accent: #3B86EF;
}

/* Dark mode: specific overrides for elements with hardcoded colors */
.theme-dark .pg-card.drag-over { background: #112040; }
.theme-dark .ws-empty-dropzone:hover,
.theme-dark .ws-empty-dropzone.dragover { background: rgba(59,134,239,0.10); border-color: rgba(59,134,239,0.55); }
.theme-dark .ws-dropzone:hover,
.theme-dark .ws-dropzone.dragover { background: rgba(59,134,239,0.10); border-color: rgba(59,134,239,0.55); }
.theme-dark .merge-item.drag-over { background: #112040; }
.theme-dark .image-item.drag-over { background: #112040; }
.theme-dark .upload-dropzone:hover,
.theme-dark .upload-dropzone.dragover { background: rgba(59,134,239,0.08); }
.theme-dark .mode-hint { background: #0e1e3d; border-color: #2A6FE0; color: #93c5fd; }
.theme-dark .download-bar { background: #0d2317; color: #86efac; }
.theme-dark .download-area { background: #0d2317; }
.theme-dark .pg-skeleton {
  background: linear-gradient(90deg, #0E1B33 25%, #132443 50%, #0E1B33 75%);
  background-size: 200% 100%;
}
.theme-dark .pg-list .pg-hover-actions { background: rgba(7, 18, 37, 0.95); }
.theme-dark .pg-file-type { background: #0e1e3d; color: #93c5fd; }
.theme-dark .pg-file-type.type-word { background: #0e1e4a; color: #93c5fd; }
.theme-dark .pg-file-type.type-excel { background: #14532d; color: #86efac; }
.theme-dark .pg-file-type.type-ppt { background: #431407; color: #fdba74; }
.theme-dark .pg-file-type.type-image { background: #422006; color: #fde68a; }
.theme-dark .pg-insert-zone-btn:hover { background: #112040; }
.theme-dark .pg-first-insert-btn:hover { background: #112040; }
.theme-dark .thumb-item.selected { background: #112040; }
.theme-dark select,
.theme-dark input[type="text"] {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

input, textarea {
  font-family: inherit;
  outline: none;
}

.hidden { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-light); box-shadow: var(--shadow-md); }

.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: var(--accent-light); box-shadow: var(--shadow-md); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  background: var(--error);
  color: white;
}
.btn-danger:hover { background: #dc2626; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-soon {
  background: #fef3c7;
  color: #92400e;
}

/* ─── APP SHELL ──────────────────────────────────────────────────────────────── */

#app {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ws-app-shell {
  display: flex;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* ─── TOPBAR NAV ─────────────────────────────────────────────────────────────── */

.ws-topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 16px;
}

.ws-topbar-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: rgba(255,255,255,0.65);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.ws-topbar-nav-item:hover {
  background: rgba(255,255,255,0.12);
  color: white;
}

.ws-topbar-nav-item.active {
  background: rgba(255,255,255,0.18);
  color: white;
  border-color: rgba(255,255,255,0.22);
}

/* ─── MAIN COLUMN ────────────────────────────────────────────────────────────── */

.ws-main-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.ws-app-header {
  height: 56px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  flex-shrink: 0;
}

.ws-app-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.ws-doc-state {
  font-size: 12px;
  opacity: 0.65;
  white-space: nowrap;
  background: rgba(255,255,255,0.12);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ─── EMPTY STATE ────────────────────────────────────────────────────────────── */

.ws-empty-drop {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.ws-empty-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 56px 48px;
  text-align: center;
  background: var(--bg-card);
  max-width: 500px;
  width: 100%;
  transition: all 0.2s ease;
}

.ws-empty-dropzone:hover,
.ws-empty-dropzone.dragover {
  border-color: var(--accent);
  background: #f0f9ff;
  transform: scale(1.01);
}

.ws-empty-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--accent);
}

.ws-empty-dropzone h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.ws-empty-dropzone p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ─── MODE HINT BANNER ───────────────────────────────────────────────────────── */

.mode-hint {
  padding: 7px 16px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  font-size: 12px;
  font-weight: 500;
  color: #1e40af;
  flex-shrink: 0;
}

/* ─── COMPRESS PANEL ─────────────────────────────────────────────────────────── */

.compress-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.compress-sel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-card);
  font-family: inherit;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }
