@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900");

:root {
  --primary: #7a6ad8;
  --bg: #f7f7fc;
  --surface: #ffffff;
  --text: #1b1b1f;
  --muted: #70707a;
  --ring: rgba(122,106,216,.35);
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --card-shadow: 0 10px 25px rgba(16, 24, 40, 0.08);
  --radius: 16px;

  /* NEW: consistent toolbar sizing */
  --control-h: 42px;
  --control-px: 14px;
  --control-fs: 13px;
}

/* -------- Profile trigger & popover (same look as other pages) -------- */

.nav-menu .profile-li {
  position: relative;
}

/* Chip button */
.profile-trigger {
  border: none;
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;

  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;           /* no underline */
  font-family: inherit;
}

.profile-trigger:hover {
  background: rgba(255, 255, 255, 0.22);
}

.profile-trigger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Popover container */
.profile-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
  padding: 10px;
  display: none;
  z-index: 1000;
}

.profile-popover.show {
  display: block;
}

/* Avatar + name row */
.profile-popover .who {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.profile-popover .avatar-lg {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #7a6ad8;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 17px;
}

/* Name link */
.profile-popover .name {
  margin: 0;
  padding: 0;
}

.profile-popover .name-link {
  margin-left: -9px;
  font-weight: 600;
  font-size: 16px;
  color:#524694;
  text-decoration: none !important;
}

.profile-popover .name-link:hover {
  color: #7a6ad8;
  text-decoration: none;
}

/* Menu items */
.profile-popover .menu {
  margin-top: 6px;
  border-top: 1px solid #eee;
  padding-top: 6px;
}

.profile-popover .menu .menu-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #252525;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;           /* anchors look like buttons */
  cursor: pointer;
}

