/* WP SharePoint Library (Graph) - Frontend Styles (list layout + right actions) */

.spg-library {
  /*border: 1px solid #e2e8f0;*/
  border:0px;
  padding: 12px 15px;
  /*border-radius: 8px;*/
  background: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

.spg-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.spg-back {
  font-size:14px;
  color:white;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #015291;
  cursor: pointer;
  margin-bottom:1rem;
}
.spg-back:hover { 
    background: white;
    border:1px solid #150291;
    color:#150291;
}
.spg-back[disabled] { opacity: .5; pointer-events: none; }

/* Breadcrumbs */
.spg-breadcrumb {
    font-weight:bold;
  font-size: 16px;
  color: #015491;
  overflow: auto;
  white-space: nowrap;
  flex: 1 1 auto;
}
.spg-breadcrumb a {
  color: #015491;
  text-decoration: none;
}
.spg-breadcrumb a:hover {
  text-decoration: underline;
}

.spg-breadcrumb-sep{
    color:#6FA02F;
    margin-left:15px;
    margin-right:15px;
}
/* Sort select */
.spg-sort label {
  font-size: 14px;
  color: black;
  font-weight:bold;
}
.spg-sort-select {
  margin-left: 6px;
  padding: 7px 17px 7px 16px;
  border: 2px solid #015291;
  border-radius: 6px;
  background: #EFF8FF;
  min-width:240px;
}

/* Search */
.spg-search {
  display: flex;
  align-items: center;
  gap: 6px;
  /*margin-left: auto;*/
}
/*.spg-search-label { display: none; }*/

.spg-search-label-text{
    font-size:14px;
    font-weight:bold;
}
.spg-search-input {
  padding: 6px 8px;
  border: 2px solid #015291;
  border-radius: 6px;
  background: #EFF8FF;
  min-width: 240px;
  font-size:14px;
}
.spg-search-input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96,165,250,0.25);
}
.spg-search-clear {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
  line-height: 1;
}
.spg-search-clear:hover { background: #f1f5f9; }

/* List: single column (full width items) */
.spg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Item row */
.spg-item {
  border: 1px solid #015291;
  border-radius: 8px;
  padding: 2rem;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  background: #fff;
  width: 100%;
}


/* Left body (clickable for folders) */
.spg-left {
  display: flex;
  gap: 10px;
  flex: 1 1 auto;
  align-items: flex-start;
  cursor: default;
}
.spg-folder-click {
  cursor: pointer;
}
.spg-file-click { cursor: pointer; }

.spg-icon {
  width: 24px;
  font-size: 18px;
  line-height: 24px;
  text-align: center;
  flex: 0 0 auto;
}
.spg-body { flex: 1 1 auto; }
.spg-title {
  font-weight: 600;
  margin: 0 0 2px;
  color: #015291;
  word-break: break-word;
}
.spg-title:hover {
  color:#0264C8;
}

.spg-meta {
  font-size: 14px;
  color: black;
  margin-bottom: 6px;
}

.spg-path:hover{
  color:#0264C8;
}


/* Right CTA column */
.spg-cta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 6px;
  min-width: 220px;
}
.spg-cta-folder {
  margin-left: auto; /* let folder path row sit aligned to the right under the row */
}

