:root {
  --purple: #4B2E9E;
  --purple-deep: #3A2280;
  --pink: #E0399F;
  --pink-deep: #C22A88;
  --green: #22C55E;
  --green-deep: #178A44;
  --red: #E24C4C;
  --ink: #211A3A;
  --ink-soft: #8A83A6;
  --bg: #FFFFFF;
  --card-shade: #F4F2FA;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body { background: #E9E6F3; color: var(--ink); }

.app-shell {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.08);
}

.screen { min-height: 100vh; padding-bottom: 100px; position: relative; }

/* --- Tab bar --- */
.tab-bar { display: flex; align-items: center; gap: 18px; padding: 22px 20px 14px; }
.tab-bar .tabs { display: flex; gap: 18px; flex: 1; }
.tab-bar button.tab { background: none; border: none; font-size: 15px; font-weight: 600; color: #C7C2DA; padding: 0; cursor: pointer; }
.tab-bar button.tab.active.projects { color: var(--purple); }
.tab-bar button.tab.active.training { color: var(--pink); }
.tab-bar button.tab.active.skills { color: var(--green); }

.auth-btn {
  border: none; background: var(--card-shade); color: var(--ink-soft);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px;
}
.auth-btn.logged-in { background: var(--green); color: white; }

/* --- Header (detail pages / form) --- */
.detail-header { padding: 40px 20px 26px; border-radius: 0 0 28px 28px; color: white; position: relative; }
.detail-header.purple { background: var(--purple); }
.detail-header.pink { background: var(--pink); }
.back-btn {
  position: absolute; top: 20px; left: 16px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.18); border: none; color: white; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.check-btn {
  position: absolute; top: 20px; right: 16px; width: 36px; height: 36px; border-radius: 50%;
  background: white; border: none; color: var(--green-deep); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.header-input {
  background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,0.4);
  color: white; font-size: 24px; font-weight: 700; width: 100%; padding: 4px 0; margin-top: 6px;
}
.header-input::placeholder { color: rgba(255,255,255,0.6); }
.header-input:read-only { border-bottom-color: transparent; opacity: 0.9; }
.header-subinput {
  background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.9); font-size: 14px; width: 100%; padding: 4px 0; margin-top: 6px;
}
.header-subinput:read-only { border-bottom-color: transparent; }

/* --- List --- */
.list { padding: 6px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.swipe-row { position: relative; border-radius: 14px; overflow: hidden; }
.swipe-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; }
.swipe-actions button { width: 56px; border: none; color: white; font-size: 16px; cursor: pointer; }
.swipe-actions .edit { background: var(--green-deep); }
.swipe-actions .delete { background: var(--red); }
.swipe-fg {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  color: white; touch-action: pan-y; cursor: pointer;
}
.swipe-fg.purple { background: var(--purple); }
.swipe-fg.pink { background: var(--pink); }
.swipe-fg .title { font-weight: 700; font-size: 15px; }
.swipe-fg .subtitle { font-size: 12px; opacity: 0.8; margin-top: 2px; }

.skill-row-fg { background: var(--purple-deep); }
.skill-icon {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  flex-shrink: 0; overflow: hidden; cursor: grab; user-select: none;
}
.skill-icon img { width: 100%; height: 100%; object-fit: cover; }
.skill-trailing { margin-left: auto; font-size: 16px; opacity: 0.85; }

/* --- Floating add button --- */
.fab {
  position: fixed; bottom: 28px; right: 24px; width: 52px; height: 52px; border-radius: 50%;
  background: var(--green); color: white; font-size: 26px; border: none;
  box-shadow: 0 6px 18px rgba(34,197,94,0.5); cursor: pointer;
  display: flex; align-items: center; justify-content: center; z-index: 20;
}

/* --- Circle delete (bottom-left, detail pages) --- */
.circle-delete {
  position: fixed; bottom: 28px; left: 24px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--purple-deep); color: white; border: none; font-size: 18px; cursor: pointer; z-index: 20;
}
.circle-delete.pink { background: var(--pink-deep); }

/* --- Modal --- */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,15,40,0.55); display: flex; align-items: flex-end; z-index: 50; }
.modal-sheet {
  background: white; width: 100%; max-width: 430px; margin: 0 auto;
  border-radius: 22px 22px 0 0; max-height: 80vh; overflow-y: auto; padding: 20px;
}
.modal-sheet h3 { margin: 0 0 14px; }
.modal-close { float: right; border: none; background: var(--card-shade); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.picker-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--card-shade); }
.picker-row .name { font-weight: 600; font-size: 14px; }
.picker-row .meta { font-size: 12px; color: var(--ink-soft); }

/* --- Video modal --- */
.video-overlay { position: fixed; inset: 0; background: black; display: flex; flex-direction: column; z-index: 60; }
.video-overlay video { width: 100%; flex: 1; object-fit: contain; background: black; }
.video-close {
  position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.2); color: white; border: none; font-size: 16px; cursor: pointer; z-index: 61;
}

/* --- Form --- */
.form-body { padding: 20px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--purple); margin-bottom: 6px; }
.field input[type=text], .field input[type=password], .field select {
  width: 100%; border: none; border-bottom: 2px solid var(--card-shade); padding: 8px 2px; font-size: 15px; background: transparent;
}
.field input:focus, .field select:focus { outline: none; border-bottom-color: var(--purple); }
.field input:read-only { color: var(--ink-soft); }

.upload-video-btn {
  width: 100%; border: 2px dashed var(--card-shade); border-radius: 14px; padding: 22px; background: none;
  color: var(--purple); font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px;
}

.photo-strip { display: flex; gap: 10px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 4px; }
.photo-thumb { width: 64px; height: 64px; border-radius: 12px; background: var(--purple-deep); flex-shrink: 0; overflow: hidden; position: relative; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .rm {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: white; border: none; font-size: 10px; line-height: 1; cursor: pointer;
}
.scrubber-wrap { margin-bottom: 16px; }
.scrubber-wrap input[type=range] { width: 100%; }
.capture-btn { width: 100%; padding: 12px; border-radius: 12px; border: none; background: var(--purple); color: white; font-weight: 700; cursor: pointer; }
.capture-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.empty-state { text-align: center; color: var(--ink-soft); padding: 60px 30px; font-size: 14px; }
.login-error { color: var(--red); font-size: 13px; margin-top: 8px; }
.login-submit { width: 100%; padding: 12px; border-radius: 12px; border: none; background: var(--purple); color: white; font-weight: 700; cursor: pointer; margin-top: 6px; }
.login-note { font-size: 12px; color: var(--ink-soft); margin-top: 14px; text-align: center; }
