@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&family=Nunito+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #FFFFFF;
  --surface: #F7F4FF;
  --surface-2: #EEE8FF;
  --border: rgba(140,80,220,.15);
  --border-2: rgba(140,80,220,.25);
  --text: #2D1B5E;
  --muted: #8A7BAD;
  --accent: #C84FD8;       /* violet rose vif */
  --accent-2: #FF6BB5;     /* rose chaud */
  --accent-3: #FFC93C;     /* jaune soleil */
  --accent-4: #36D6C8;     /* turquoise */
  --accent-5: #FF7043;     /* orange */
  --accent-glow: rgba(200,79,216,.22);
  --good: #2EC59A;
  --warn: #FFC93C;
  --bad: #FF5B6B;
  --shadow-soft: 0 4px 20px rgba(120,60,200,.12);
  --shadow-card: 0 8px 32px rgba(120,60,200,.14);
  --radius-card: 28px;
  --radius-btn: 18px;
  --radius-sm: 14px;
  --nav-h: 82px;
  --top-h: 80px;
  --font-head: 'Nunito', sans-serif;
  --font-body: 'Nunito Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #F0EBFF;
  color: var(--text);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea {
  width: 100%;
  border: 2px solid var(--border-2);
  background: white;
  color: var(--text);
  border-radius: var(--radius-btn);
  padding: 13px 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,79,216,.12);
}
textarea { resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); font-size: .88rem; font-weight: 700; }
.hidden { display: none !important; }

/* ─── APP SHELL ─────────────────────────────── */
.app-shell {
  position: relative;
  height: 100dvh;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  border-inline: 1px solid rgba(140,80,220,.1);
  box-shadow: 0 0 60px rgba(120,60,200,.08);
}

/* ─── TOPBAR ─────────────────────────────────── */
.topbar {
  position: absolute;
  left: 0; right: 0; top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: #FFFFFF;
  border-bottom: 2px solid rgba(200,79,216,.1);
  box-shadow: 0 2px 16px rgba(120,60,200,.08);
}
.brand { display: flex; align-items: center; }
.brand-logo-img {
  height: 54px;
  width: auto;
  object-fit: contain;
  display: block;
}

.top-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: var(--surface);
  border: 2px solid var(--border-2);
  display: grid; place-items: center;
  font-size: 1.1rem;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn.filled {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* ─── SCREENS ────────────────────────────────── */
.screen {
  position: absolute; inset: 0;
  padding-top: var(--top-h);
  padding-bottom: var(--nav-h);
  display: none;
}
.screen.active { display: block; }

/* ─── VIDEO FEED ─────────────────────────────── */
.video-stage {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  background: #F0EBFF;
}
.video-stage::-webkit-scrollbar { display: none; }

.video-card {
  position: relative;
  height: calc(100dvh - var(--top-h) - var(--nav-h));
  min-height: 500px;
  scroll-snap-align: start;
  margin: 10px 10px 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #111;
  border: 3px solid white;
  box-shadow: var(--shadow-card);
}
.video-card iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none; background: #000;
}

/* Overlay gradient — léger, fond clair */
.video-overlay {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.08) 0%,
    rgba(0,0,0,0) 25%,
    rgba(0,0,0,0) 55%,
    rgba(0,0,0,.72) 100%
  );
  pointer-events: none;
}
.video-overlay > * { pointer-events: auto; }

.video-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.side-actions { display: grid; gap: 8px; }
.side-btn {
  width: 46px; height: 46px;
  border-radius: 15px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border: none;
  display: grid; place-items: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  transition: transform .12s, box-shadow .12s;
}
.side-btn:active { transform: scale(.88); }
.side-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px var(--accent-glow);
}

.video-bottom { display: flex; flex-direction: column; gap: 5px; max-width: 74%; }

.video-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.9);
  color: var(--accent);
  font-size: .78rem; font-weight: 800;
  font-family: var(--font-head);
  width: fit-content;
  text-transform: capitalize;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.video-title {
  font-family: var(--font-head);
  font-size: 1rem; font-weight: 900;
  line-height: 1.2; margin: 0;
  color: #fff;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.video-channel {
  font-size: .8rem; color: rgba(255,255,255,.8);
  font-weight: 700; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}

.feed-status {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  padding: 12px 20px;
  border-radius: 20px;
  background: white;
  border: 2px solid var(--border-2);
  font-weight: 700; font-size: .9rem;
  color: var(--accent);
  box-shadow: var(--shadow-soft);
}

/* ─── BOTTOM NAV ─────────────────────────────── */
.bottom-nav {
  position: absolute;
  left: 10px; right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 5px;
  padding: 6px;
  border-radius: 24px;
  background: #FFFFFF;
  border: 2px solid rgba(200,79,216,.15);
  z-index: 30;
  box-shadow: 0 4px 24px rgba(120,60,200,.14);
}
.nav-btn {
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  padding: 9px 6px;
  border-radius: 18px;
  color: var(--muted);
  font-weight: 800; font-size: .72rem;
  font-family: var(--font-head);
  transition: color .15s, background .15s, transform .12s;
}
.nav-btn .nav-icon { font-size: 1.2rem; line-height: 1; }
.nav-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.nav-btn:active { transform: scale(.93); }