/* Buttons */
.spg-btn {
  display: inline-block;
  padding: 6px 10px;
  border:0px;
  /*border-radius: 6px;*/
  background: #fff;
  text-decoration: none;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
}
.spg-btn:hover { background: #f1f5f9; }
.spg-btn-open {
  border-color: #60a5fa;
}
.spg-btn-download {
  border-color: #34d399;
}

/* Path row + copy button (shown under CTAs) */
.spg-path-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.spg-path {
  font-size: 12px;
  color: #015291;
  word-break: break-all;
}
.spg-copy-btn {
  display: inline-block;
  padding: 6px 10px;
  border:0px;
  /*border-radius: 6px;*/
  background: #fff;
  text-decoration: none;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
}
.spg-copy-btn:hover { background: #f1f5f9; }
.spg-copy-btn.spg-copied {
  border-color: #16a34a;
  color: #166534;
  background: #ecfdf5;
}

/* Small “Open” link for folders (optional) */
.spg-open-link {
  text-decoration: none;
  color: #0ea5e9;
  font-weight: 600;
}
.spg-open-link:hover { text-decoration: underline; }

/* Load more + status */
.spg-actions {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
.spg-load-more {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
}
.spg-load-more:hover { background: #f1f5f9; }

.spg-status {
  font-size: 14px;
  color: #64748b;
  margin-top: 6px;
}

/* Highlight for search matches */
mark {
  background: #fde68a;
  padding: 0 2px;
  border-radius: 2px;
}

/* ---------------------------
   Copilot semantic search UI
   --------------------------- */

/* Copilot button next to the input */
.spg-search-copilot {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #0ea5e9;
  background: #0ea5e9;
  color: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.spg-search-copilot:hover {
  background: #0284c7;
  border-color: #0284c7;
}

/* Copilot status + results live area */
.spg-copilot-status {
  margin: 8px 0 4px;
  font-size: 12px;
  color: #4b5563;
}

/* Container for Copilot hits (cards live above the list) */
.spg-copilot-results {
  margin-bottom: 10px;
}

/* Individual Copilot result card */
.spg-copilot-hit {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #f9fafb;
}

/* Header row: title + source pill */
.spg-copilot-hit-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.spg-copilot-title {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
}

/* e.g. "SharePoint" / "External" */
.spg-copilot-source {
  font-size: 10px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
}

/* Author line */
.spg-copilot-author {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

/* Text extract / snippet */
.spg-copilot-snippet {
  font-size: 12px;
  color: #111827;
  margin-bottom: 4px;
}

/* Link to the source document */
.spg-copilot-link {
  font-size: 12px;
  color: #0ea5e9;
  text-decoration: underline;
}
.spg-copilot-link:hover {
  color: #0369a1;
}


/* Global library search bar (separate from folder filter) */
.spg-global-search {
  margin: 6px 0 10px;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* NEW: wrapper so we can place the search icon inside the input */
.spg-global-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

/* Updated: make room for the icon inside the field */
.spg-global-input {
  padding: 6px 30px 6px 10px;
  border: 2px solid #015291;
  border-radius: 6px;
  background: #EFF8FF;
  flex: 1 1 auto;
  font-size:14px;
  min-width:240px;
}

.spg-global-input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96,165,250,0.25);
}

/* NEW: icon button positioned inside the input (left) */
.spg-global-icon-btn {
  position: absolute;
  right: 70px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.spg-global-icon-btn:hover {
  color: #334155;
}

.spg-global-icon-btn:focus {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
  border-radius: 6px;
}

.spg-global-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: #015291;
}

/* Keep Reset button styling; remove old .spg-global-btn styling usage (JS no longer renders it) */
.spg-global-btn,
.spg-global-clear {
  padding: 6px 10px;
  color:white;
  border-radius: 6px;
  border: 1px solid #015291;
  background: #015291;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.spg-global-btn {
  border-color: #0ea5e9;
  background: #0ea5e9;
  color: #ffffff;
}

.spg-global-btn:hover {
  background: #0284c7;
  border-color: #0284c7;
}

.spg-global-clear:hover {
    background: white;
    border:1px solid #150291;
    color:#150291;
}

/* NOTE:
   The native “X” clear button in inputs typically appears for type="search".
   In the updated JS, the global input is type="text" (inputmode="search") to avoid that UI
   interfering with the inside icon across browsers.
*/


/* Loading spinner for global search */
.spg-status {
  min-height: 20px; /* reserve a bit of space so things don't jump */
}

/* little circle spinner */
.spg-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  border-top-color: #0ea5e9;
  animation: spg-spin 0.6s linear infinite;
  vertical-align: -2px;
}

@keyframes spg-spin {
  to {
    transform: rotate(360deg);
  }
}




.spg-library a[target="_blank"]::after {
  content: none !important;
  display: none !important;
}



/* inline svg sizing */
.spg-icon-svg {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  margin-bottom:3px;
  margin-left:5px;
}

.spg-icon-file {
    margin:0;
    width:20px;
    height:20px;
}

.spg-icon-svg path {
  fill: currentColor;
}

.spg-icon-copy path{
    fill:#015291;
}

.spg-icon-download path{
    fill:#015291;
}
/* Optional: match your old green */
.spg-icon .spg-icon-svg {
  color: #6FA02F;
}


.spg-path{
  font-size: 0.85em;
  /*opacity: 0.8;*/
  margin-top: 4px;
  word-break: break-word;
}






/* Tablet and below */
@media (max-width: 1024px) {
  .spg-item {
    flex-direction: column;
    align-items: stretch;
  }
}

.search-results .spg-item{
    flex-direction:column;
        align-items: stretch;
        border:none;
        padding:1rem 0px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border-radius: 0;  
        padding: 1.5rem;
}

.spg-library .spg-list{
    margin-left:0;
}
.spg-library .spg-list li {
  list-style: none !important;
}

.spg-library .spg-list li::before {
  content: "" !important;
  display: none !important;
}

.search-results .spg-global-search{
    display:none;
}

.search-results .spg-search{
    display:none;
}

.search-results .spg-breadcrumbContainer{
    display:none;
}



.spg-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;              /* more breathing room */
}

/* Bigger status text */
.spg-status-text {
  font-size: 16px;        /* bump up (try 16–18px) */
  font-weight: 600;       /* optional */
  line-height: 1.2;
}

/* Loader */
.spg-loader {
  width: 15px;
  aspect-ratio: 1;
  position: relative;
  flex: 0 0 auto;
  color: #015291;

  /* IMPORTANT: prevents overlap with the text because the orbit extends left */
  margin-left: 25px;      /* same as translate/box-shadow distance */
}

.spg-loader::before,
.spg-loader::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
}

.spg-loader::before {
  box-shadow: -25px 0 currentColor;
  animation: spg-l8-1 1s infinite linear;
}

.spg-loader::after {
  transform: rotate(0deg) translateX(25px);
  animation: spg-l8-2 1s infinite linear;
}

@keyframes spg-l8-1 { 100% { transform: translateX(25px); } }
@keyframes spg-l8-2 { 100% { transform: rotate(-180deg) translateX(25px); } }






