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

:root {
  --bg-primary: #0a0a12;
  --bg-secondary: #12121f;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --text-primary: #f0f0f5;
  --text-secondary: #8b8ba7;
  --text-muted: #5c5c7a;
  --accent-1: #7c3aed;
  --accent-2: #3b82f6;
  --success: #10b981;
  --error: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure HTML hidden attribute always works (override CSS display rules) */
[hidden] { display: none !important; }

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === Navbar === */
.navbar {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 18, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links { display: flex; align-items: center; gap: 16px; }

.nav-link {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition);
}
.nav-link:hover { color: var(--text-primary); }

.nav-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 30px rgba(124, 58, 237, 0.4);
}

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

.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; }

/* === Hero === */
.hero { padding: 60px 0 40px; text-align: center; }
.hero-content { max-width: 600px; margin: 0 auto; }

.hero-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #f0f0f5 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle { font-size: 16px; color: var(--text-secondary); }

/* === Upload Card === */
.upload-section { padding-bottom: 40px; }

.upload-card {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.upload-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(59, 130, 246, 0.05));
  opacity: 0;
  transition: opacity var(--transition);
}

.upload-card:hover::before,
.upload-card.dragover::before { opacity: 1; }

.upload-card:hover,
.upload-card.dragover {
  border-color: var(--accent-1);
  border-style: solid;
}

.upload-card.uploading {
  border-color: var(--accent-2);
  border-style: solid;
  cursor: default;
}
.upload-card.uploading::before {
  opacity: 1;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(124, 58, 237, 0.08));
}

.upload-card.success { border-color: var(--success); border-style: solid; }

.upload-icon { color: var(--text-muted); margin-bottom: 16px; transition: color var(--transition); }
.upload-card:hover .upload-icon,
.upload-card.dragover .upload-icon { color: var(--accent-1); }

.upload-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.upload-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.upload-hint { font-size: 12px; color: var(--text-muted); margin-top: 16px; }

/* === Upload Progress === */
.upload-progress { position: relative; z-index: 1; }

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 12px;
}

.progress-info span:first-child {
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.progress-info span:last-child { color: var(--accent-2); font-weight: 600; }

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

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

.progress-fill.indeterminate {
  width: 35%;
  animation: loadingBar 1.4s ease-in-out infinite;
}

@keyframes loadingBar {
  0%   { transform: translateX(-200%); }
  60%  { transform: translateX(300%); }
  100% { transform: translateX(300%); }
}

.progress-status { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* === Files List === */
.files-section { padding-bottom: 60px; }

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.files-list { display: flex; flex-direction: column; gap: 8px; }

.file-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  animation: fadeIn 0.3s ease;
}

.file-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.file-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 58, 237, 0.1);
  border-radius: var(--radius-sm);
  color: var(--accent-1);
}

.file-info { flex: 1; min-width: 0; }

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

.file-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.file-link {
  font-size: 12px;
  color: var(--accent-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 360px;
  display: inline-block;
  cursor: pointer;
}
.file-link:hover { text-decoration: underline; }

.file-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-copy {
  padding: 8px;
  background: rgba(59, 130, 246, 0.1);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--accent-2);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-copy:hover { background: rgba(59, 130, 246, 0.2); }
.btn-copy.copied { background: rgba(16, 185, 129, 0.1); color: var(--success); }

/* === Footer === */
.footer { padding: 24px 0; border-top: 1px solid var(--border); text-align: center; }
.footer p { font-size: 12px; color: var(--text-muted); }

/* === Toast === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  white-space: nowrap;
  animation: toastIn 0.3s ease;
}

.toast.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.toast.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--error);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

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

/* === Admin Login === */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.08), transparent 70%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  backdrop-filter: blur(20px);
}

.login-logo {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-title { font-size: 22px; font-weight: 600; margin-top: 24px; margin-bottom: 8px; }
.login-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 32px; }

.login-form { display: flex; flex-direction: column; gap: 16px; }

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

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

.login-error { color: var(--error); font-size: 13px; margin-top: 12px; }

/* === Dashboard === */
.dashboard-view { min-height: 100vh; }

.dashboard-section { padding: 40px 0; }

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.dashboard-title { font-size: 24px; font-weight: 700; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  min-width: 240px;
}

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

.search-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
.search-input::placeholder { color: var(--text-muted); }

/* === Table === */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.files-table { width: 100%; border-collapse: collapse; }

.files-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.files-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.files-table tr:last-child td { border-bottom: none; }
.files-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.table-empty {
  text-align: center;
  padding: 48px 16px !important;
  color: var(--text-muted) !important;
  font-size: 14px !important;
}

.table-filename {
  color: var(--text-primary);
  font-weight: 500;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions { display: flex; gap: 8px; }

.btn-icon {
  padding: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-icon.danger:hover {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

/* === Modal === */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

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

.modal-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  z-index: 1;
}

.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.modal-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }

.modal-filename {
  font-size: 13px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  word-break: break-all;
}

.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* === Responsive === */
@media (max-width: 600px) {
  .hero-title { font-size: 28px; }
  .upload-card { padding: 32px 20px; }
  .file-card { flex-direction: column; align-items: flex-start; }
  .file-actions { width: 100%; justify-content: flex-end; }
  .dashboard-header { flex-direction: column; align-items: stretch; }
  .search-box { min-width: unset; }
  .files-table th, .files-table td { padding: 10px 12px; }
}
