/* dashboard.css — Admin panel */

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

:root {
  --white: #f8f6ff;
  --p400: #a855f7;
  --p500: #9333ea;
  --p600: #7e22ce;
  --p700: #6b21a8;
  --p900: #1a0533;
  --dark: #0a0212;
  --dark2: #0f0320;
  --dark3: #120428;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-b: rgba(168, 85, 247, 0.18);
  --pink: #f472b6;
  --red: #f87171;
  --green: #4ade80;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --sidebar-w: 240px;
  --topbar-h: 60px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--dark);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  cursor: none;
}

::selection {
  background: var(--p500);
  color: #fff;
}

/* ── CURSOR ── */
#cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
}

#cursor-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--p400);
  position: absolute;
  transform: translate(-50%, -50%);
}

#cursor-ring {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(168, 85, 247, 0.4);
  position: absolute;
  transform: translate(-50%, -50%);
  transition: width .2s, height .2s, border-color .2s;
}

body:has(a:hover) #cursor-ring,
body:has(button:hover) #cursor-ring,
body:has(input:hover) #cursor-ring,
body:has(textarea:hover) #cursor-ring {
  width: 46px;
  height: 46px;
  border-color: var(--p400);
  background: rgba(168, 85, 247, 0.06);
}

/* ── NOISE + ORBS ── */
.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.1;
  animation: drift 20s ease-in-out infinite alternate;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--p500);
  top: -150px;
  left: -100px;
}

.orb-2 {
  width: 350px;
  height: 350px;
  background: var(--pink);
  bottom: -80px;
  right: -60px;
  animation-delay: -10s;
}

@keyframes drift {
  from {
    transform: translate(0, 0)
  }

  to {
    transform: translate(40px, 30px)
  }
}

/* ── VIEWS ── */
.view {
  position: relative;
  z-index: 1;
}

/* ── LOGIN ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: 20px;
  padding: 48px 36px;
  backdrop-filter: blur(24px);
  animation: cardIn .5s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(20px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-sigil {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--p600), var(--p900));
  border: 1px solid rgba(168, 85, 247, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.login-sigil svg {
  width: 26px;
  height: 26px;
  color: var(--p400);
}

.login-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, var(--p400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.login-sub {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.25);
}

/* ── FORM ELEMENTS (shared) ── */
.d-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.d-group label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--p400);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.d-group input,
.d-group textarea {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
  outline: none;
  cursor: none;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}

.d-group input:focus,
.d-group textarea:focus {
  border-color: var(--p500);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

.d-group code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--p400);
  background: rgba(168, 85, 247, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.d-error {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--red);
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  text-align: center;
  margin-bottom: 12px;
}

.d-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--p500), var(--p600));
  border: none;
  border-radius: 10px;
  cursor: none;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(147, 51, 234, 0.3);
  transition: transform .2s, box-shadow .2s, opacity .2s;
}

.d-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(147, 51, 234, 0.45);
}

.d-btn:disabled {
  opacity: 0.6;
}

/* ── DASHBOARD LAYOUT ── */
#view-dashboard {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(10, 2, 18, 0.85);
  backdrop-filter: blur(24px);
  border-right: 1px solid rgba(168, 85, 247, 0.12);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}

.sidebar.collapsed {
  transform: translateX(calc(-1 * var(--sidebar-w)));
}

.sidebar-brand {
  padding: 28px 24px 24px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.1);
}

.brand-main {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, var(--p400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.25);
  display: block;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  text-align: left;
  cursor: none;
  transition: background .2s, color .2s;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(168, 85, 247, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

.nav-item.active {
  background: rgba(168, 85, 247, 0.14);
  color: var(--white);
  font-weight: 500;
}

.sidebar-logout {
  margin: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: none;
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.15);
  color: rgba(248, 113, 113, 0.7);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .2s, color .2s;
}

.sidebar-logout svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.sidebar-logout:hover {
  background: rgba(248, 113, 113, 0.12);
  color: var(--red);
}

/* MAIN AREA */
.dash-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .3s;
}

.dash-main.full {
  margin-left: 0;
}

/* TOPBAR */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.1);
  background: rgba(10, 2, 18, 0.6);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  cursor: none;
}

.burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2px;
  transition: .3s;
}

.topbar-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.08em;
}

.topbar-right {
  display: flex;
  align-items: center;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
}

.status-dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .4
  }
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9000;
  padding: 14px 20px;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--green);
  color: #052e16;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--red);
  color: #450a0a;
}

/* PANELS */
.panel {
  display: none;
  padding: 32px;
  animation: fadePanel .3s ease both;
}

.panel.active {
  display: block;
}

@keyframes fadePanel {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.panel-header {
  margin-bottom: 28px;
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.panel-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 300;
}

.panel-desc code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--p400);
  background: rgba(168, 85, 247, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

/* CARDS */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.d-card {
  background: var(--glass);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(16px);
}

.d-card--wide {
  grid-column: span 2;
}

.d-card-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--p400);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.d-hint {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
  line-height: 1.6;
  margin-bottom: 14px;
  font-weight: 300;
}

.d-hint code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--p400);
  background: rgba(168, 85, 247, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.d-save-btn {
  padding: 11px 22px;
  border-radius: 9px;
  border: none;
  background: linear-gradient(135deg, var(--p500), var(--p600));
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: none;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.25);
  margin-top: 6px;
}

.d-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.4);
}

/* PROJECT LIST */
.proj-form-grid,
.links-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.proj-list,
.friends-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.proj-empty {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.2);
  text-align: center;
  padding: 24px;
}

.proj-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(168, 85, 247, 0.1);
}

.proj-item-info {
  flex: 1;
}

.proj-item-title {
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.proj-item-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
}

.proj-delete {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(248, 113, 113, 0.2);
  background: rgba(248, 113, 113, 0.05);
  color: rgba(248, 113, 113, 0.6);
  font-size: 0.75rem;
  cursor: none;
  transition: background .2s, color .2s;
}

.proj-delete:hover {
  background: rgba(248, 113, 113, 0.12);
  color: var(--red);
}

.friend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(244, 114, 182, 0.1);
}

.friend-email {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}

.friend-delete {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(248, 113, 113, 0.2);
  background: rgba(248, 113, 113, 0.05);
  color: rgba(248, 113, 113, 0.5);
  font-size: 0.72rem;
  cursor: none;
  transition: background .2s, color .2s;
}

.friend-delete:hover {
  background: rgba(248, 113, 113, 0.12);
  color: var(--red);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .dash-main {
    margin-left: 0;
  }

  .burger {
    display: flex;
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .d-card--wide {
    grid-column: span 1;
  }

  .proj-form-grid,
  .links-form-grid {
    grid-template-columns: 1fr;
  }
}