.profile-popover .menu .menu-link:hover {
  background: #f4f4ff;
  color: #5b4dac;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Navbar (as provided) */
header.nav{position:sticky;top:0;z-index:20;background:linear-gradient(180deg,var(--primary),#8a7fe2);color:#fff;box-shadow:0 8px 20px rgba(0,0,0,.12)}
.nav-inner{max-width:1100px;margin:0 auto;padding:14px 20px;display:flex;align-items:center;justify-content:space-between}
.logo{font-weight:800;letter-spacing:.7px;margin-right:14px;color:#fff;text-decoration:none;display:inline-block}
.logo:focus{outline:2px solid rgba(255,255,255,.6);outline-offset:2px}
.logo:hover{opacity:.9}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* Right side nav menu */
.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 18px;                /* space between items */
  align-items: center;
}

.nav-menu li a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.nav-menu li a:hover {
  background: rgba(255, 255, 255, 0.16);
  opacity: 0.95;
}

.nav-menu li a.active {
  background: rgba(255, 255, 255, 0.24);
}
@media (max-width: 768px) {
  .nav-inner {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-menu {
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* Layout */
.wrap { max-width: 1100px; margin: 22px auto; padding: 0 20px 80px; }

/* Top bar */
.toolbar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 16px 0 18px;
}

/* Tabs container */
.tabs {
  justify-content: center;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  display: inline-flex;
  padding: 6px;                 /* tightened */
  gap: 4px;
  width: 240px;
  height: var(--control-h);     /* NEW: match controls */
  max-width: 100%;
  align-items: center;          /* NEW */
}

/* Tab buttons */
.tab-btn {
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  opacity: .9;
  cursor: pointer;
  transition: transform .05s ease, background .2s ease, color .2s ease;
  height: calc(var(--control-h) - 12px); /* NEW: consistent inside tabs */
  padding: 0 12px;                        /* NEW */
  display: inline-flex;                   /* NEW */
  align-items: center;                    /* NEW */
  justify-content: center;                /* NEW */
  line-height: 1;                         /* NEW */
}

.tab-btn[aria-selected="true"] {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 6px 14px rgba(0,0,0,.08);
}

.tab-btn[aria-selected="false"]:hover {
  background: rgba(122,106,216,.08);
}

/* Compact tabs size (kept, but normalized) */
.tab-compact {
  font-size: 13px;
  min-width: auto;
}

/* Controls on the right */
.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: 100%;
}

.controls > * {
  flex: 0 0 auto;
}

/* -------- NEW: TOOLBAR CONTROL NORMALIZATION (fix uneven padding/height) -------- */
.controls .btn,
.controls label.btn,
.controls .select,
.controls select.select,
.controls select#qType,
.controls #dropzone {
  height: var(--control-h);
  min-height: var(--control-h);
  font-size: var(--control-fs);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Buttons + label buttons */
.controls .btn,
.controls label.btn {
  padding: 0 var(--control-px) !important; /* overrides inline padding differences */
  gap: 8px;
  white-space: nowrap;
}

/* Make sure SVG aligns perfectly inside label button */
.controls label.btn svg {
  flex: 0 0 auto;
  display: block;
}

/* Select */
.controls .select,
.controls select.select,
.controls select#qType {
  padding: 0 36px 0 12px;     /* consistent vertical */
  align-items: center;
}

/* Dropzone in toolbar row */
.controls #dropzone {
  padding: 0 var(--control-px);
  border: 2px dashed rgba(122,106,216,.45);
  text-align: center;
  color: var(--muted);
  background: transparent;
}

/* Save button: force same height even with inline styles */
#saveBtn {
  height: var(--control-h) !important;
  min-height: var(--control-h) !important;
  padding: 0 var(--control-px) !important;
  background-color: var(--primary) !important;
  color: #fff !important;
}
/* ------------------------------------------------------------------- */

/* Tablets and down */
@media (max-width: 900px) {
  .toolbar {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .tabs {
    width: 100%;
    justify-content: space-between;
  }

  .controls {
    justify-content: flex-start;
  }
}

/* Small phones */
@media (max-width: 520px) {
  .controls {
    gap: 8px;
  }

  #qType {
    flex: 1 1 100%;
  }

  .controls .btn,
  .controls label.btn {
    flex: 1 1 calc(50% - 6px);
  }
}

/* Inputs / Select */
.select, .input, .file {
  background: var(--surface);
  border-radius: 12px;
  padding: 7px 8px;
  border: 1px solid rgba(122,106,216,.35);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset;
  font: inherit;
  outline: none;
  display: inline-block;
  appearance: none;
  background-color: #fff;
  background-clip: padding-box;
  font-size: 15px;
}

/* Select arrow */
select.select, select#qType {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="%237a6ad8" d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
}

.select:focus, .input:focus, .file:focus, .btn:focus { 
  box-shadow: 0 0 0 4px var(--ring);
}

