/* VideoFolder - minimal, sade admin/watch UI
   Motion pattern used: fade-up reveal on load (signature move),
   HOVER-LIFT on cards/rows, subtle micro-interactions on buttons.
   All motion respects prefers-reduced-motion (see bottom of file). */

:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --dur-micro: 200ms;
  --dur-reveal: 500ms;
  --reveal-y: 20px;

  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e4e6ea;
  --text: #1c1f24;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --success-bg: #ecfdf5;
  --success-text: #047857;
  --error-bg: #fef2f2;
  --error-text: #b91c1c;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

h1, h2 { line-height: 1.25; margin: 0 0 0.5rem; }
h2 { font-size: 1.1rem; margin-top: 2rem; }
p { margin: 0.25rem 0; }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---- Layout helpers ---- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* ---- Cards ---- */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform var(--dur-micro) var(--ease-out-quart);
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  box-shadow: 0 12px 28px rgba(20, 20, 30, 0.08);
  opacity: 0;
  transition: opacity var(--dur-micro) var(--ease-out-quart);
}

.login-card { width: 100%; max-width: 360px; }

/* ---- Forms ---- */

.field { margin-bottom: 1rem; }
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color var(--dur-micro) var(--ease-out-quart);
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
}

.upload-form { margin-top: 0.5rem; }

/* ---- Upload progress ---- */

.upload-progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

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

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: inherit;
  /* Functional indicator, not decorative - short transition just smooths
     the jump between progress events (still a cheap transform-adjacent
     property change, kept well under micro-interaction timing). */
  transition: width 150ms var(--ease-out-quart);
}

#uploadProgressText { min-width: 3.5em; text-align: right; }

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out-quart),
              transform var(--dur-micro) var(--ease-out-quart);
}

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

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: #f0f1f3; }

.btn-danger { background: var(--error-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-small { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

/* ---- Alerts ---- */

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--error-bg); color: var(--error-text); }

/* ---- Video list ---- */

.video-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }

.video-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}

.video-row:hover { transform: translateY(-2px); }
.video-row:hover::after { opacity: 1; }

.video-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 200px; }

.video-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.share-input {
  width: 220px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg);
}

.video-actions form { margin: 0; display: inline; }

/* ---- Watch page ---- */

.container.watch-page {
  max-width: 1200px;
}

.watch-page h1 { font-size: 1.35rem; }

.video-wrapper {
  margin: 1rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.video-wrapper video {
  display: block;
  width: 100%;
  height: 85vh;
  max-height: 85vh;
  object-fit: contain;
  background: #000;
}

@media (max-width: 700px) {
  .video-wrapper video { height: auto; max-height: 60vh; }
}

/* ---- Motion: fade-up reveal on load (signature move) ---- */

.reveal {
  animation: fade-up var(--dur-reveal) var(--ease-out-expo) both;
}

.reveal:nth-of-type(2) { animation-delay: 60ms; }
.reveal:nth-of-type(3) { animation-delay: 120ms; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(var(--reveal-y)); }
  to   { opacity: 1; transform: none; }
}

/* Mandatory reduced-motion guard */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 560px) {
  .video-row { flex-direction: column; align-items: stretch; }
  .share-input { width: 100%; }
}
