/* COLOR VARIABLES (Default: Dark Mode)
----------------------------------------------------------*/

:root {
    --bg-color: #090d16;
    --dot-color: #1e293b;
    --card-bg: #161e2e;
    --card-border: #2d3748;
    --header-bg: #27303f;
    --text-color: #d1d5db;
    --heading-color: #f9fafb;
    
    --link-color: #e2e8f0;
    --link-hover: #ffffff;
    --link-hover-border: #9ca3af;
    --link-active: #9ca3af;

    --footer-text: #6b7280;
    
    --nav-bg: #111827;
    --tab-bg: #1f2937;
    --tab-border: #374151;
    --tab-hover: #374151;
    --tab-active: #27303f;

    --box-bg: #111827;
    --input-bg: #161e2e;
    --input-border: #4b5563;
    --input-focus-border: #9ca3af;
    --textarea-bg: #0f172a;
    --textarea-border: #334155;
    --textarea-text: #e2e8f0;

    --resource-label: #f3f4f6;
    --resource-border: #374151;

    --pub-border: #1f2937;
    --pub-counter: #6b7280;
    --pub-meta: #9ca3af;
    --pub-author-sep: #4b5563;

    --btn-bg: #1f2937;
    --btn-border: #374151;
    --btn-text: #d1d5db;
    --btn-hover-bg: #374151;
    --btn-hover-border: #4b5563;
    --btn-accent-text: #38bdf8;
    
    --repo-group-bg: #111827;
    --repo-title-bg: #161e2e;
    --repo-arrow: #9ca3af;
    --repo-arrow-active: #60a5fa;

    --shadow-color: rgba(0, 0, 0, 0.6);
}

/* LIGHT MODE OVERRIDES
----------------------------------------------------------*/

@media (prefers-color-scheme: light) {
    :root {
        --bg-color: #f8fafc;
        --dot-color: #cbd5e1;
        --card-bg: #ffffff;
        --card-border: #e2e8f0;
        --header-bg: #f1f5f9;
        --text-color: #334155;
        --heading-color: #0f172a;
        
        --link-color: #1e293b;
        --link-hover: #0284c7;
        --link-hover-border: #0284c7;
        --link-active: #0369a1;

        --footer-text: #64748b;
        
        --nav-bg: #e2e8f0;
        --tab-bg: #f1f5f9;
        --tab-border: #cbd5e1;
        --tab-hover: #e2e8f0;
        --tab-active: #cbd5e1;

        --box-bg: #f8fafc;
        --input-bg: #ffffff;
        --input-border: #cbd5e1;
        --input-focus-border: #0284c7;
        --textarea-bg: #f1f5f9;
        --textarea-border: #cbd5e1;
        --textarea-text: #334155;

        --resource-label: #1e293b;
        --resource-border: #e2e8f0;

        --pub-border: #e2e8f0;
        --pub-counter: #64748b;
        --pub-meta: #64748b;
        --pub-author-sep: #94a3b8;

        --btn-bg: #f1f5f9;
        --btn-border: #cbd5e1;
        --btn-text: #334155;
        --btn-hover-bg: #e2e8f0;
        --btn-hover-border: #94a3b8;
        --btn-accent-text: #0284c7;
        
        --repo-group-bg: #f8fafc;
        --repo-title-bg: #f1f5f9;
        --repo-arrow: #64748b;
        --repo-arrow-active: #0284c7;

        --shadow-color: rgba(0, 0, 0, 0.08);
    }
}

/* DEFAULTS
----------------------------------------------------------*/

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    font-family: Verdana, Geneva, "DejaVu Sans", sans-serif;
    font-size: 1.05rem; 
    background-image: radial-gradient(var(--dot-color) 0.75px, transparent 0.75px);
    background-size: 16px 16px;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
}

a:link, a:visited {
    color: var(--link-color);
    text-decoration: none;
    padding-bottom: 2px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
    color: var(--link-hover);
    border-bottom: 1px solid var(--link-hover-border);
}

a:active {
    color: var(--link-active);
}

p {
    margin-top: 0;
    margin-bottom: 1.25rem;
}

/* HEADINGS   
----------------------------------------------------------*/

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    font-variant: small-caps;
    text-transform: none;
    font-weight: 400;
    margin-top: 0;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

h1 {
    font-size: 1.85rem;
    font-weight: 700;
}

h2 {
    font-size: 1.45rem;
    font-weight: 600;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
}

h5, h6 {
    font-size: 1rem;
}

.rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2 {
    margin-top: 0;
}

/* PRIMARY LAYOUT ELEMENTS   
----------------------------------------------------------*/

.page {
    max-width: 960px;
    width: 92%;
    background-color: var(--card-bg);
    margin: 30px auto;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    box-shadow: 0 12px 30px var(--shadow-color);
    overflow: hidden;
}

.header {
    position: relative;
    margin: 0;
    padding: 1.25rem;
    background: var(--header-bg);
    width: 100%;
}

.header h1 {
    font-weight: 700;
    margin: 0;
    padding: 0;
    color: var(--heading-color);
    border: none;
    line-height: 1.2;
    font-size: 2rem;
}

.main {
    padding: 1.5rem;
    min-height: 420px;
}

.leftCol {
    padding: 0.5rem 0;
    margin: 1rem 0;
    width: 100%;
    max-width: 200px;
    min-height: 200px;
}

.footer {
    color: var(--footer-text);
    padding: 1.5rem 1rem;
    margin: 0 auto;
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid var(--card-border);
}

/* TAB MENU   
----------------------------------------------------------*/

div.hideSkiplink {
    background-color: var(--nav-bg);
    width: 100%;
}

div.menu {
    padding: 0;
}

div.menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
}

div.menu ul li {
    margin: 0;
}

div.menu ul li a, div.menu ul li a:visited {
    background-color: var(--tab-bg);
    border: none;
    border-right: 1px solid var(--tab-border);
    color: var(--text-color);
    display: block;
    line-height: 1.35em;
    padding: 10px 20px;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
    transition: background-color 0.15s ease, color 0.15s ease;
}

div.menu ul li a:hover {
    background-color: var(--tab-hover);
    color: var(--heading-color);
    text-decoration: none;
}

div.menu ul li a:active {
    background-color: var(--tab-active);
    color: var(--heading-color);
    text-decoration: none;
}

/* FORM ELEMENTS & PGP TEXTAREA
----------------------------------------------------------*/

fieldset {
    margin: 1.5em 0;
    padding: 1.25em;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    background-color: var(--box-bg);
}

fieldset p {
    margin: 0.25rem 0 0.75rem 0;
}

fieldset.login label, fieldset.register label, fieldset.changePassword label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

fieldset label.inline {
    display: inline;
}

legend {
    font-size: 1.1em;
    font-weight: 700;
    padding: 0 6px;
    color: var(--heading-color);
}

input.textEntry, input.passwordEntry {
    width: 100%;
    max-width: 320px;
    padding: 6px 10px;
    background-color: var(--input-bg);
    color: var(--heading-color);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input.textEntry:focus, input.passwordEntry:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.2);
}

textarea {
    background-color: var(--textarea-bg);
    color: var(--textarea-text);
    border: 1px solid var(--textarea-border);
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s ease;
}

textarea:focus {
    border-color: var(--input-focus-border);
}

div.accountInfo {
    width: 100%;
    max-width: 420px;
}

/* MISC  
----------------------------------------------------------*/

.clear {
    clear: both;
}

.title {
    display: block;
    float: left;
    text-align: left;
    width: auto;
}

.loginDisplay {
    font-size: 0.95rem;
    display: block;
    text-align: right;
    padding: 10px 15px;
    color: var(--text-color);
}

.loginDisplay a:link, .loginDisplay a:visited, .loginDisplay a:hover {
    color: var(--heading-color);
    text-decoration: underline;
}

.failureNotification {
    font-size: 1.1em;
    color: #ef4444;
    font-weight: 700;
}

.bold {
    font-weight: bold;
}

.submitButton {
    text-align: right;
    padding-right: 10px;
    margin-top: 10px;
}

.academic-links {
    margin: 1.5rem 0;
    padding: 0.75rem 0;
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.academic-links a {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.academic-links a:hover {
    color: var(--heading-color);
}

.resources-grid {
    display: flex;
    gap: 3.5rem;
    margin: 1.75rem 0;
}

.resource-label {
    display: block;
    font-family: Verdana, Geneva, "DejaVu Sans", sans-serif;
    font-size: 1.35rem;
    font-variant: small-caps;
    font-weight: 900;
    letter-spacing: 0.06em;
    color: var(--resource-label);
    border-bottom: 1px solid var(--resource-border);
    margin-bottom: 0.85rem;
}

.resources-grid ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resources-grid li {
    margin-bottom: 0.4rem;
}

.resources-grid a {
    font-size: 0.95rem;
    font-weight: 600;
}

/* PUBLICATIONS PAGE COMPONENT
----------------------------------------------------------*/

.pub-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    counter-reset: pub-counter;
}

.pub-item {
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--pub-border);
    counter-increment: pub-counter;
}

