/* Design System & Variables */
:root {
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color Palette (Deep Cyber Dark) */
  --bg-primary: #0a0b10;
  --bg-card: rgba(20, 22, 33, 0.45);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-hover: rgba(255, 255, 255, 0.15);
  
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.1);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.1);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #6b7280;
  
  --blur-amount: 20px;
  --border-radius: 16px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Decorative Background Gradients */
.bg-gradient {
  position: fixed;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.15;
  pointer-events: none;
  z-index: -1;
}

.bg-1 {
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  top: -10vw;
  left: -10vw;
}

.bg-2 {
  background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
  bottom: -10vw;
  right: -10vw;
}

/* Glassmorphism Common Style */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
  border: 1px solid var(--border-card);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition);
}

.glass-card:hover {
  border-color: var(--border-card-hover);
}

/* Typography & Links */
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 500; color: var(--text-muted); }
p { font-size: 0.95rem; color: var(--text-muted); }

/* Buttons */
.btn {
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
}

.btn-primary-soft {
  background: var(--primary-light);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.btn-primary-soft:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-card);
}

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

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
}

.btn-danger-soft {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger-soft:hover {
  background: var(--danger);
  color: white;
  transform: scale(1.05);
}

/* Animations */
.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

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

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Screens */
.full-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.hidden {
  display: none !important;
}

/* Login Card */
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  text-align: center;
}

.brand {
  margin-bottom: 2rem;
}

.logo-icon {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.brand h2 {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.brand p {
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Input Styles */
.input-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

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

.input-wrapper i {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
}

.input-wrapper input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  color: white;
  font-family: var(--font-family);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.input-wrapper input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px var(--primary-light);
}

/* Selector Inputs (Dropdown) */
.select-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #141621;
  border: 1px solid var(--border-card);
  border-radius: 10px;
  color: white;
  font-family: var(--font-family);
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.select-input:focus {
  border-color: var(--primary);
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 2rem 5vw;
  max-width: 1600px;
  margin: 0 auto;
  gap: 2rem;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 1.25rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-brand .logo-icon {
  font-size: 2rem;
  margin-bottom: 0;
}

.brand-text h1 {
  line-height: 1.2;
}

.sub-brand {
  font-size: 0.75rem;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  padding: 1.5rem;
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-icon.disk { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.stat-icon.ram { background: rgba(168, 85, 247, 0.1); color: var(--accent-purple); }
.stat-icon.cpu { background: rgba(6, 182, 212, 0.1); color: var(--accent-cyan); }

.stat-info h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-info .stat-sub {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.15rem;
  display: block;
}

.progress-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

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

.stat-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cpu-load-body {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.cpu-load-val {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1;
}

.cpu-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Dashboard Tabs Selector */
.tab-selector {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary);
  border-radius: 3px;
}

.tab-btn:hover:not(.active) {
  color: var(--text-main);
}

/* Main Content Grid */
.main-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .main-content {
    grid-template-columns: 380px 1fr;
  }
}

/* Upload Card */
.upload-card {
  padding: 2rem;
  height: 100%;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  gap: 1.5rem;
  transition: var(--transition);
}

#drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.upload-cloud {
  font-size: 3rem;
  color: var(--primary);
  opacity: 0.8;
  transition: var(--transition);
}

#drop-zone:hover .upload-cloud {
  transform: translateY(-5px);
  opacity: 1;
}

.highlight-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.upload-note {
  font-size: 0.75rem;
  color: var(--text-dark);
}

/* Upload Queue */
#upload-queue {
  width: 100%;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-card);
  padding-top: 1rem;
}

.queue-header {
  margin-bottom: 0.75rem;
}

.queue-header h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

#queue-items {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.upload-row {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}

.upload-row-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}

.upload-row-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.upload-row-percent {
  color: var(--accent-cyan);
}

