:root {
    --bg-dark: oklch(0.1 0 251);
    --bg: oklch(0.15 0 251);
    --bg-light: oklch(0.2 0 251);
    --text: oklch(0.96 0 251);
    --text-muted: oklch(0.76 0 251);
    --highlight: oklch(0.5 0 251);
    --border: oklch(0.4 0 251);
    --border-muted: oklch(0.3 0 251);
    --primary: oklch(0.76 0.1 251);
    --secondary: oklch(0.76 0.1 71);
    --danger: oklch(0.7 0.05 30);
    --warning: oklch(0.7 0.05 100);
    --success: oklch(0.7 0.05 160);
    --info: oklch(0.7 0.05 260);

    --llmtext: oklch(0.3 0.2 251);
    --llmbackground: oklch(0.8 0.15 251);
    --llmgradient: linear-gradient(180deg, var(--llmtext), var(--llmbackground));
    --llmspingradient: conic-gradient(
        oklch(0.7 0.2 310),  
        oklch(0.7 0.2 251),  
        oklch(0.75 0.2 195), 
        oklch(0.7 0.2 251),  
        oklch(0.7 0.2 310)   
    );
    --gradient: linear-gradient(0deg, var(--bg) 95%, var(--bg-light));
    --gradient-hover: linear-gradient(0deg, var(--bg), var(--bg-light));
}
body.light {
    --bg-dark: oklch(0.92 0 251);
    --bg: oklch(0.96 0 251);
    --bg-light: oklch(1 0 251);
    --text: oklch(0.15 0 251);
    --text-muted: oklch(0.4 0 251);
    --highlight: oklch(1 0 251);
    --border: oklch(0.6 0 251);
    --border-muted: oklch(0.7 0 251);
    --primary: oklch(0.4 0.1 251);
    --secondary: oklch(0.4 0.1 71);
    --danger: oklch(0.5 0.05 30);
    --warning: oklch(0.5 0.05 100);
    --success: oklch(0.5 0.05 160);
    --info: oklch(0.5 0.05 260);

    --llmtext: oklch(37.687% 0.17026 274.561);    
    --llmbackground: oklch(85.635% 0.07842 241.418);
    --llmgradient: linear-gradient(0deg, var(--llmtext), var(--llmbackground));
    --llmspingradient: conic-gradient(
        oklch(0.7 0.2 310), 
        oklch(0.7 0.2 251), 
        oklch(0.75 0.2 195), 
        oklch(0.7 0.2 251),  
        oklch(0.7 0.2 310)   
    );
    --gradient: linear-gradient(0deg, var(--bg) 95%, var(--bg-light));
    --gradient-hover: linear-gradient(0deg, var(--bg), var(--bg-light));
}

/* Reset and Base */
*, *::before, *::after { box-sizing: border-box; margin: 0 }

ul, ol { list-style: none }

body {
    background: var(--bg-dark);
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    font-family: Georgia, 'Times New Roman', Times, serif;
    line-height: 1.5;
    min-height: 100vh;
    overflow-y: scroll;
}

a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Scrollbars */
/* goes with body, paper-card and filter-card */
body::-webkit-scrollbar,
.paper-card::-webkit-scrollbar,
.filter-card::-webkit-scrollbar { background: var(--bg-light); width: 8px; z-index: -2; }
 
body::-webkit-scrollbar-track,
.paper-card::-webkit-scrollbar-track,
.filter-card::-webkit-scrollbar-track { color: var(--bg-dark);background: transparent; }
 
body::-webkit-scrollbar-thumb,
.paper-card::-webkit-scrollbar-thumb,
.filter-card::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }
 
body::-webkit-scrollbar-thumb:hover,
.paper-card::-webkit-scrollbar-thumb:hover,
.filter-card::-webkit-scrollbar-thumb:hover { background: var(--bg-light) }

/* nav */
header {
    background: var(--bg-light); 
    padding: 1rem 4rem;
}
 
nav {
    align-items: center;
    display: flex;
    height: 60px;
    justify-content: space-between;
    max-width: 75%;
    margin: 0 auto;
}
 