/* ─── PANEL SCREENS ──────────────────────────── */
.panel-screen, .parent-screen {
  height: 100%; overflow-y: auto; padding: 16px;
  background: var(--bg);
}
.panel-screen::-webkit-scrollbar, .parent-screen::-webkit-scrollbar { display: none; }

.panel-head { margin-bottom: 14px; }
.panel-head h2, .parent-header h2 {
  margin: 0; font-family: var(--font-head);
  font-size: 1.55rem; font-weight: 900; color: var(--text);
}
.panel-head p, .parent-header p { margin: 4px 0 0; color: var(--muted); font-size: .86rem; }
.eyebrow { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.panel-grid { display: grid; gap: 10px; margin-top: 4px; }

/* Mini cards */
.card-mini {
  display: grid; grid-template-columns: 96px 1fr;
  gap: 12px; padding: 12px;
  border-radius: 20px;
  background: white;
  border: 2px solid var(--border);
  align-items: center;
  box-shadow: var(--shadow-soft);
  transition: box-shadow .15s;
}
.card-mini img {
  width: 96px; height: 64px;
  object-fit: cover; border-radius: 12px;
  background: var(--surface-2);
}
.card-mini h3 {
  margin: 0 0 3px; font-family: var(--font-head);
  font-size: .92rem; font-weight: 800; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-mini p { margin: 0; color: var(--muted); font-size: .8rem; }
.card-mini a { color: var(--accent); text-decoration: none; font-weight: 800; }

/* Glass cards → light cards */
.glass-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

/* ─── PARENT SCREEN ──────────────────────────── */
.parent-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 14px; gap: 12px;
}
.auth-panel, .dashboard { display: grid; gap: 12px; }
.auth-switch, .dashboard-tabs {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px;
}
.auth-switch::-webkit-scrollbar, .dashboard-tabs::-webkit-scrollbar { display: none; }

.switch-btn, .tab-btn, .ghost-btn {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--muted); font-weight: 800;
  font-family: var(--font-head); font-size: .86rem;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.switch-btn.active, .tab-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: white;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.ghost-btn:hover { background: var(--surface-2); }

.stack-form, .stack-card { display: grid; gap: 12px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.primary-btn {
  padding: 15px 18px; border-radius: var(--radius-btn);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 900; font-family: var(--font-head);
  color: white; font-size: 1rem;
  box-shadow: 0 6px 20px var(--accent-glow);
  transition: opacity .15s, transform .12s;
}
.primary-btn:active { opacity: .88; transform: scale(.97); }

.toggle-line { display: flex; align-items: center; gap: 10px; }
.toggle-line input { width: auto; }

.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--border);
  font-weight: 800; font-family: var(--font-head); font-size: .84rem;
  color: var(--text); transition: all .15s;
}
.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: white;
}

/* Submissions */
.submission-list { display: grid; gap: 10px; }
.row-between, .inline-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-pill { padding: 5px 12px; border-radius: 999px; font-size: .78rem; font-weight: 900; font-family: var(--font-head); }
.status-pending  { background: rgba(255,201,60,.18); color: #B78000; }
.status-approved { background: rgba(46,197,154,.18); color: #1A8A6A; }
.status-rejected { background: rgba(255,91,107,.18); color: #CC2233; }

/* ─── SEARCH SHEET ───────────────────────────── */
.sheet {
  position: fixed; inset: 0;
  display: grid; place-items: end center;
  padding: 10px;
  background: rgba(100,60,180,.2);
  z-index: 70;
  backdrop-filter: blur(6px);
}
.sheet-card {
  width: min(430px,100%);
  padding: 20px;
  border-radius: 28px 28px 20px 20px;
  background: white;
  border: 2px solid var(--border-2);
  box-shadow: 0 -8px 40px rgba(120,60,200,.18);
}
.sheet-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.sheet-head h3 { margin: 0; font-family: var(--font-head); font-size: 1.2rem; font-weight: 900; color: var(--text); }
.compact { padding: 0; }

/* ─── TOAST ──────────────────────────────────── */
.toast {
  position: fixed; top: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(90vw,380px);
  padding: 12px 18px;
  border-radius: 16px;
  background: white;
  border: 2px solid var(--border-2);
  box-shadow: 0 8px 28px rgba(120,60,200,.2);
  font-weight: 800; font-size: .9rem; color: var(--text);
  white-space: nowrap;
}

/* ─── EMPTY STATE ────────────────────────────── */
.empty-state {
  padding: 24px 18px; border-radius: 20px;
  background: var(--surface);
  border: 2px dashed var(--border-2);
  text-align: center; color: var(--muted);
  font-weight: 700; font-size: .9rem;
}

.field-title { font-size: .86rem; color: var(--muted); font-weight: 800; margin-bottom: 8px; }

/* ─── DESKTOP ────────────────────────────────── */
@media (min-width: 640px) {
  body { padding: 16px; display: grid; place-items: center; min-height: 100vh; background: #E8DEFF; }
  .app-shell {
    height: calc(100dvh - 32px);
    border-radius: 44px;
    border: 2px solid rgba(200,79,216,.2);
    box-shadow: 0 32px 80px rgba(120,60,200,.2);
  }
  .video-card { height: calc(100dvh - 200px); }
}
