/***

Base styles user for the whole vector store page.

author : Mascha Schmidt
date: 04.02.2025

***/


:root {
    --text-highlight-color:rgb(24, 40, 134) ;
    --text-highlight-shadow-color: rgba(0, 0, 0, 0.4);
    --box_background: #f5f5f7;
    --box_border_color: #0000ff48;
    --box_shadow_color:#00005848; 
    --font-size: 16px;
}





/* Base Class Modifications */


html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    font-size: large;
}

h2 {
    color: var(--text-highlight-color);
}

/* Custom Containers */


/* Wraps the page-content only excluding the page-header */
.page-content-container {
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

/* Uppermost wrap of all subelements. Creates a box with rounded corners and a drop shadow. 
Used for all sub elements on the page. */
.element-box {
    min-width: 300px;
    width: 60%;
    
    background-color: var(--box_background); 
    
    border: 2px solid var(--box_border_color); 
    border-radius: 15px;
    
    box-shadow: 4px 4px 8px var(--box_shadow_color);
    
    padding: 20px;
    margin-bottom: 20px;
    
    display: flex;
    flex-direction: column;
}

.warning {
    background-color: #ffe4a9; 
  }
  
  
.code {
    background-color: #e6e2e2;
    border: 1px solid;
    padding: 10px;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chunkbox {
  display: flex;
  flex-direction: row;
  border-radius: 15px;
  background-color: rgb(232, 235, 243);
  border: 2px solid #0000ff48; 
  padding-left: 20px;
  padding-right: 20px;

  }

.chunk-text-box{
  width: 100%;
  display: flex;
  flex-direction: column;
}

.chunk-metadata-box{
  display: flex;
  flex-direction: row;
  margin-left:10px;

}
.chunk-metadata-content{
  display: flex;
  flex-direction: column;
}

/* Header and Text formats */

.page-header {
    font-size: 5em;
    font-weight: bold;
    color: var(--text-highlight-color); 
    text-align: center;
    text-shadow: 4px 4px 8px var(--text-highlight-shadow-color) ;
    max-width: 100%;
  }
  
  .no-wrap{
    white-space: nowrap; 

  }

.chunk-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 12px 0;
    position: sticky;
    top: 0;
    background-color: #f5f5f5;
    padding: 8px;
    z-index: 100;
    border-bottom: 1px solid #ddd;
}

.chunk-paging-status {
    width: 100%;
    margin: 8px 0 0 0;
    font-size: 0.95rem;
    color: #2d3552;
    text-align: center;
}

#page_number_buttons {
    display: inline-flex;
    gap: 4px;
}

.page-number-btn {
    min-width: 36px;
}

/* Unified page styles aligned with explain-rag-chatbot */
:root {
    --brand-green: #b9d25f;
    --brand-red: #eb5f73;
    --brand-grey: #ebebeb;
    --brand-dark-blue: #023d6b;
    --brand-light-blue: #adbde3;
    --ui-surface: #ffffff;
    --ui-surface-muted: #f5f7fb;
    --ui-border: #d7dce4;
    --ui-text: #1f2a38;
    --ui-text-muted: #384b63;
    --ui-focus: #0f5cc0;
    --ui-radius: 10px;
}

body {
    background-color: var(--ui-surface);
    color: var(--ui-text);
    font-family: Arial, Helvetica, sans-serif;
    border: none;
}

h1, h2, h3, h4 {
    color: var(--brand-dark-blue);
}

.page-header {
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 18px 0;
    padding: 18px 24px;
    font-size: clamp(2rem, 4.8vw, 3.2rem);
    line-height: 1.12;
    color: #ffffff;
    background-color: var(--brand-dark-blue);
    border-bottom: 1px solid #022f55;
    text-shadow: none;
}

.subnav {
    width: min(96%, 1520px);
    margin: -6px auto 12px;
    padding: 8px 2px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid #dfe5ef;
    font-size: 0.9rem;
    color: var(--ui-text-muted);
    box-sizing: border-box;
}

