/* ========================================
   CopyCat — Design System
   Dark glassmorphism theme
   ======================================== */

/* ---- CSS Custom Properties ---- */
:root {
  /* Colors */
  --bg-primary: #0a0614;
  --bg-secondary: #120d21;
  --bg-elevated: #1a1230;
  --bg-glass: rgba(22, 14, 45, 0.65);
  --bg-glass-hover: rgba(30, 20, 60, 0.75);
  --bg-glass-border: rgba(255, 255, 255, 0.06);

  --text-primary: #f0ecf6;
  --text-secondary: #a09ab0;
  --text-muted: #6b6580;

  --accent-primary: #a855f7;
  --accent-primary-hover: #c084fc;
  --accent-secondary: #6366f1;
  --accent-gradient: linear-gradient(135deg, #a855f7, #6366f1);
  --accent-glow: rgba(168, 85, 247, 0.3);

  --success: #34d399;
  --warning: #fbbf24;
  --error: #f87171;

  /* File type colors */
  --file-txt: #60a5fa;
  --file-doc: #818cf8;
  --file-docx: #a78bfa;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50%;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 70px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ---- Utility ---- */
.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

/* ---- Glass Panel ---- */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
}

/* ========================================
   Loading Screen
   ======================================== */
.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 9999;
  gap: var(--space-xl);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.loading-cat {
  font-size: 64px;
  animation: float 2s ease-in-out infinite;
}

.loading-text {
  font-size: 28px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(168, 85, 247, 0.2);
  border-top: 3px solid var(--accent-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

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

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

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideInRight var(--duration-slow) var(--ease-out);
  min-width: 280px;
  max-width: 420px;
}

.toast.toast-exit {
  animation: slideOutRight var(--duration-normal) var(--ease-out) forwards;
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-message {
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--accent-primary); }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* ========================================
   Auth Screen
   ======================================== */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
}

.auth-bg-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(80px);
  opacity: 0.4;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-primary);
  top: -100px;
  right: -100px;
  animation: orbFloat1 12s ease-in-out infinite;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--accent-secondary);
  bottom: -50px;
  left: -50px;
  animation: orbFloat2 15s ease-in-out infinite;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: #ec4899;
  top: 50%;
  left: 60%;
  animation: orbFloat3 10s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-50px, 60px); }
  66% { transform: translate(30px, -40px); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(40px, -50px); }
  66% { transform: translate(-30px, 30px); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60px, 40px) scale(1.2); }
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: var(--space-lg);
}

.auth-card {
  padding: var(--space-2xl) var(--space-xl);
  animation: fadeInUp 0.6s var(--ease-out);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-logo {
  font-size: 56px;
  margin-bottom: var(--space-sm);
  animation: float 3s ease-in-out infinite;
}

.auth-title {
  font-size: 32px;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: var(--space-xs);
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: var(--space-lg);
}

.auth-tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--duration-normal) var(--ease-out);
}

.auth-tab.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

.auth-tab:not(.active):hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* Form Styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: var(--space-md);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 14px var(--space-md) 14px 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  outline: none;
  transition: all var(--duration-normal) var(--ease-out);
}

.input-wrapper input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
}

