:root {
  --bg: #07111d;
  --bg-2: #0d1b2d;
  --bg-3: #121d2e;
  --panel: rgba(12, 20, 31, 0.88);
  --panel-soft: rgba(18, 27, 40, 0.84);
  --line: rgba(148, 163, 184, 0.16);
  --text: #edf6ff;
  --muted: #9db2c9;
  --primary: #66f1da;
  --primary-strong: #1ec8b6;
  --secondary: #6ea8ff;
  --warning: #f7c55d;
  --danger: #ff7b7b;
  --shadow: 0 28px 64px rgba(2, 6, 23, 0.54);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(102, 241, 218, 0.18), transparent 18%),
    radial-gradient(circle at right center, rgba(110, 168, 255, 0.14), transparent 20%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 42%, var(--bg-3) 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

button,
input,
a {
  font: inherit;
}

button,
input {
  border-radius: 12px;
}

input {
  background: rgba(13, 20, 31, 0.9);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 12px 14px;
  outline: none;
}

input:focus {
  border-color: rgba(94, 234, 212, 0.75);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.12);
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-shell {
  width: min(100%, 430px);
}

.login-card,
.panel,
.modal-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(11, 18, 28, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel {
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(102, 241, 218, 0.1), transparent 65%);
  pointer-events: none;
}

.login-card {
  padding: 32px 28px;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 700;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 3vw, 2.5rem);
}

.subtitle {
  color: var(--muted);
  margin-bottom: 24px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field span {
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.alert-box {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fecaca;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.primary-button,
.secondary-button,
.ghost-button,
.logout-button,
.copy-link,
.delete-button,
.close-button {
  border: none;
  border-radius: 12px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.primary-button,
.copy-link {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #042d2a;
  font-weight: 800;
  padding: 12px 18px;
  width: 100%;
  box-shadow: 0 12px 24px rgba(30, 200, 182, 0.22);
}

.secondary-button {
  background: linear-gradient(180deg, rgba(110, 168, 255, 0.14), rgba(110, 168, 255, 0.06));
  color: var(--text);
  border: 1px solid rgba(110, 168, 255, 0.22);
  padding: 11px 14px;
  min-width: 110px;
}

.ghost-button,
.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.04);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 10px 15px;
  text-decoration: none;
}

.logout-button {
  background: rgba(255, 123, 123, 0.06);
  border-color: rgba(255, 123, 123, 0.18);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.logout-button:hover,
.copy-link:hover,
.delete-button:hover,
.close-button:hover {
  transform: translateY(-1px);
}

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 6px 0 2px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 0 18px rgba(102, 241, 218, 0.9);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.sidebar {
  padding: 18px;
  position: sticky;
  top: 20px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.sidebar-header h3 {
  margin: 6px 0 0;
}

.folder-action-button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(94, 234, 212, 0.2);
  border-radius: 10px;
  background: rgba(94, 234, 212, 0.08);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
}

.folder-tree {
  display: grid;
  gap: 6px;
  max-height: 70vh;
  overflow: auto;
}

.tree-entry {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tree-node {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px calc(10px + (var(--tree-depth, 0) * 14px));
  border-radius: 10px;
  color: var(--muted);
  border: 1px solid transparent;
}

.tree-node.active,
.tree-node:hover {
  background: rgba(94, 234, 212, 0.08);
  border-color: rgba(94, 234, 212, 0.18);
  color: var(--text);
}

.root-node {
  --tree-depth: 0;
}

.folder-delete-form {
  display: flex;
}

.folder-delete-button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 123, 123, 0.2);
  background: rgba(255, 123, 123, 0.08);
  color: #fecaca;
  border-radius: 8px;
  font-size: 1rem;
}

.tree-icon {
  color: var(--warning);
}

.main-column {
  display: grid;
  gap: 22px;
}

.hero-panel,
.browser-panel {
  padding: 22px;
}

.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.hero-header h2 {
  margin: 6px 0 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.stat-badge {
  background: rgba(94, 234, 212, 0.1);
  border: 1px solid rgba(94, 234, 212, 0.22);
  color: var(--primary);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.stats-panel {
  display: grid;
  gap: 14px;
}

.metric-block {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(17, 25, 36, 0.7);
}

.metric-block span {
  color: var(--muted);
  font-size: 0.8rem;
}

.metric-block strong {
  font-size: 0.98rem;
  word-break: break-word;
}

.upload-form {
  display: grid;
  gap: 12px;
}

.upload-form-wide {
  max-width: 100%;
}

.upload-progress {
  display: grid;
  gap: 8px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(10, 17, 27, 0.81));
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.05), 0 10px 22px rgba(3, 7, 18, 0.25);
}

.upload-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.72rem;
}

.upload-progress-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 12px rgba(94, 234, 212, 0.7);
  animation: pulse 1.3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

.upload-progress-head strong {
  color: var(--text);
  font-size: 0.8rem;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.2);
  transition: width 0.18s ease;
  position: relative;
}

