/* ============================================================
   CreatorIn — Design System v2.0
   Light-first. Professional. LinkedIn-inspired.
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── CSS Custom Properties: Light Theme (default) ── */
:root {
  /* Colors */
  --primary:        #7C3AED;
  --primary-hover:  #6D28D9;
  --primary-light:  #EDE9FE;
  --primary-mid:    #DDD6FE;

  /* Backgrounds */
  --bg:             #F8FAFC;
  --bg-white:       #FFFFFF;
  --bg-secondary:   #F1F5F9;
  --bg-hover:       #F8FAFC;

  /* Card */
  --card-bg:        #FFFFFF;
  --card-shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --card-shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --card-shadow-lg: 0 8px 32px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);

  /* Borders */
  --border:         #E5E7EB;
  --border-light:   #F3F4F6;
  --border-focus:   #7C3AED;

  /* Text */
  --text:           #111827;
  --text-secondary: #6B7280;
  --text-muted:     #9CA3AF;
  --text-inverse:   #FFFFFF;

  /* Semantic */
  --success:        #10B981;
  --success-bg:     #ECFDF5;
  --warning:        #F59E0B;
  --warning-bg:     #FFFBEB;
  --error:          #EF4444;
  --error-bg:       #FEF2F2;
  --info:           #3B82F6;
  --info-bg:        #EFF6FF;

  /* Spacing */
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      16px;
  --radius-xl:      20px;
  --radius-full:    9999px;

  /* Nav */
  --nav-height:     64px;
  --nav-bg:         #FFFFFF;
  --nav-border:     #E5E7EB;
  --nav-shadow:     0 1px 3px rgba(0,0,0,.08);

  /* Sidebar */
  --sidebar-width:  240px;

  /* Transitions */
  --transition:     all .18s ease;
  --transition-slow: all .3s ease;
}

/* ── Dark Theme ── */
.dark {
  --primary:        #8B5CF6;
  --primary-hover:  #7C3AED;
  --primary-light:  rgba(139,92,246,.15);
  --primary-mid:    rgba(139,92,246,.25);

  --bg:             #0F172A;
  --bg-white:       #0F172A;
  --bg-secondary:   #1E293B;
  --bg-hover:       #1E293B;

  --card-bg:        #1E293B;
  --card-shadow:    0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --card-shadow-md: 0 4px 16px rgba(0,0,0,.3), 0 1px 4px rgba(0,0,0,.2);
  --card-shadow-lg: 0 8px 32px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);

  --border:         #334155;
  --border-light:   #1E293B;
  --border-focus:   #8B5CF6;

  --text:           #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted:     #64748B;
  --text-inverse:   #0F172A;

  --success:        #34D399;
  --success-bg:     rgba(52,211,153,.1);
  --warning:        #FBBF24;
  --warning-bg:     rgba(251,191,36,.1);
  --error:          #F87171;
  --error-bg:       rgba(248,113,113,.1);
  --info:           #60A5FA;
  --info-bg:        rgba(96,165,250,.1);

  --nav-bg:         #1E293B;
  --nav-border:     #334155;
  --nav-shadow:     0 1px 3px rgba(0,0,0,.3);
}

/* ── Base Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--text); }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.875rem); letter-spacing: -.02em; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
p  { color: var(--text-secondary); }
a  { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--card-shadow-md); }
.card-pad  { padding: 20px; }
.card-pad-lg { padding: 28px; }

/* ── Navbar ── */
.ci-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: background .3s, border-color .3s;
}
.ci-nav-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.ci-logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.ci-logo span { color: var(--primary); }
.ci-logo:hover { text-decoration: none; }

/* Nav search */
.ci-nav-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}
.ci-nav-search input {
  width: 100%;
  height: 38px;
  padding: 0 16px 0 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: .875rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
.ci-nav-search input:focus {
  border-color: var(--border-focus);
  background: var(--card-bg);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.ci-nav-search input::placeholder { color: var(--text-muted); }
.ci-nav-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Nav links */
.ci-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin-left: auto;
}
.ci-nav-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: .75rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.ci-nav-links a:hover { color: var(--primary); background: var(--primary-light); text-decoration: none; }
.ci-nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-light);
}
.ci-nav-links svg { flex-shrink: 0; }