/* PIN Input */
.pin-input-group {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

.pin-input {
  width: 56px;
  height: 64px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  outline: none;
  transition: all var(--duration-normal) var(--ease-out);
  caret-color: var(--accent-primary);
}

.pin-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
  background: rgba(255, 255, 255, 0.06);
  transform: scale(1.05);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-sm), 0 0 20px rgba(168, 85, 247, 0.2);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), 0 0 30px rgba(168, 85, 247, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-sm {
  padding: 8px var(--space-md);
  font-size: 13px;
}

.btn-sm svg {
  width: 15px;
  height: 15px;
}

.btn-full {
  width: 100%;
  padding: 14px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn:disabled,
.btn-icon:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ========================================
   Dashboard Layout
   ======================================== */
.dashboard-screen {
  display: flex;
  min-height: 100vh;
  background: var(--bg-primary);
  animation: fadeIn 0.4s var(--ease-out);
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border-right: 1px solid var(--bg-glass-border);
  border-left: none;
  border-top: none;
  border-bottom: none;
  z-index: 100;
  transition: transform var(--duration-slow) var(--ease-out);
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.logo-icon {
  font-size: 28px;
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px var(--space-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
  text-align: left;
  width: 100%;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-primary-hover);
}

.nav-item.active svg {
  color: var(--accent-primary);
}

/* Sidebar Storage */
.sidebar-storage {
  padding: var(--space-md) var(--space-lg);
  margin: 0 var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
}

.storage-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

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

.storage-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 3px;
  transition: width var(--duration-slow) var(--ease-out);
  min-width: 0;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Top Bar ---- */
.top-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xl);
  height: var(--topbar-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  position: sticky;
  top: 0;
  background: rgba(10, 6, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 50;
}

.sidebar-toggle {
  display: none;
}

.search-wrapper {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: var(--space-md);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px var(--space-md) 10px 42px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  outline: none;
  transition: all var(--duration-normal);
}

.search-input:focus {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.top-bar-actions {
  display: flex;
  gap: var(--space-sm);
  margin-left: auto;
}

/* ---- Drop Zone ---- */
.drop-zone {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 6, 20, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--duration-fast);
}

.drop-zone-content {
  text-align: center;
  padding: var(--space-2xl);
  border: 3px dashed var(--accent-primary);
  border-radius: var(--radius-xl);
  background: rgba(168, 85, 247, 0.08);
  min-width: 320px;
}

.drop-zone-content svg {
  width: 48px;
  height: 48px;
  color: var(--accent-primary);
  margin-bottom: var(--space-md);
}

.drop-zone-content p {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.drop-zone-content span {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---- File Grid ---- */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
  padding: var(--space-xl);
  flex: 1;
}

/* ---- File Card ---- */
.file-card {
  background: var(--bg-glass);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  animation: fadeInUp 0.4s var(--ease-out) both;
}

.file-card:hover {
  transform: translateY(-4px);
  background: var(--bg-glass-hover);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.2);
}

.file-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
}

.file-card-icon.txt {
  background: rgba(96, 165, 250, 0.12);
  color: var(--file-txt);
}

.file-card-icon.doc,
.file-card-icon.docx {
  background: rgba(167, 139, 250, 0.12);
  color: var(--file-docx);
}

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

.file-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.file-card-actions {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  gap: 2px;
  opacity: 0;
  transform: translateY(-4px);
  transition: all var(--duration-fast);
}

.file-card:hover .file-card-actions {
  opacity: 1;
  transform: translateY(0);
}

.file-card-actions .btn-icon {
  width: 32px;
  height: 32px;
}

.file-card-actions .btn-icon svg {
  width: 16px;
  height: 16px;
}

.file-card-actions .btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}

.file-card-actions .btn-icon.delete:hover {
  color: var(--error);
  background: rgba(248, 113, 113, 0.12);
}

/* ---- Empty State ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
  flex: 1;
  min-height: 60vh;
  animation: fadeIn 0.5s var(--ease-out);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: var(--space-lg);
  opacity: 0.6;
}

.empty-state h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: var(--space-xl);
}

.empty-actions {
  display: flex;
  gap: var(--space-md);
}

/* ========================================
   Editor Modal
   ======================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--duration-fast);
}

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

.modal-content {
  position: relative;
  z-index: 1;
  width: 90vw;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: scaleIn var(--duration-normal) var(--ease-spring);
}

.editor-modal-content {
  height: 80vh;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: var(--space-md);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex: 1;
  min-width: 0;
}

.editor-filename {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: all var(--duration-fast);
  min-width: 220px;
  max-width: 380px;
}

.editor-filename:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.editor-filename:focus {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.editor-status {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

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

/* Editor Body */
.editor-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.txt-editor {
  flex: 1;
  width: 100%;
  padding: var(--space-lg);
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 14px;
  line-height: 1.7;
  resize: none;
  outline: none;
}

.txt-editor::placeholder {
  color: var(--text-muted);
}

/* DOCX Editor */
.docx-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.docx-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.docx-tool {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
}

.docx-tool:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.docx-tool.active {
  background: rgba(168, 85, 247, 0.2);
  color: var(--accent-primary);
}

.docx-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 4px;
}

.docx-select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}

.docx-select option {
  background: var(--bg-elevated);
}

.docx-content {
  flex: 1;
  padding: var(--space-xl);
  overflow-y: auto;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.8;
  outline: none;
  min-height: 200px;
}

.docx-content:empty::before {
  content: 'Start typing your document...';
  color: var(--text-muted);
}

.docx-content:focus {
  outline: none;
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

/* ---- Stagger animation for file cards ---- */
.file-card:nth-child(1) { animation-delay: 0.02s; }
.file-card:nth-child(2) { animation-delay: 0.04s; }
.file-card:nth-child(3) { animation-delay: 0.06s; }
.file-card:nth-child(4) { animation-delay: 0.08s; }
.file-card:nth-child(5) { animation-delay: 0.10s; }
.file-card:nth-child(6) { animation-delay: 0.12s; }
.file-card:nth-child(7) { animation-delay: 0.14s; }
.file-card:nth-child(8) { animation-delay: 0.16s; }
.file-card:nth-child(9) { animation-delay: 0.18s; }
.file-card:nth-child(10) { animation-delay: 0.20s; }
.file-card:nth-child(11) { animation-delay: 0.22s; }
.file-card:nth-child(12) { animation-delay: 0.24s; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    padding: var(--space-md);
  }

  .top-bar-actions span {
    display: none;
  }

  .auth-card {
    padding: var(--space-xl) var(--space-lg);
  }

  .pin-input {
    width: 48px;
    height: 56px;
    font-size: 20px;
  }

  .modal-content {
    width: 95vw;
    max-height: 90vh;
  }

  .editor-modal-content {
    height: 90vh;
  }
}

@media (max-width: 480px) {
  .top-bar {
    padding: var(--space-sm) var(--space-md);
  }

  .empty-actions {
    flex-direction: column;
    width: 100%;
  }

  .empty-actions .btn {
    width: 100%;
  }
}