.pub-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pub-item::before {
    content: "[" counter(pub-counter) "]";
    position: absolute;
    left: 0;
    top: 0;
    font-family: Verdana, Geneva, "DejaVu Sans", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--pub-counter);
}

.pub-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--resource-label);
    line-height: 1.4;
    margin-bottom: 0.35rem;
}

.pub-meta {
    font-size: 0.9rem;
    color: var(--pub-meta);
    margin-bottom: 0.75rem;
}

.pub-authors {
    color: var(--text-color);
}

.pub-authors::after {
    content: " • ";
    color: var(--pub-author-sep);
    margin: 0 0.25rem;
}

.pub-journal {
    font-style: italic;
    color: var(--pub-meta);
}

.pub-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pub-btn {
    display: inline-flex;
    align-items: center;
    background-color: var(--btn-bg);
    color: var(--btn-text) !important;
    border: 1px solid var(--btn-border);
    border-radius: 4px;
    padding: 3px 10px;
    font-family: Verdana, Geneva, "DejaVu Sans", sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.pub-btn:hover {
    background-color: var(--btn-hover-bg);
    color: var(--heading-color) !important;
    border-color: var(--btn-hover-border);
    transform: translateY(-1px);
}

.nav-footer {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--pub-border);
}

.back-btn {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.pub-btn-disabled,
.pub-btn-disabled:hover {
    background-color: var(--box-bg);
    color: var(--pub-counter) !important;
    border-color: var(--pub-border);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none;
}

/* COLLAPSIBLE CATEGORY CONTAINERS
----------------------------------------------------------*/

.repo-group {
    background-color: var(--repo-group-bg);
    border: 1px solid var(--pub-border);
    border-radius: 6px;
    margin-bottom: 1.25rem;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.repo-group[open] {
    border-color: var(--btn-border);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.repo-group-title {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    font-family: Verdana, Geneva, "DejaVu Sans", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--resource-label);
    background-color: var(--repo-title-bg);
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.repo-group-title::-webkit-details-marker {
    display: none;
}

.repo-group-title::before {
    content: "▶";
    display: inline-block;
    font-size: 0.7rem;
    color: var(--repo-arrow);
    margin-right: 0.75rem;
    transition: transform 0.2s ease, color 0.15s ease;
}

.repo-group[open] .repo-group-title::before {
    transform: rotate(90deg);
    color: var(--repo-arrow-active);
}

.repo-group-title:hover {
    background-color: var(--btn-hover-bg);
    color: var(--heading-color);
}

.repo-group-title:hover::before {
    color: var(--heading-color);
}

.repo-count {
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--pub-meta);
    margin-left: 0.35rem;
}

/* COMPACT FILE LIST FORMAT INSIDE CATEGORIES
----------------------------------------------------------*/

.repo-list {
    list-style: none;
    padding: 0.5rem 1.25rem;
    margin: 0;
}

.repo-item-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--pub-border);
}

.repo-item-compact:last-child {
    border-bottom: none;
}

.repo-left-content {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.repo-title-compact {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
}

.repo-date-compact {
    font-size: 0.82rem;
    font-family: "Courier New", Courier, monospace;
    color: var(--pub-meta);
}

.repo-btn-compact {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    background-color: var(--btn-bg);
    color: var(--btn-accent-text);
    text-decoration: none;
    border: 1px solid var(--btn-border);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.repo-btn-compact:hover {
    background-color: var(--btn-hover-bg);
    border-color: var(--btn-hover-border);
    color: var(--heading-color);
}
.credential-box {
    background-color: var(--repo-group-bg);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1.5rem;
    font-size: 0.92rem;
}

.credential-main {
    margin-bottom: 0.4rem;
}

.credential-degree {
    font-weight: 700;
    color: var(--heading-color);
}

.credential-sep {
    color: var(--pub-author-sep);
    margin: 0 0.35rem;
}

.credential-org {
    color: var(--text-color);
}

.credential-details {
    color: var(--pub-meta);
    font-size: 0.88rem;
    line-height: 1.45;
}

.credential-label {
    font-weight: 600;
    color: var(--resource-label);
    margin-right: 0.3rem;
}

.credential-thesis-link {
    color: var(--btn-accent-text);
    font-weight: 500;
}
