:root {
  --bg-dark: #0f172a;
  --bg-darker: #020617;
  --glass-bg: rgba(15, 23, 42, 0.4);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --panel-bg: rgba(255, 255, 255, 0.03);
  --panel-border: rgba(255, 255, 255, 0.05);
  --panel-hover-bg: rgba(255, 255, 255, 0.08);
  --drop-bg: rgba(0, 0, 0, 0.2);
  --drop-border: rgba(255, 255, 255, 0.2);
  --drop-hover-bg: rgba(59, 130, 246, 0.1);
  --card-bg: rgba(0, 0, 0, 0.2);
  --card-border: rgba(255, 255, 255, 0.05);
  --card-hover-bg: rgba(255, 255, 255, 0.03);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --success: #10b981;
  --error: #ef4444;
}

body[data-theme="light"] {
  --bg-dark: #f8fafc;
  --bg-darker: #e2e8f0;
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(148, 163, 184, 0.25);
  --glass-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
  --panel-bg: rgba(255, 255, 255, 0.9);
  --panel-border: rgba(148, 163, 184, 0.35);
  --panel-hover-bg: rgba(241, 245, 249, 0.9);
  --drop-bg: rgba(255, 255, 255, 0.8);
  --drop-border: rgba(148, 163, 184, 0.5);
  --drop-hover-bg: rgba(59, 130, 246, 0.12);
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(148, 163, 184, 0.35);
  --card-hover-bg: rgba(241, 245, 249, 0.9);
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-purple: #7c3aed;
  --accent-cyan: #0ea5e9;
  --success: #16a34a;
  --error: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-darker);
  overflow-x: hidden;
  position: relative;
}

/* Animated Background Blobs */
.blob {
  position: absolute;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.5;
  border-radius: 50%;
  animation: float 20s infinite ease-in-out;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-blue);
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.blob-2 {
  width: 300px;
  height: 300px;
  background: var(--accent-purple);
  bottom: 10%;
  right: -5%;
  animation-delay: -5s;
}

.blob-3 {
  width: 350px;
  height: 350px;
  background: var(--accent-cyan);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* Layout */
.shell {
  width: min(800px, 92vw);
  margin: 4rem auto;
  display: grid;
  gap: 2rem;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  padding: 3rem;
}

.hero {
  position: relative;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}

.hero-copy {
  flex: 1;
}

.theme-toggle {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  min-width: 140px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

/* Typography */
.kicker {
  margin: 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.85rem;
}

h1 {
  margin: 0.5rem 0 1rem;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.hint {
  margin: 0 0 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Sections */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 2rem;
}

/* Upload Form */
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.file-drop-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 120px;
  border: 2px dashed var(--drop-border);
  border-radius: 12px;
  background: var(--drop-bg);
  transition: all 0.3s ease;
  cursor: pointer;
}

.file-drop-area:hover, .file-drop-area.dragover {
  border-color: var(--accent-blue);
  background: var(--drop-hover-bg);
}

.file-msg {
  color: var(--text-muted);
  font-weight: 400;
  pointer-events: none;
}

.file-input {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  cursor: pointer;
  opacity: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-blue {
  background: var(--accent-blue);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn-blue:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

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

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

.upload-status {
  margin-top: 1rem;
  font-size: 0.95rem;
  min-height: 1.5rem;
}

.status-success { color: var(--success); }
.status-error { color: var(--error); }

/* File List */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-icon {
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  padding: 0.5rem;
  border-radius: 8px;
  line-height: 1;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.16);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.26);
}

.list-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-delete {
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.18);
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.8rem;
}

.file-list li {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.file-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.file-list a {
  display: inline-flex;
  align-items: center;
  flex: 1;
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 400;
}

.file-list a::before {
  content: '📄';
  margin-right: 12px;
  font-size: 1.2rem;
  filter: grayscale(100%) brightness(150%);
  transition: all 0.2s ease;
}

.file-list li:hover {
  border-color: var(--panel-border);
  background: var(--card-hover-bg);
  transform: translateX(4px);
}

.file-list li:hover a::before {
  filter: none;
}

.empty {
  padding: 1rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* Loader */
.loader {
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top: 2px solid white;
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

.hidden {
  display: none !important;
}

.login-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-section {
  margin-top: 1.5rem;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.input-label {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 1rem;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .glass-panel {
    padding: 2rem 1.5rem;
  }
}

.login-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-section {
  margin-top: 1.5rem;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.input-label {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 1rem;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}