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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #0a0c10 0%, #121620 50%, #0f1117 100%);
  color: #e1e4e8;
  min-height: 100vh;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: rgba(22, 27, 34, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(48, 54, 61, 0.6);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.25em;
  font-weight: 800;
  color: #58a6ff;
  letter-spacing: -0.5px;
}

.logo span {
  color: #f0883e;
}

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

.nav-links a {
  color: #8b949e;
  text-decoration: none;
  padding: 8px 16px;
  font-size: 0.88em;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-links a:hover {
  color: #e1e4e8;
  background: rgba(88, 166, 255, 0.08);
}

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.landing-header {
  text-align: center;
  margin-bottom: 36px;
}

.landing-header h1 {
  font-size: 2.2em;
  font-weight: 800;
  background: linear-gradient(135deg, #58a6ff, #f0883e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.landing-header p {
  color: #8b949e;
  font-size: 1.05em;
}

.upload-zone {
  border: 2px dashed rgba(48, 54, 61, 0.8);
  border-radius: 16px;
  padding: 70px 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(22, 27, 34, 0.4);
  position: relative;
  overflow: hidden;
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(88, 166, 255, 0.03) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

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

.upload-zone:hover,
.upload-zone.dragover {
  border-color: #58a6ff;
  box-shadow: 0 0 40px rgba(88, 166, 255, 0.08);
  transform: translateY(-1px);
}

.upload-zone.dragover {
  border-color: #3fb950;
  box-shadow: 0 0 40px rgba(63, 185, 80, 0.1);
}

.upload-icon-wrap {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: rgba(88, 166, 255, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.upload-zone.dragover .upload-icon-wrap {
  background: rgba(63, 185, 80, 0.12);
}

.upload-icon {
  font-size: 32px;
  color: #58a6ff;
  transition: all 0.3s;
}

.upload-zone.dragover .upload-icon {
  color: #3fb950;
  transform: translateY(-4px);
}

.upload-zone p {
  color: #8b949e;
  font-size: 0.95em;
}

.upload-zone a {
  color: #58a6ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(22, 27, 34, 0.8);
  border: 1px solid rgba(48, 54, 61, 0.5);
  border-radius: 12px;
  margin-top: 20px;
  animation: slideUp 0.3s ease;
}

.file-preview-icon {
  width: 48px;
  height: 48px;
  background: rgba(88, 166, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

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

.file-preview-name {
  font-weight: 600;
  font-size: 0.95em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-size {
  color: #8b949e;
  font-size: 0.85em;
  margin-top: 2px;
}

.file-preview-remove {
  background: none;
  border: none;
  color: #8b949e;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.file-preview-remove:hover {
  color: #f85149;
  background: rgba(248, 81, 73, 0.1);
}

.upload-options {
  margin-top: 20px;
  padding: 24px;
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid rgba(48, 54, 61, 0.4);
  border-radius: 12px;
  animation: slideUp 0.35s ease;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .option-grid {
    grid-template-columns: 1fr;
  }
}

.option-group label {
  display: block;
  color: #8b949e;
  font-size: 0.85em;
  font-weight: 500;
  margin-bottom: 6px;
}

select, input[type="text"], input[type="password"], input[type="email"], input[type="number"] {
  width: 100%;
  padding: 10px 14px;
  background: #0f1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #e1e4e8;
  font-size: 0.9em;
  transition: border-color 0.2s;
}

select:focus, input:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.option-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.btn {
  padding: 10px 28px;
  border: none;
  border-radius: 8px;
  font-size: 0.93em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, #238636, #2ea043);
  color: #fff;
  box-shadow: 0 1px 8px rgba(35, 134, 54, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(35, 134, 54, 0.35);
}

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

.btn-secondary {
  background: rgba(33, 38, 45, 0.8);
  color: #e1e4e8;
  border: 1px solid rgba(48, 54, 61, 0.5);
}

.btn-secondary:hover {
  background: rgba(48, 54, 61, 0.8);
  border-color: #58a6ff;
}

.btn-danger {
  background: rgba(248, 81, 73, 0.12);
  color: #f85149;
  border: 1px solid rgba(248, 81, 73, 0.25);
}

.btn-danger:hover {
  background: rgba(248, 81, 73, 0.2);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.hidden {
  display: none !important;
}

.progress-area {
  margin-top: 24px;
  animation: fadeIn 0.3s ease;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(33, 38, 45, 0.8);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #58a6ff, #3fb950);
  width: 0%;
  border-radius: 3px;
  transition: width 0.25s ease;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.85em;
  color: #8b949e;
}

.result-card {
  text-align: center;
  padding: 36px 28px;
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid rgba(48, 54, 61, 0.4);
  border-radius: 16px;
  margin-top: 24px;
  animation: scaleIn 0.35s ease;
}

.result-icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  background: rgba(63, 185, 80, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-icon {
  font-size: 28px;
  color: #3fb950;
}

.result-card h3 {
  font-size: 1.05em;
  margin-bottom: 4px;
}

.result-meta {
  color: #8b949e;
  font-size: 0.9em;
  margin-bottom: 20px;
}

.share-link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.share-link-row input {
  flex: 1;
  text-align: center;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.88em;
  background: #0f1117;
  padding: 12px 16px;
}

.share-link-row input:focus {
  border-color: #58a6ff;
}

.share-link-row .btn {
  flex-shrink: 0;
}

.result-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.error-card {
  padding: 16px 20px;
  background: rgba(248, 81, 73, 0.08);
  border: 1px solid rgba(248, 81, 73, 0.25);
  border-radius: 10px;
  color: #f85149;
  margin-top: 20px;
  animation: shake 0.4s ease;
  font-size: 0.92em;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(35, 134, 54, 0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9em;
  font-weight: 500;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  z-index: 200;
  opacity: 0;
  transition: all 0.35s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: rgba(248, 81, 73, 0.95);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(48, 54, 61, 0.6);
  border-top-color: #58a6ff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

.spinner-lg {
  width: 36px;
  height: 36px;
  border-width: 3px;
}

.loading-section {
  text-align: center;
  padding: 48px 0;
}

.loading-section p {
  color: #8b949e;
  margin-top: 12px;
  font-size: 0.9em;
}

.auth-card {
  max-width: 420px;
  margin: 0 auto;
  background: rgba(22, 27, 34, 0.5);
  border: 1px solid rgba(48, 54, 61, 0.4);
  border-radius: 16px;
  padding: 32px;
  animation: fadeIn 0.3s ease;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 4px;
  font-size: 1.3em;
}

.auth-card .subtitle {
  text-align: center;
  margin-bottom: 28px;
  font-size: 0.92em;
}

.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  background: rgba(15, 17, 23, 0.6);
  border-radius: 10px;
  padding: 3px;
}

.tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  color: #8b949e;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s;
}

.tab.active {
  background: #238636;
  color: #fff;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.dashboard-header h2 {
  font-size: 1.4em;
}

.storage-card {
  background: rgba(22, 27, 34, 0.5);
  border: 1px solid rgba(48, 54, 61, 0.4);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.storage-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.storage-card-header span:first-child {
  color: #8b949e;
  font-size: 0.85em;
  font-weight: 500;
}

.storage-card-header span:last-child {
  font-size: 0.88em;
  font-weight: 600;
}

.storage-bar {
  width: 100%;
  height: 6px;
  background: rgba(33, 38, 45, 0.8);
  border-radius: 3px;
  overflow: hidden;
}

.storage-fill {
  height: 100%;
  background: linear-gradient(90deg, #58a6ff, #3fb950);
  border-radius: 3px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.storage-fill.warning {
  background: linear-gradient(90deg, #f0883e, #f85149);
}

.file-grid {
  display: grid;
  gap: 10px;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(22, 27, 34, 0.4);
  border: 1px solid rgba(48, 54, 61, 0.35);
  border-radius: 12px;
  transition: all 0.2s;
  cursor: default;
}

.file-card:hover {
  background: rgba(22, 27, 34, 0.7);
  border-color: rgba(48, 54, 61, 0.6);
}

.file-type-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.file-type-icon.archive { background: rgba(248, 131, 61, 0.12); color: #f0833d; }
.file-type-icon.image  { background: rgba(88, 166, 255, 0.12); color: #58a6ff; }
.file-type-icon.video  { background: rgba(188, 140, 255, 0.12); color: #bc8cff; }
.file-type-icon.pdf    { background: rgba(248, 81, 73, 0.12); color: #f85149; }
.file-type-icon.audio  { background: rgba(63, 185, 80, 0.12); color: #3fb950; }
.file-type-icon.code   { background: rgba(240, 136, 62, 0.12); color: #f0883e; }
.file-type-icon.text   { background: rgba(139, 148, 158, 0.1); color: #8b949e; }
.file-type-icon.default { background: rgba(139, 148, 158, 0.08); color: #8b949e; }

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

.file-item-name {
  font-size: 0.92em;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-meta {
  display: flex;
  gap: 16px;
  font-size: 0.82em;
  color: #8b949e;
  margin-top: 3px;
}

.file-item-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.file-item-actions .btn {
  padding: 7px 14px;
  font-size: 0.82em;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #8b949e;
}

.empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

/* Download page */
.download-card {
  max-width: 480px;
  margin: 20px auto;
  background: rgba(22, 27, 34, 0.5);
  border: 1px solid rgba(48, 54, 61, 0.4);
  border-radius: 20px;
  padding: 48px 32px;
  text-align: center;
  animation: scaleIn 0.35s ease;
}

.download-icon-wrap {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
}

.download-icon-wrap.archive { background: rgba(248, 131, 61, 0.12); color: #f0833d; }
.download-icon-wrap.image  { background: rgba(88, 166, 255, 0.12); color: #58a6ff; }
.download-icon-wrap.video  { background: rgba(188, 140, 255, 0.12); color: #bc8cff; }
.download-icon-wrap.pdf    { background: rgba(248, 81, 73, 0.12); color: #f85149; }
.download-icon-wrap.audio  { background: rgba(63, 185, 80, 0.12); color: #3fb950; }
.download-icon-wrap.code   { background: rgba(240, 136, 62, 0.12); color: #f0883e; }
.download-icon-wrap.default { background: rgba(139, 148, 158, 0.1); color: #8b949e; }

.download-card h2 {
  font-size: 1.2em;
  margin-bottom: 6px;
  word-break: break-word;
}

.download-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 16px 0 28px;
  font-size: 0.85em;
  color: #8b949e;
}

.download-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.download-btn-large {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 48px;
  font-size: 1.05em;
  border-radius: 12px;
  background: linear-gradient(135deg, #238636, #2ea043);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 20px rgba(35, 134, 54, 0.3);
  transition: all 0.25s;
  animation: pulseGlow 2s ease-in-out infinite;
}

.download-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(35, 134, 54, 0.45);
}

.download-password-section {
  margin: 24px 0;
  animation: slideUp 0.3s ease;
}

.download-password-section p {
  margin-bottom: 12px;
  color: #8b949e;
}

.download-password-section .input-group {
  display: flex;
  gap: 8px;
  max-width: 320px;
  margin: 0 auto;
}

.download-password-section input {
  flex: 1;
}

/* Admin page */
.admin-page {
  max-width: 560px;
}

.settings-card {
  background: rgba(22, 27, 34, 0.4);
  border: 1px solid rgba(48, 54, 61, 0.35);
  border-radius: 16px;
  padding: 28px;
}

.setting-row {
  margin-bottom: 22px;
}

.setting-row:last-of-type {
  margin-bottom: 28px;
}

.setting-row label {
  display: block;
  color: #e1e4e8;
  margin-bottom: 6px;
  font-size: 0.9em;
  font-weight: 500;
}

.setting-row input {
  width: 100%;
}

.setting-hint {
  color: #484f58;
  font-size: 0.8em;
  margin-top: 4px;
  line-height: 1.4;
}

#settings-status {
  margin-top: 12px;
  font-size: 0.9em;
  font-weight: 500;
}

#settings-status.success {
  color: #3fb950;
}

#settings-status.error {
  color: #f85149;
}

.error-text {
  color: #f85149;
  font-size: 0.88em;
}

.muted {
  color: #8b949e;
}

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

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

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 2px 20px rgba(35, 134, 54, 0.3); }
  50%      { box-shadow: 0 2px 30px rgba(35, 134, 54, 0.5); }
}

@media (max-width: 600px) {
  .container { padding: 24px 16px 60px; }
  .landing-header h1 { font-size: 1.6em; }
  .upload-zone { padding: 40px 20px; }
  .download-card { padding: 32px 20px; }
  .file-card { flex-wrap: wrap; }
  .file-item-actions { width: 100%; justify-content: flex-end; padding-top: 8px; border-top: 1px solid rgba(48, 54, 61, 0.2); }
  .share-link-row { flex-direction: column; }
  .dashboard-header { flex-direction: column; gap: 8px; }
}