.nav-logo {
    color: var(--text);
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-decoration: none;
}

/* buttons */
.btn {
    background: var(--primary);
    border: none;
    border-radius: 4px;
    color: var(--bg-dark);
    cursor: pointer;
    display: inline-block;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: normal;
    margin: 0;   
    padding: 0.45rem 1rem;
    text-decoration: none;
}
.btn:hover { background: var(--secondary); text-decoration: none; }
.btn-secondary { background: transparent;  color: var(--text) ;  border: 1px solid; }
.btn-secondary:hover { background:var(--primary); }

/* main */
main {
    flex: 1;
    margin: 0 auto;
    max-width: 1730px;
    padding: 0rem 2rem;
    width: 100%;
}

/* page header */
.page-header { border-bottom: 2px solid; color: var(--text); margin-bottom: 1rem; margin-top:0.5rem; padding-bottom: 1rem; }
.page-header h1 { font-size: 1.8rem; }
.page-header p { margin-top: 0.25rem; }
 
.sub-header { font-size: .85rem; color:var(--text-muted); }

/* animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
 
@keyframes spinGrad {
    to { transform: rotate(360deg); }
}
 
@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

/* llm response */
.model-response {
    background: var(--llmbackground);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--llmtext);
    display: inline-block;
    font-size: 1rem;
    font-style: italic;
    padding: 0.15rem 0.6rem;
    width: 100%;
}
 
.llm span {
    display: inline-block;
    opacity: 0;
    animation: slideUp 0.3s ease forwards;
}

/*--------------------- cards ----------------------*/
/*      this includes the paper and filter cards    */
/*--------------------------------------------------*/
.papers-container {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 300px 1fr;
}
 
.paper-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* shared base between paper and filter cards */
.paper-card,
.filter-card {
    background: var(--gradient);
    border: 1px solid var(--border);
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
    transition: box-shadow 0.15s;
}
.paper-card:hover,
.filter-card:hover { background: var(--gradient-hover); box-shadow: 0 5px 16px rgba(0,0,0,0.3); }
 
.paper-card {
    padding: 1.25rem 1.5rem;
}
 
.paper-card h2 { font-size: 1.1rem; margin: 0.3rem 0 0.4rem; }
.paper-card h2 a { color: var(--text-muted) }
.paper-card h2 a:hover { text-decoration: none; }
 
.authors { font-size: 0.9rem; font-style: italic; margin-bottom: 0.4rem; }
.abstract { font-size: 0.9rem;  margin-bottom: 0.4rem; }
 
.publisher {
    background: var(--bg-light);
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    margin-bottom: -1.25rem;
    padding-left: 1.5rem;
    padding-top: .5rem;
    display: flex;
}
 
.match-reason-intro {
    display: block;
    font-style: normal;
    font-weight: bold;
}
 
.match-reason {
    background: var(--llmbackground);
    color: var(--llmtext);
    display: block;
    font-size: 0.75rem;
    font-style: italic;;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    margin-top: -1.25rem;
    padding: .5rem 1.5rem;
}
 
 
/* ── Filter Sidebar ── */
.filter-sidebar {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 1rem;
}
 
.filter-card {
    padding: 0rem 1.5rem;
    padding-bottom: 1.25rem;
}
 
.filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
 
.filter-list li { padding: 4px 0; }
 
.filter-list label {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-weight: normal;
    gap: 8px;
    margin-bottom: 0;
    width: 100%;
    word-break: break-word;
}
 
.filter-list input[type="checkbox"] {
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    width: auto;
}

.filter-actions {
    background: var(--bg-light);
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: -1.25rem -1.5rem -1rem -1.5rem;
    margin-bottom: 1rem;
    padding: 1.25rem;
    position: sticky;
    top: 0;
}
 
.filter-btn { flex-direction: row; }

/* meta tags */
.paper-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; margin-bottom: 0.5rem; }
 
