/* vidshare — shared styles */

:root {
  --bg: #fafafa;
  --panel: #ffffff;
  --panel-dark: #111111;
  --text: #111111;
  --muted: #666666;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --accent: #111111;
  --accent-text: #ffffff;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --ok-border: #bbf7d0;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --panel: #141414;
    --panel-dark: #141414;
    --text: #ededed;
    --muted: #888888;
    --border: #262626;
    --border-strong: #333333;
    --accent: #ededed;
    --accent-text: #111111;
    --danger: #f87171;
    --danger-bg: #1f1212;
    --danger-border: #4a2020;
    --ok: #4ade80;
    --ok-bg: #101f14;
    --ok-border: #1e4028;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "SF Pro Text", Inter, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.container.wide {
  max-width: 1000px;
}

main {
  flex: 1;
  width: 100%;
  padding: 40px 0 64px;
}

/* Header */

.site-header {
  padding: 24px 0 8px;
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand img {
  width: 26px;
  height: 26px;
  display: block;
}

/* Hero */

.hero {
  text-align: center;
  padding: 40px 0 32px;
}

.hero h1 {
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 12px;
}

.hero p {
  color: var(--muted);
  font-size: 17px;
  margin: 0;
}

/* Cards */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card + .card {
  margin-top: 20px;
}

.card h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

/* Drop zone */

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 64px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease,
    transform 0.15s ease;
  outline: none;
}

.dropzone:hover {
  border-color: var(--muted);
}

.dropzone:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(127, 127, 127, 0.25);
}

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--bg);
  transform: scale(1.01);
}

.dropzone .dz-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone .dz-icon svg {
  width: 22px;
  height: 22px;
}

.dropzone .dz-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 4px;
}

.dropzone .dz-sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    opacity 0.15s ease, transform 0.06s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--border-strong);
  background: var(--bg);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(127, 127, 127, 0.35);
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.btn.primary:hover {
  opacity: 0.85;
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.btn.danger:hover {
  opacity: 0.85;
}

.btn.small {
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Progress */

.progress-wrap {
  margin-top: 4px;
}

.progress-name {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-track {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.15s ease;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* Link rows / success card */

.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.link-box {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 9px 12px;
  font-size: 14px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0 0;
}

.hint a {
  color: inherit;
}

.hint.warn {
  color: var(--danger);
}

/* Notices */

.notice {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-top: 14px;
}

.notice.error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.notice.ok {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  color: var(--ok);
}

/* Uploads list */

.uploads-section {
  margin-top: 40px;
}

.uploads-section h2 {
  font-size: 15px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}

.upload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.15s ease;
}

.upload-item:hover {
  border-color: var(--border-strong);
}

.upload-item + .upload-item {
  margin-top: 10px;
}

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

.upload-item .name {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-item .date {
  color: var(--muted);
  font-size: 13px;
}

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

/* Watch page */

.video-panel {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  line-height: 0;
}

.video-panel video {
  width: 100%;
  max-height: 78vh;
  display: block;
  background: #000;
}

.watch-title {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 20px 0 4px;
  overflow-wrap: anywhere;
}

.meta-line {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 18px;
  font-variant-numeric: tabular-nums;
}

.watch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

/* Spinner */

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.center-card {
  text-align: center;
  padding: 48px 24px;
}

.center-card h2 {
  margin-bottom: 6px;
}

.center-card p {
  color: var(--muted);
  margin: 0;
}

/* Forms */

.form-field {
  margin-bottom: 14px;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field textarea {
  resize: vertical;
  min-height: 90px;
}

.form-field input:focus-visible,
.form-field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(127, 127, 127, 0.2);
}

/* Footer */

.site-footer {
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  text-decoration: none;
}

/* Utility */

.hidden {
  display: none !important;
}

@media (max-width: 560px) {
  .upload-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .link-row {
    flex-wrap: wrap;
  }

  .link-box {
    flex-basis: 100%;
  }

  .dropzone {
    padding: 44px 16px;
  }
}