.progress-bar span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.upload-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.72rem;
}

.cancel-upload-button {
  align-self: flex-end;
  border: 1px solid rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.cancel-upload-button:hover {
  background: rgba(248, 113, 113, 0.14);
}

.cancel-upload-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.inline-field {
  margin-bottom: 0;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row input {
  flex: 1;
}

.browser-header {
  margin-bottom: 16px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
}

.crumb {
  color: var(--muted);
}

.crumb.current {
  color: var(--text);
  font-weight: 700;
}

.crumb-separator {
  color: rgba(154, 176, 199, 0.8);
}

.directory-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.directory-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(14, 22, 31, 0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
}

.folder-icon {
  color: var(--warning);
}

.file-list {
  display: grid;
  gap: 10px;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(12, 18, 28, 0.72), rgba(12, 18, 28, 0.85));
  border: 1px solid rgba(148, 163, 184, 0.12);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.file-row:hover {
  border-color: rgba(102, 241, 218, 0.22);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.file-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.file-text {
  min-width: 0;
}

.file-name {
  font-weight: 600;
  word-break: break-word;
  line-height: 1.35;
}

.file-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.file-type.small {
  min-width: 42px;
  padding: 5px 8px;
  font-size: 0.64rem;
}

.file-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.downloads-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.18);
  color: var(--muted);
  font-size: 0.75rem;
}

.downloads-indicator strong {
  color: var(--text);
}

.download-popover {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(8, 15, 24, 0.96);
  border: 1px solid rgba(96, 165, 250, 0.24);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.35);
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.78rem;
}

.close-popover {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
}

.popover-actions {
  display: flex;
  gap: 8px;
}

.popover-download,
.popover-copy,
.popover-generate,
.share-disable-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(94, 234, 212, 0.18);
  padding: 9px 10px;
  background: rgba(94, 234, 212, 0.08);
  color: var(--text);
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.popover-copy,
.popover-generate {
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.2);
}

.share-link-wrap {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.share-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--muted);
}

.share-status.active {
  color: var(--primary);
}

.share-preview {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(12, 18, 28, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.1);
  overflow-wrap: anywhere;
}

.share-preview a {
  color: var(--text);
  text-decoration: underline;
}

.share-form {
  display: grid;
  gap: 8px;
}

.share-form input {
  width: 100%;
}

.share-disable-form {
  margin-top: 2px;
}

.share-disable-button {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

.file-actions.compact {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(94, 234, 212, 0.2);
  background: rgba(94, 234, 212, 0.08);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.inline-share-button:hover {
  transform: translateY(-1px);
}

.file-actions.compact form {
  display: flex;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(148, 163, 184, 0.05);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(102, 241, 218, 0.2);
}

.copy-link {
  background: rgba(94, 234, 212, 0.12);
  border-color: rgba(94, 234, 212, 0.2);
}

.logs-button {
  background: rgba(148, 163, 184, 0.08);
}

.delete-button {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.22);
  color: #fecaca;
}

.logs-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.log-entry {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(12, 18, 28, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.log-entry span,
.log-entry small {
  color: var(--muted);
}

.log-entry strong {
  color: var(--text);
}

.empty-state,
.empty-inline {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(12, 18, 28, 0.35);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.72);
  padding: 18px;
}

.hidden {
  display: none;
}

.modal-card {
  width: min(100%, 540px);
  padding: 22px;
}

.delete-warning {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.delete-warning strong {
  color: var(--text);
}

.delete-actions {
  display: flex;
  gap: 12px;
}

.danger-button {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid rgba(255, 123, 123, 0.24);
  border-radius: 12px;
  background: rgba(255, 123, 123, 0.12);
  color: #fecaca;
  font-weight: 700;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-header h3 {
  margin: 0;
}

.close-button {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  width: 34px;
  height: 34px;
  font-size: 1.4rem;
}

.settings-form {
  display: grid;
  gap: 10px;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .input-row {
    flex-direction: column;
  }
}
