 /* --- ChatGPT-ish widget styling (light/dark via prefers-color-scheme) --- */
:root {
--bg: #ffffff;
--panel: #f7f7f8;
--panel-2: #ffffff;
--text: #0f172a;
--muted: #6b7280;
--border: rgba(15, 23, 42, 0.12);
--shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
--hover: rgba(15, 23, 42, 0.06);
--active: rgba(15, 23, 42, 0.10);
--accent: #10a37f; /* ChatGPT-ish green */
--focus: rgba(16, 163, 127, 0.35);
--radius: 16px;
--radius-sm: 12px;
--font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

@media (prefers-color-scheme: dark) {
:root {
    --bg: #0b0f14;
    --panel: #111827;
    --panel-2: #0f172a;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: rgba(229, 231, 235, 0.12);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --hover: rgba(229, 231, 235, 0.06);
    --active: rgba(229, 231, 235, 0.10);
    --accent: #10a37f;
    --focus: rgba(16, 163, 127, 0.35);
}
}

* {
box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    background: transparent; /* widget container usually provides background */
    color: var(--text);
}

.widget {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.title h1 {
    margin: 0;
    font-size: 14px;
    font-weight: 650;
    letter-spacing: 0.2px;
}

.title p {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}

.controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search {
    position: relative;
    min-width: 180px;
    max-width: 320px;
    width: 40vw;
}

.search input {
    width: 100%;
    appearance: none;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    border-radius: 999px;
    padding: 10px 12px 10px 34px;
    font-size: 12px;
    outline: none;
}

.search input:focus {
    border-color: rgba(16, 163, 127, 0.6);
    box-shadow: 0 0 0 4px var(--focus);
}

.search .icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    opacity: 0.7;
    pointer-events: none;
    fill: currentColor;
    color: var(--muted);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--muted);
    user-select: none;
    white-space: nowrap;
}

.pill strong {
    color: var(--text);
    font-weight: 650;
}

.listWrap {
    flex: 1;
    min-height: 0; /* for proper scrolling */
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.list {
    height: 100%;
    overflow: auto;
    padding: 6px;
    max-height: 100%;
    overflow-y: scroll;
}

/* Nice scrollbars */
.list::-webkit-scrollbar {
    width: 10px;
}
.list::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.35);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: content-box;
}
.list::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 114, 128, 0.5);
    border: 3px solid transparent;
    background-clip: content-box;
}

.row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
}

.row:hover {
    background: var(--hover);
}

.row:active {
    background: var(--active);
}

.row:focus {
    outline: none;
    border-color: rgba(16, 163, 127, 0.55);
    box-shadow: 0 0 0 4px var(--focus);
}

.name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.basename {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docid {
    font-size: 11px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 650;
    user-select: none;
}

.arrow {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.empty {
    padding: 18px 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 2px;
}

.hint {
    font-size: 12px;
    color: var(--muted);
}

.btn {
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    border-radius: 999px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.btn:hover {
    background: var(--hover);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--focus);
}


/* GENERAL LOADER FOR ALL PAGES */

.loading_cover {
  position: fixed;
  top:0px;
  left:0px;
  bottom:0px;
  right:0px;
  width: 100%;
  height: 100vh;
  z-index: 1200;
  background-color: var(--bg) !important;
  opacity: 1;
  visibility: visible;
  transition: visibility 0s linear 0s, opacity 0.25s 0s;
}

.hide-loading {
  opacity: 0;
  visibility: hidden;
  transition: visibility 0s linear 0.25s, opacity 0.25s 0s;
}

.spinner {
  /* margin: 100px auto 0; */
  width: 70px;
  text-align: center;
  display: inline-block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.spinner > div {
  width: 18px;
  height: 18px;
  background-color: #333333;

  border-radius: 100%;
  display: inline-block;
  -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
  animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
  -webkit-animation-delay: -0.32s;
  animation-delay: -0.32s;
}

.spinner .bounce2 {
  -webkit-animation-delay: -0.16s;
  animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {
  0%, 80%, 100% { -webkit-transform: scale(0) }
  40% { -webkit-transform: scale(1.0) }
}

@keyframes sk-bouncedelay {
  0%, 80%, 100% { 
    -webkit-transform: scale(0);
    transform: scale(0);
  } 40% { 
    -webkit-transform: scale(1.0);
    transform: scale(1.0);
  }
}


 /* STYLING LOADER DIV */

 .lds-ellipsis {
  display: inline-block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
}
.lds-ellipsis div {
  position: absolute;
  top: 33px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background-color: #333;
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.lds-ellipsis div:nth-child(1) {
  left: 8px;
  animation: lds-ellipsis1 0.6s infinite;
}
.lds-ellipsis div:nth-child(2) {
  left: 8px;
  animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(3) {
  left: 32px;
  animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(4) {
  left: 56px;
  animation: lds-ellipsis3 0.6s infinite;
}
@keyframes lds-ellipsis1 {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes lds-ellipsis3 {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(0);
  }
}
@keyframes lds-ellipsis2 {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(24px, 0);
  }
}


.loading_cover_transparent {
  position: fixed;
  top:0px;
  left:0px;
  bottom:0px;
  right:0px;
  width: 100%;
  height: 100vh;
  z-index: 2000;
  background-color: transparent;
  opacity: 1;
  visibility: visible;
  transition: visibility 0s linear 0s, opacity 0.25s 0s;
}
