/* ========================================
   SFTP File Manager — Premium Dark Theme
   ======================================== */

/* CSS Variables */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-card-hover: #1f2a42;
  --bg-glass: rgba(26, 34, 54, 0.85);
  --bg-glass-light: rgba(30, 41, 66, 0.7);
  --bg-overlay: rgba(0, 0, 0, 0.6);

  --text-primary: #e8ecf4;
  --text-secondary: #8892a8;
  --text-muted: #5a6578;

  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --accent-soft: rgba(99, 102, 241, 0.1);

  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.15);
  --yellow: #eab308;
  --yellow-soft: rgba(234, 179, 8, 0.15);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.15);
  --orange: #f97316;
  --purple: #a855f7;
  --cyan: #06b6d4;

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

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

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --header-h: 64px;
  --sidebar-w: 260px;
}

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(168, 85, 247, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ========== HEADER ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo i {
  font-size: 1.3rem;
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--bg-card);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  animation: pulse 2s infinite;
}

.connection-status.connected .status-dot {
  background: var(--green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.connection-status.error .status-dot {
  background: var(--red);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Search Box */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.search-box i {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 10px 12px;
  width: 220px;
}

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

.search-box kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

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

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-icon.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* ========== LAYOUT ========== */
.main {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  position: relative;
  z-index: 1;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 20px;
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-section {
  margin-bottom: 28px;
}

.sidebar-section h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-section h3 i {
  font-size: 0.8rem;
  color: var(--accent);
}

.sidebar-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}

.sidebar-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(3px);
}

.sidebar-btn i {
  width: 18px;
  text-align: center;
}

/* Server Info */
.server-info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.info-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.info-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.info-value {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.stat-item:first-child {
  grid-column: 1 / -1;
}

.stat-number {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ========== FILE AREA ========== */
.file-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 20px 28px;
  position: relative;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.breadcrumb-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.breadcrumb-separator {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.file-count {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  padding: 6px 12px;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.sort-select:focus {
  border-color: var(--accent);
}

.sort-select option {
  background: var(--bg-secondary);
}

/* ========== FILE GRID ========== */
.file-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  animation: fadeInUp 0.3s ease;
}

.file-container.list-view {
  grid-template-columns: 1fr;
  gap: 4px;
}

/* File Card (Grid View) */
.file-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.file-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  opacity: 0;
  transition: var(--transition);
}

.file-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.file-card:hover::before {
  opacity: 1;
}

.file-card .file-icon {
  font-size: 2.5rem;
  transition: var(--transition);
}

.file-card:hover .file-icon {
  transform: scale(1.1);
}

.file-card .file-name {
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
  word-break: break-word;
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.file-card .file-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

/* File Card (List View) */
.file-container.list-view .file-card {
  flex-direction: row;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  gap: 14px;
}

.file-container.list-view .file-card::before {
  width: 3px;
  height: 100%;
  right: auto;
}

.file-container.list-view .file-card .file-icon {
  font-size: 1.4rem;
  min-width: 32px;
  text-align: center;
}

.file-container.list-view .file-card .file-name {
  flex: 1;
  text-align: left;
  -webkit-line-clamp: 1;
  max-height: 1.4em;
}

.file-container.list-view .file-card .file-meta {
  text-align: right;
  white-space: nowrap;
}

.file-container.list-view .file-card .file-size {
  min-width: 80px;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.file-container.list-view .file-card .file-date {
  min-width: 140px;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.icon-folder { color: #fbbf24; }
.icon-image { color: #f472b6; }
.icon-video { color: #fb923c; }
.icon-audio { color: #a78bfa; }
.icon-pdf { color: #ef4444; }
.icon-doc { color: #3b82f6; }
.icon-sheet { color: #22c55e; }
.icon-code { color: #06b6d4; }
.icon-archive { color: #f97316; }
.icon-text { color: #94a3b8; }
.icon-file { color: #64748b; }
.icon-data { color: #8b5cf6; }
.icon-exe { color: #6366f1; }

/* File Action Buttons */
.file-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(-4px);
  transition: var(--transition);
  z-index: 10;
}

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

.action-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.action-btn:hover {
  transform: scale(1.1);
}

.action-download:hover {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: var(--blue);
}

.action-rename:hover {
  background: var(--yellow-soft);
  color: var(--yellow);
  border-color: var(--yellow);
}

.action-delete:hover {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red);
}

/* List view action buttons */
.file-container.list-view .file-actions {
  position: relative;
  top: auto;
  right: auto;
  opacity: 0;
  transform: none;
}

.file-container.list-view .file-card:hover .file-actions {
  opacity: 1;
}

/* ========== DRAG & DROP ========== */
.drop-zone {
  position: fixed;
  top: var(--header-h);
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  background: rgba(99, 102, 241, 0.08);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.drop-zone.active {
  opacity: 1;
  pointer-events: auto;
}

.drop-zone-content {
  text-align: center;
  padding: 60px;
  border: 3px dashed var(--accent);
  border-radius: var(--radius-xl);
  background: var(--bg-glass);
  animation: breathe 2s infinite;
}

.drop-zone-content i {
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.drop-zone-content h2 {
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 1.3rem;
}

.drop-zone-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ========== EMPTY & LOADING STATES ========== */
.empty-state, .loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.empty-state i, .loading-state i {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h2 {
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Spinner */
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

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

/* ========== MODALS ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-slow);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9) translateY(20px);
  transition: var(--transition-slow);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-sm {
  max-width: 420px;
}

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

.modal-header h2 {
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h2 i {
  color: var(--accent);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: 50vh;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-area i {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 12px;
  opacity: 0.7;
}

.upload-area h3 {
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 6px;
}

.upload-area p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Upload List */
.upload-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.upload-item i {
  color: var(--accent);
}

.upload-item .upload-name {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-item .upload-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.upload-item .upload-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.upload-item .upload-remove:hover {
  color: var(--red);
  background: var(--red-soft);
}

/* Input Field */
.input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

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

/* Delete Warning */
.delete-warning {
  text-align: center;
  padding: 10px 0;
}

.delete-warning i {
  font-size: 2.5rem;
  color: var(--red);
  margin-bottom: 14px;
}

.delete-warning p {
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.text-muted {
  color: var(--text-muted) !important;
  font-size: 0.82rem !important;
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 420px;
  animation: toastIn 0.35s ease;
  transition: var(--transition);
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

.toast i {
  font-size: 1.1rem;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.success i { color: var(--green); }

.toast.error { border-left: 3px solid var(--red); }
.toast.error i { color: var(--red); }

.toast.info { border-left: 3px solid var(--blue); }
.toast.info i { color: var(--blue); }

.toast.warning { border-left: 3px solid var(--yellow); }
.toast.warning i { color: var(--yellow); }

.toast-message {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
  transition: var(--transition);
}

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

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

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

/* ========== PROGRESS OVERLAY ========== */
.progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
}

.progress-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 40px;
  text-align: center;
  min-width: 360px;
  box-shadow: var(--shadow-lg);
}

.progress-card h3 {
  font-size: 1rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.progress-card h3 i {
  color: var(--accent);
  animation: spin 1.5s linear infinite;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 10px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ========== CONTEXT MENU ========== */
.context-menu {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  transition: var(--transition);
}

.context-menu.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.context-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.context-item i {
  width: 16px;
  text-align: center;
  font-size: 0.85rem;
}

.context-danger:hover {
  background: var(--red-soft);
  color: var(--red);
}

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

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.file-card {
  animation: fadeInUp 0.3s ease backwards;
}

.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; }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
  .file-area {
    margin-left: 0;
  }
  .drop-zone {
    left: 0;
  }
  .search-box input {
    width: 160px;
  }
  .search-box kbd {
    display: none;
  }
}

@media (max-width: 600px) {
  .header {
    padding: 0 14px;
  }
  .logo span {
    display: none;
  }
  .file-container {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .file-area {
    padding: 16px;
  }
}

/* ========== SETTINGS FORM ========== */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-group {
  flex: 1;
}

.form-group-lg {
  flex: 2;
}

.form-group-sm {
  flex: 0.6;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field .input-field {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.85rem;
  transition: var(--transition);
}

.password-toggle:hover {
  color: var(--text-primary);
}

.settings-test {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeInUp 0.3s ease;
}

.settings-test.success {
  background: var(--green-soft);
  border: 1px solid var(--green);
  color: var(--green);
}

.settings-test.error {
  background: var(--red-soft);
  border: 1px solid var(--red);
  color: var(--red);
}

.settings-test.loading {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
}

#settingsBtn .fa-cog {
  transition: transform 0.5s ease;
}

#settingsBtn:hover .fa-cog {
  transform: rotate(90deg);
}

@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
  }
}

/* ========== ADMIN LOGIN ========== */
.admin-lock-icon {
  text-align: center;
  margin-bottom: 16px;
}

.admin-lock-icon i {
  font-size: 3rem;
  color: var(--accent);
  filter: drop-shadow(0 0 12px var(--accent-glow));
  animation: breathe 2s infinite;
}

.admin-login-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.admin-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--red-soft);
  border: 1px solid var(--red);
  border-radius: var(--radius-md);
  color: var(--red);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeInUp 0.3s ease;
}

/* Settings Divider */
.settings-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

/* Change Password Section */
.change-password-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.change-password-section summary {
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  list-style: none;
}

.change-password-section summary::-webkit-details-marker {
  display: none;
}

.change-password-section summary::after {
  content: '▶';
  font-size: 0.6rem;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.change-password-section[open] summary::after {
  transform: rotate(90deg);
}

.change-password-section summary:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.change-password-section summary i {
  color: var(--yellow);
}

.change-password-form {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