.subnav-group {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.subnav-link {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    color: var(--ui-text-muted);
    text-decoration: none;
    font-weight: 500;
}

.subnav-link + .subnav-link {
    border-left: 1px solid #dfe5ef;
}

.subnav-link:hover {
    color: var(--brand-dark-blue);
    text-decoration: underline;
}

.subnav-link[aria-current="page"] {
    color: var(--brand-dark-blue);
    font-weight: 700;
    text-decoration: none;
}

.page-content-container {
    width: 100%;
    max-width: none;
    padding: 0 8px 16px;
    box-sizing: border-box;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
}

.element-box {
    width: min(96%, 1520px);
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
    padding: 16px 18px;
    border: 1px solid lightgray;
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: none;
}

p,
li {
    color: var(--ui-text-muted);
    line-height: 1.55;
}

a {
    color: var(--brand-dark-blue);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.15em;
    font-weight: 600;
}

a:hover {
    color: #022f55;
    text-decoration-thickness: 2px;
}

.warning {
    border-color: #e9cb86;
    background: #fff6e2;
}

.warning h2,
.warning p {
    color: #5e3f00;
}

.code {
    margin: 0;
    padding: 14px;
    border: 1px solid #cfd8e6;
    border-radius: 8px;
    background: #f7f9fc;
    font-family: "Courier New", Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #1c2c42;
    overflow-x: auto;
}

.store-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 10px;
}

.store-list-item {
    padding-bottom: 6px;
    border-bottom: 1px solid #d9d9d9;
}

.store-list-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

button,
.std-button {
    display: inline-block;
    padding: 8px 14px;
    margin: 4px 2px;
    background-color: var(--brand-light-blue);
    color: #111111;
    border: 1px solid #8ea6d8;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

button:hover,
.std-button:hover {
    background-color: #9cb1dd;
}

button:disabled,
.std-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

input[type="text"],
input[type="number"],
textarea,
select {
    border-radius: 10px;
    padding: 8px 10px;
    border: 1px solid #b7c4dd;
    font: inherit;
    background-color: #ffffff;
    color: var(--ui-text);
}

input[type="range"] {
    accent-color: var(--brand-dark-blue);
}

*:focus-visible {
    outline: 3px solid var(--ui-focus);
    outline-offset: 2px;
}

.chunk-controls {
    width: min(96%, 1520px);
    margin: 0 auto;
    padding: 10px 14px;
    border: 1px solid lightgray;
    border-radius: var(--ui-radius);
    background: #ffffff;
}

#chunk_paging_status,
.chunk-paging-status {
    width: min(96%, 1520px);
    margin: 8px auto 12px;
    color: var(--ui-text-muted);
}

#chunk_list_view {
    width: 100%;
}

.chunkbox {
    margin-bottom: 10px;
    border: 1px solid #cfd8e6;
    background-color: #ffffff;
    width: 100%;
    box-sizing: border-box;
}

.chunk-text-box {
    min-width: 0;
    flex: 1 1 auto;
}

.chunk-text-content {
    padding-right: 12px;
}

.chunk-metadata-box {
    border-left: 1px solid #d8dfe9;
    padding-left: 12px;
    box-sizing: border-box;
    max-width: 50%;
    flex: 0 0 auto;
}

#metadata-table {
    border-collapse: collapse;
}

#metadata-table td {
    padding: 2px 6px 2px 0;
    vertical-align: top;
}

#metadata-table td.metadata-entry {
    padding: 6px 4px 8px 0;
}

.metadata-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #4f607b;
    line-height: 1.25;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.metadata-value,
#metadata-table td.metadata-wrap,
.metadata-value.metadata-wrap {
    font-size: 0.92rem;
    color: var(--ui-text);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

.metadata-value a {
    font-weight: 500;
}

#metadata-table p,
#metadata-table ul,
#metadata-table ol {
    margin: 0;
}

.loading-page {
    justify-content: flex-start;
    align-items: center;
}

.loading-page .status-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.loading-page .status-list p {
    margin: 0 0 8px 0;
}

.loading-spinner {
    margin: 28px auto 0;
    width: 70px;
    text-align: center;
}

.loading-spinner > div {
    width: 18px;
    height: 18px;
    background-color: var(--brand-dark-blue);
    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;
}

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

.loading-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);
    }
}

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

@media (max-width: 900px) {
    .element-box,
    .chunk-controls,
    #chunk_paging_status,
    .chunk-paging-status {
        width: min(97%, 980px);
    }
}

@media (max-width: 700px) {
    .page-header {
        padding: 14px 14px;
        margin-bottom: 14px;
    }

    .subnav {
        width: 94%;
        margin-top: -8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .element-box,
    .chunk-controls,
    #chunk_paging_status,
    .chunk-paging-status {
        width: 94%;
        padding: 14px;
    }

    .store-list {
        padding-left: 1rem;
    }
}