/* Gallery Section */
.gallery-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Explorer Navigation */
.explorer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 1rem;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.breadcrumb-item {
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.breadcrumb-item:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.breadcrumb-item:last-child {
  color: var(--text-main);
  cursor: default;
  text-decoration: none;
}

.breadcrumb-separator {
  color: var(--text-dark);
}

.gallery-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .gallery-toolbar {
    flex-direction: row;
    align-items: center;
  }
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 320px;
}

.search-bar i {
  position: absolute;
  left: 0.85rem;
  color: var(--text-dark);
}

.search-bar input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  color: white;
  font-family: var(--font-family);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.search-bar input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-card);
}

.filter-tab {
  background: transparent;
  border: none;
  font-family: var(--font-family);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab.active {
  background: var(--primary);
  color: white;
}

.filter-tab:hover:not(.active) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

/* Files Grid */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  min-height: 240px;
}

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  text-align: center;
  padding: 3rem;
  gap: 1rem;
}

.empty-state i {
  font-size: 3.5rem;
}

/* Folder & File Cards */
.file-card, .folder-card {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  height: 220px;
}

.folder-card {
  height: 120px;
  cursor: pointer;
}

.file-card:hover, .folder-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-card-hover);
  background: rgba(255, 255, 255, 0.04);
}

/* Preview Area */
.file-preview, .folder-preview {
  height: 130px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text-muted);
  overflow: hidden;
  position: relative;
}

.folder-preview {
  height: 70px;
  font-size: 2rem;
  background: rgba(99, 102, 241, 0.05);
  color: #818cf8;
}

.file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview .file-overlay, .folder-card .file-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 16, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  gap: 0.75rem;
  backdrop-filter: blur(4px);
  z-index: 5;
}

.file-card:hover .file-overlay, .folder-card:hover .file-overlay {
  opacity: 1;
}

.overlay-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: var(--transition);
}

.btn-copy { background: white; color: var(--bg-primary); }
.btn-copy:hover { transform: scale(1.1); background: var(--accent-cyan); color: white; }
.btn-share { background: #818cf8; color: white; }
.btn-share:hover { transform: scale(1.1); background: var(--primary); }
.btn-delete { background: var(--danger-light); color: var(--danger); }
.btn-delete:hover { transform: scale(1.1); background: var(--danger); color: white; }

/* Card Details */
.file-details, .folder-details {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.folder-details {
  justify-content: center;
  padding: 0.65rem 0.85rem;
}

.file-name, .folder-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.file-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dark);
}

/* Modals Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 1rem;
}

.modal-card {
  width: 100%;
  max-width: 450px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.share-modal-card {
  max-width: 500px;
}

.modal-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
}

.share-file-name {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  margin-bottom: 1.5rem;
  word-break: break-all;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.75rem;
  border-top: 1px solid var(--border-card);
  padding-top: 1rem;
}

.share-options-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Share Results URL Copy Box */
.share-link-copy-box {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.share-link-copy-box input {
  flex: 1;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  color: var(--accent-cyan);
  font-family: var(--font-family);
  outline: none;
  font-size: 0.9rem;
}

/* Shares List Table */
.shares-header {
  margin-bottom: 1rem;
}

.shares-header h2 {
  font-size: 1.25rem;
}

.shares-header p {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-card);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.1);
}

.shares-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.shares-table th, .shares-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-card);
}

.shares-table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.02);
}

.shares-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

.shares-table td {
  color: var(--text-main);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shares-table .cell-link {
  color: var(--accent-cyan);
  text-decoration: underline;
  cursor: pointer;
}

.shares-table .empty-table {
  text-align: center;
  padding: 3rem;
  color: var(--text-dark);
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.security-badge.lock {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.security-badge.open {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
}

/* Toast System */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
}

.toast {
  background: rgba(20, 22, 33, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast.success i { color: var(--success); }
.toast.info i { color: var(--accent-cyan); }
.toast.error i { color: var(--danger); }

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

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 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);
}
