/* ============================================================ */
/* DESIGN SYSTEM */
/* ============================================================ */
:root {
  /*DARK THEME (default) - rose dominant*/
  --bg-main: #0a0a0a;
  --bg-surface: #111111;
  --text-main: #f0f0f2;
  --text-muted: rgba(255, 255, 255, 0.45);
  --border: rgba(255, 255, 255, 0.08);
  --color-primary: #f43f5e;
  --color-primary-light: #fb7185;
  --color-primary-dark: #e11d48;
  --blob-a: rgba(244, 63, 94, 0.12);
  --blob-b: rgba(255, 255, 255, 0.04);
  --btn-bg: #ffffff;
  --btn-text: #0a0a0a;
  --input-bg: rgba(255, 255, 255, 0.03);
  --input-border: rgba(255, 255, 255, 0.08);
  --input-focus-bg: rgba(255, 255, 255, 0.05);
  --input-focus-border: rgba(255, 255, 255, 0.2);
  --line-accent: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
  --radius: 8px;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --grain-opacity: 0.35;
  --grain-scale: 1;
  --color-success: #4caf50;
  --color-info: #69b4ff;
  --color-error: #ef4444;
}

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

html { font-size: 15px; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
}

/* ============================================================ */
/* BACKGROUND BLOBS */
/* ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 15% 15%, var(--blob-a) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 85%, var(--blob-b) 0%, transparent 55%);
}

/* ============================================================ */
/* LAYOUT */
/* ============================================================ */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================================ */
/* NAV */
/* ============================================================ */
.nav {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav-link:hover { color: var(--text-main); }
.nav-link.active { color: var(--text-main); }

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================================================ */
/* MAIN CONTENT */
/* ============================================================ */
.main {
  flex: 1;
  padding: var(--space-lg);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================ */
/* BUTTONS */
/* ============================================================ */
.btn {
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  font-weight: 600;
  padding: 0.5rem 1.2rem;
}

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

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-danger {
  color: var(--color-error);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  border-color: var(--color-error);
}

.btn-success {
  color: var(--color-success);
  border-color: rgba(76, 175, 80, 0.3);
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
}

/* ============================================================ */
/* SECTION HEADERS */
/* ============================================================ */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

/* ============================================================ */
/* CARDS */
/* ============================================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
}

/* ============================================================ */
/* VIDEO GRID */
/* ============================================================ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.video-card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}

.video-card:hover { border-color: rgba(255, 255, 255, 0.15); }

.video-thumb {
  width: 100%;
  aspect-ratio: 9/16;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: var(--space-sm);
}

.video-info {
  padding: var(--space-sm);
}

.video-title {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 6px;
  word-break: break-word;
}

.video-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.video-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.ready { background: var(--color-success); }
.status-dot.published { background: var(--color-info); }

.btn-publish {
  width: 100%;
  padding: 10px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-publish:hover { opacity: 0.85; }

.btn-publish:disabled {
  background: var(--bg-main);
  color: var(--text-muted);
  cursor: default;
  opacity: 1;
}

.btn-publish.published {
  background: var(--bg-main);
  color: var(--color-info);
  cursor: default;
}

/* ============================================================ */
/* STATUS BAR */
/* ============================================================ */
.status-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-lg);
  font-size: 0.85rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================ */
/* EMPTY STATE */
/* ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================================ */
/* AUTH PAGE */
/* ============================================================ */
.auth-page {
  flex: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-blobs {
  position: fixed;
  inset: -50%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 20%, var(--blob-a) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, var(--blob-b) 0%, transparent 50%);
  animation: blob-drift 12s ease-in-out infinite alternate;
}

@keyframes blob-drift {
  0% { transform: translate(-18%, -18%) rotate(0deg); }
  100% { transform: translate(18%, 18%) rotate(5deg); }
}

.auth-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background:
    radial-gradient(ellipse at 20% 20%, var(--blob-a) 0%, transparent 100%),
    radial-gradient(ellipse at 80% 80%, var(--blob-b) 0%, transparent 100%);
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  mask-size: calc(512px * var(--grain-scale));
  mask-repeat: repeat;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  -webkit-mask-size: calc(512px * var(--grain-scale));
  -webkit-mask-repeat: repeat;
}

.auth-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  padding: 45px;
}

.auth-topline {
  position: absolute;
  top: 0;
  left: 45px;
  right: 45px;
  height: 1px;
  background: var(--line-accent);
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 35px;
}

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

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-label {
  font-size: 13px;
  color: var(--text-muted);
}

.auth-input {
  width: 100%;
  padding: 15px 18px;
  font-size: 15px;
  font-family: inherit;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  color: var(--text-main);
  outline: none;
  transition: background 0.3s, border-color 0.3s;
}

.auth-input:focus {
  background: var(--input-focus-bg);
  border-color: var(--input-focus-border);
}

.auth-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.auth-btn {
  width: 100%;
  padding: 15px;
  margin-top: 8px;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

.auth-btn:hover:not(:disabled) { opacity: 0.85; }
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-buttons {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.auth-buttons .auth-btn { flex: 1; margin-top: 0; }

.auth-btn-google {
  padding: 15px 20px;
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
}

.auth-btn-google:hover { border-color: var(--input-focus-border); }

.auth-error {
  font-size: 13px;
  color: var(--color-error);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 30px 0 20px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  padding: 0 15px;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.6;
}

.auth-switch {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-switch button {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

.auth-switch button:hover { opacity: 0.7; }

/* ============================================================ */
/* FOOTER */
/* ============================================================ */
.footer {
  padding: var(--space-md);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer a:hover { color: var(--text-main); }