/* Buttons */
.btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--card-shadow);
}
.btn.secondary { background: #fff; color: var(--primary); border: 1px solid rgba(122,106,216,.35); }
.btn.ghost { background: transparent; color: var(--primary); box-shadow: none; border: 1px dashed rgba(122,106,216,.45); }
.btn.danger { background:#7a6ad8;}
.btn.warn { background: var(--warning); color: #1b1b1f; }
.btn:active { transform: translateY(1px); }

/* Cards */
.cards { display: grid; gap: 14px; }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(122,106,216,.14);
  position: relative;
}
.card.pinned { outline: 2px solid var(--ring); }
.card-header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.badge {
  background: rgba(122,106,216,.12);
  color: var(--primary);
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.q-title { font-weight: 700; font-size: 16px; margin: 0; }
.q-meta { color: var(--muted); font-size: 12px; }

.actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  border: none; background: transparent; cursor: pointer; padding: 8px; border-radius: 10px; color: var(--muted);
}
.icon-btn:hover { background: rgba(122,106,216,.08); color: var(--primary); }

.q-body { margin-top: 10px; }
.option { display: flex; gap: 8px; align-items: center; margin: 6px 0; }

.muted { color: var(--muted); }

/* Editor */
.editor { display: grid; gap: 10px; margin-top: 12px; }
.row { display: grid; gap: 8px; }
.row.grid2 { grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 10px; border-radius: 999px; background: rgba(122,106,216,.12); color: var(--primary); font-weight: 600; font-size: 12px; }

/* Footer */
.footer { text-align: center; color: var(--muted); margin-top: 30px; }

/* Hidden */
.hide { display: none !important; }

/* Shuffle toggle */
.toggle { position: relative; width: 48px; height: 28px; background: #e8e8f7; border-radius: 999px; cursor: pointer; border: 1px solid rgba(122,106,216,.3); }
.toggle::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 2px; left: 2px; box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: left .2s ease, background .2s ease; }
.toggle.on { background: var(--primary); }
.toggle.on::after { left: 24px; }

/* File drop (general) */
.dropzone { border: 2px dashed rgba(122,106,216,.45); border-radius: 14px; padding: 14px; text-align:center; color: var(--muted); }
.dropzone.dragover { background: rgba(122,106,216,.06); color: var(--primary); }

/* Small helpers */
.w-100 { width: 100%; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* NEW: Popover card */
.popover {
  position: absolute;
  z-index: 60;
  background: var(--surface);
  border: 1px solid rgba(122,106,216,.2);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  padding: 10px 0 12px;
  width: 360px;
  max-width: calc(100vw - 24px);
}
.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(122,106,216,.15);
}
.popover-body {
  padding: 12px 14px 6px;
  max-height: 60vh;
  overflow: auto;
}
.popover .code {
  background: #0f172a;
  color: #e2e8f0;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.4;
  overflow: auto;
  white-space: pre-wrap;
}
.popover .divider {
  height: 1px;
  background: rgba(122,106,216,.15);
  margin: 8px 0 10px;
}

/* Show state for popover */
.popover.show { animation: pop-in .12s ease-out; }
@keyframes pop-in { from { transform: translateY(-4px); opacity: .85; } to { transform: translateY(0); opacity: 1; } }

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.confirm-card {
  color: rgb(31, 31, 31);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 18px 20px 16px;
  max-width: 380px;
  width: 300px;
  border: 1px solid rgba(122, 106, 216, 0.18);
  animation: pop-in 0.12s ease-out;
}

.confirm-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

/* Logout overlay */
.logout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.logout-card {
  background: #fff;
  padding-top: -10px;
  padding-bottom: 20px;
  border-radius: 10px;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.logout-card h3 {
  margin-bottom: -10px;
  font-weight: 700;
}

.logout-card p {
  margin-bottom: 16px;
}

.logout-card .buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.logout-card button {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

#confirm-logout {
  background: #7a6ad8;
  color: #fff;
}

#cancel-logout {
  background: #e0e0e0;
  color: #222;
}

.hidden {
  display: none !important;
}
/* Search box that LOOKS like your old dropzone */
.dropzone.search-dropzone{
    margin-bottom: 20px;
  /* keep old dropzone look */
  border: 2px dashed rgba(122,106,216,.45);
  border-radius: 14px;
  color: var(--muted);

  /* make it input-like */
  height: var(--control-h);
  min-height: var(--control-h);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
 

  background: transparent;
  text-align: left;

  /* optional (matches your input feel) */
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset;
}

.dropzone.search-dropzone .search-ic{
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
    padding-left: 400px;
}

.dropzone.search-dropzone .search-dropzone-input{
  width:600px;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--text);

 
}

.dropzone.search-dropzone .search-dropzone-input::placeholder{
  color: rgba(112,112,122,.95);
}

/* hover + focus like old dropzone, but better */
.dropzone.search-dropzone:hover{
  background: rgba(122,106,216,.03);
  color: var(--primary);
}

/* .dropzone.search-dropzone:focus-within{
  box-shadow: 0 0 0 4px var(--ring);
  border-color: rgba(122,106,216,.65);
} */

/* Mobile full width */
@media (max-width: 520px){
  .dropzone.search-dropzone{
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
  }
}
 /* Make whole search-dropzone clickable */
.dropzone.search-dropzone{
  cursor: text;
  position: relative;
}

/* Let input take the full clickable area */
.dropzone.search-dropzone .search-dropzone-input{
  flex: 1;
  height: 100%;
}

/* Prevent icon from blocking click */
.dropzone.search-dropzone .search-ic{
  pointer-events: none;
}
html, body {
  zoom: 1.12 !important;
}
 