/* Nav actions */
.ci-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ci-nav-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
}
.ci-nav-icon-btn:hover {
  background: var(--bg-secondary);
  color: var(--text);
  border-color: var(--border);
  text-decoration: none;
}
.ci-nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid var(--primary-mid);
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(124,58,237,.3);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(124,58,237,.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid transparent;
}
.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text);
  border-color: var(--border);
}

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

.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ── Form controls ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .01em;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error   { background: var(--error-bg);   color: var(--error);   }
.badge-neutral { background: var(--bg-secondary); color: var(--text-secondary); border: 1px solid var(--border); }

/* ── Alert banners ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: .875rem;
  border: 1px solid;
}
.alert-error   { background: var(--error-bg);   border-color: #FECACA; color: #991B1B; }
.alert-success { background: var(--success-bg); border-color: #A7F3D0; color: #065F46; }
.alert-warning { background: var(--warning-bg); border-color: #FDE68A; color: #92400E; }
.dark .alert-error   { color: #FCA5A5; }
.dark .alert-success { color: #6EE7B7; }
.dark .alert-warning { color: #FCD34D; }

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 20px 0;
}

/* ── Avatar ── */
.avatar {
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
}
.avatar-sm  { width: 32px; height: 32px; font-size: .8rem; }
.avatar-md  { width: 40px; height: 40px; font-size: .95rem; }
.avatar-lg  { width: 52px; height: 52px; font-size: 1.2rem; }
.avatar-xl  { width: 80px; height: 80px; font-size: 1.8rem; }

/* ── Skeleton loader ── */
@keyframes ci-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-secondary) 25%,
    var(--border) 50%,
    var(--bg-secondary) 75%);
  background-size: 600px 100%;
  animation: ci-shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}

/* ── Utilities ── */
.hidden        { display: none !important; }
.text-primary  { color: var(--text); }
.text-secondary{ color: var(--text-secondary); }
.text-muted    { color: var(--text-muted); }
.text-purple   { color: var(--primary); }
.text-success  { color: var(--success); }
.text-error    { color: var(--error); }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.text-sm       { font-size: .875rem; }
.text-xs       { font-size: .75rem; }
.text-lg       { font-size: 1.125rem; }
.text-center   { text-align: center; }
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.w-full { width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Focus visible ── */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Theme transition ── */
body, .ci-nav, .card, .form-input, .form-select, .form-textarea, .btn {
  transition: background-color .25s ease, border-color .25s ease, color .2s ease;
}

/* ══════════════════════════════════════════════════════════
   CI-NAV MOBILE — hamburger
   ══════════════════════════════════════════════════════════ */
.ci-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  border-radius: var(--radius-sm);
}
.ci-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.ci-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ci-hamburger.open span:nth-child(2) { opacity: 0; }
.ci-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.ci-mobile-menu {
  display: none;
  position: absolute;
  top: var(--nav-height, 54px);
  left: 0; right: 0;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  padding: 12px 20px 16px;
  z-index: 199;
  flex-direction: column;
  gap: 2px;
}
.ci-mobile-menu.open { display: flex; }
.ci-mobile-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .9375rem;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.ci-mobile-menu a:hover, .ci-mobile-menu a.active { background: var(--primary-light); color: var(--primary); }
.ci-mobile-menu .ci-mobile-divider { height: 1px; background: var(--border); margin: 8px 0; }
.ci-mobile-menu .ci-mobile-auth { display: flex; gap: 10px; margin-top: 4px; }
.ci-mobile-menu .ci-mobile-auth a { flex: 1; text-align: center; }
.ci-mobile-menu .btn-primary { color: #fff; }

@media (max-width: 768px) {
  .ci-nav-links  { display: none !important; }
  .ci-nav-search { display: none !important; }
  .ci-hamburger  { display: flex; }

  /* Hide desktop auth buttons — shown in dropdown instead */
  .ci-nav-actions .btn { display: none !important; }
  .ci-nav-actions .ci-hamburger { display: flex; }
}