.tag {
    background: var(--secondary);
    border-radius: 3px;
    color: var(--bg);
    font-family: monospace;
    font-size: 0.78rem;
    display: inline-block;
    padding: 0.15rem 0.6rem;
}
.tag-topic { background: var(--primary); color: var(--bg);}

/* paper details page  */
.paper-detail { max-width: 680px; }
.back-link { font-size: 0.9rem; display: inline-block; margin-bottom: 1rem; }
.back-link:hover { color: var(--text-muted) }
.paper-detail h1 { color: var(--text);font-size: 1.6rem; margin: 0.5rem 0 0.75rem; line-height: 1.3; }
.abstract-full { margin-top: 1.5rem; }
.abstract-full h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.abstract-full p { font-size: 0.95rem;  }
.added-date { margin-top: 2rem; font-size: 0.8rem; }

/* forms */
.paper-form { max-width: 800px; margin-bottom: 1rem; }
.form-group { margin-bottom: 1.25rem; }

.form-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
 
label { display: block; font-size: 0.9rem; font-weight: bold; margin-bottom: 0.4rem; }
.required { color: var(--warning) }
 
input, textarea {
    background-color: var(--bg-light);
    border: none;
    border-radius: 4px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.6rem 0.8rem;
    transition: border-color 0.15s;
    width: 100%;
}
input:focus, textarea:focus { outline: none; }
 
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }

/* search bar */
.search-bar {
    align-items: center;
    border-radius: 4px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.075);
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    height: 50px;
    margin-bottom: 2rem;
    justify-content: center;
    overflow: hidden;
    padding: 0 4px;
    position: relative;
    transition: box-shadow 0.15s;
    width: 100%;
}
.search-bar::before {
    background: var(--llmgradient);
    content: "";
    height: 200%;
    position: absolute;
    width: 200%;
    z-index: 0;
}
.search-bar.thinking::before {
    animation: spinGrad 1.2s linear infinite;
    background: var(--llmspingradient);
    height: 2300%;
    width: 600%;
}
.search-bar:hover { box-shadow: 0 5px 16px rgba(0,0,0,0.3); }
 
.search-bar form { align-items: center; display: flex; gap: 0.5rem; position: relative; width: 100%; }
 
.search-input {
    border: none;
    border-radius: 4px;
    box-sizing: border-box;
    height: 40px;
    letter-spacing: 0.8px;
    outline: none;
    padding-left: 15px;
    width: 100%;
}
 
.search-bar label {
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: normal;
    white-space: nowrap;
}
 
.search-bar select {
    background: var(--bg-light);
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    flex-shrink: 0;
    height: 40px;
    outline: none;
    padding: 0 0.5rem;
}

/*  footer  */
footer {
    border-top: 1px solid;
    font-size: 0.8rem;
    padding: 1.5rem;
    text-align: center;
}
 
 
/* flash messages  */
dialog {
    border: none;
    border-radius: 8px;
    box-shadow: 0 5px 16px rgba(0,0,0,0.3);
    display: block;
    left: auto;
    padding: 0;
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 1000;
}
 
/*dialog::backdrop { background: transparent; }*/
 
dialog.hide {
    animation: fadeOut 0.5s ease;
    animation-fill-mode: forwards;
    pointer-events: none;
}
.flash-message {
    color: white;
    border-radius: 8px;
    padding: 20px 30px;
}
.flash-info { background: var(--info); }


.flash-success { background-color: var(--success); }


.flash-danger { background: var(--danger); }


.flash-warning { background: var(--warning); }

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 40px; 
}


.slider-wrapper input[type="range"] {
    position: absolute;
    width: 100%;
    background: none;
    appearance: none;
    -webkit-appearance: none;
    pointer-events: none; 
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}


.slider-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: rgb(10, 226, 143);
    pointer-events: auto; 
    cursor: pointer;
}

/* fixes firefox */
.slider-wrapper input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: rgb(10, 226, 143);
    pointer-events: auto;
    cursor: pointer;
    border: none;
}


.slider-track {
    position: absolute;
    width: 100%;
    height: 4px;
    background: #ccc;
    top: 50%;
    transform: translateY(-50%);
    z-index: 0;
}
