@import url('https://pro.fontawesome.com/releases/v5.15.4/css/all.css');
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');
/* Default Styling */
:root {
    --title-font: 'Playfair Display';
    --paragraph-font: 'Nunito Sans';
    --h1: 62px;
    --h2: 42px;
    --h3: 32px;
    --h4: 22px;
    --h5: 18px;
    --p: 16px;
    --main_accent: #000;
    --topbar-bg: #252830;
    --sidebar-bg: #2f323a;
    --sidebar-dark: #22242a;
    --viewer-bg: #e5e5e5;
    --accent-blue: #4db8ff;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: #4b505b;
}

.h1, 
.h2,
.h3,
.h4,
.h5,
.h6,
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    margin-bottom: 0;
    font-family: var(--title-font);
    font-weight: 400;
}

h1 {
    font-size: var(--h1);
}

h1 * {
    font-size: var(--h1);
}

h2 {
    font-size: var(--h2);
}

h2 * {
    font-size: var(--h2);
}

h3 {
    font-size: var(--h3);
}

h3 * {
    font-size: var(--h3);
}

h4 {
    font-size: var(--h4);
}

h4 * {
    font-size: var(--h4);
}

h5 {
    font-size: var(--h5);
}

h5 * {
    font-size: var(--h5);
}

body,
p {
    font-size: var(--p);
    font-family: var(--paragraph-font);
}

a,
a:hover,
input,
input:hover,
button,
button:hover,
img,
header,
.inner_header,
.award_section a * {
    text-decoration: none !important;
    -webkit-transition: all 0.5s ease-out !important;
    -moz-transition: all 0.5s ease-out !important;
    -o-transition: all 0.5s ease-out !important;
    transition: all 0.5s ease-out !important;
}

img {
    max-width: 100%;
    height: auto;
}
.margin-bottom-15 {
    margin-bottom: 15px;
}
.margin-bottom-30 {
    margin-bottom: 30px;
}
.margin-bottom-60 {
    margin-bottom: 60px;
}
.margin-bottom-90 {
    margin-bottom: 90px;
}
.margin-bottom-120 {
    margin-bottom: 120px;
}

.margin-top-15 {
    margin-top: 15px;
}
.margin-top-30 {
    margin-top: 30px;
}
.margin-top-60 {
    margin-top: 60px;
}
.margin-top-90 {
    margin-top: 90px;
}
.margin-top-120 {
    margin-top: 120px;
}

.padding-bottom-15 {
    padding-bottom: 15px;
}
.padding-bottom-30 {
    padding-bottom: 30px;
}
.padding-bottom-60 {
    padding-bottom: 60px;
}
.padding-bottom-90 {
    padding-bottom: 90px;
}
.padding-bottom-120 {
    padding-bottom: 120px;
}

.padding-top-15 {
    padding-top: 15px;
}
.padding-top-30 {
    padding-top: 30px;
}
.padding-top-60 {
    padding-top: 60px;
}
.padding-top-90 {
    padding-top: 90px;
}
.padding-top-120 {
    padding-top: 120px;
}
.left_text {
    text-align: left;
}
.centered_text {
    text-align: center;
}
.right_text {
    text-align: right;
}
/* PDF */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--viewer-bg);
}

/* Top Navigation Bar */
.top-bar {
    background-color: var(--topbar-bg);
    color: var(--text-main);
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #1a1c23;
    z-index: 10;
}

.top-center {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.pdf-badge {
    font-size: 10px;
    font-weight: bold;
    color: var(--text-muted);
}

.top-controls button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
}

.top-controls button:hover {
    color: white;
    background-color: rgba(255,255,255,0.1);
}

/* Main Layout */
.main-container {
    display: flex;
    flex: 1;
    height: calc(100vh - 48px);
}

/* Left Sidebar */
.sidebar {
    width: 320px;
    background-color: var(--sidebar-bg);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-tabs button {
    flex: 1;
    background: var(--sidebar-dark);
    color: var(--text-muted);
    border: none;
    padding: 12px 0;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
}

.sidebar-tabs button.active {
    background: var(--sidebar-bg);
    color: white;
    border-top: 3px solid white;
}

.sidebar-content {
    padding: 24px;
}

.journal-header {
    display: flex;
    gap: 16px;
    margin-bottom: 30px;
    font-size: 13px;
    color: var(--text-muted);
}

.journal-cover {
    width: 80px;
    height: auto;
    border: 1px solid #fff;
}

.journal-header a {
    color: white;
    text-decoration: underline;
    display: block;
    margin-bottom: 4px;
}

.article-meta h2 {
    font-size: 16px;
    line-height: 1.4;
    margin: 8px 0;
    font-weight: 500;
}

.article-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.accent-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    display: inline-block;
    margin: 12px 0;
}

.authors {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.cite-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 16px;
}

.meta-table {
    width: 100%;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.meta-table td {
    padding: 4px 0;
    vertical-align: top;
}

.meta-table td:first-child {
    width: 40%;
}

.meta-table strong {
    color: white;
}

/* PDF Viewer Area */
.viewer-area {
    flex: 1;
    position: relative;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 32px;
}

.floating-tools {
    position: fixed;
    left: 336px; /* Offset past sidebar */
    top: 64px;
    background: white;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    padding: 8px 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 5;
}

.floating-tools button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #555;
    border-radius: 50%;
}

.floating-tools button:hover {
    background: #f0f0f0;
}

.canvas-container {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin: 0 auto;
}

canvas {
    display: block;
}
/* Makes the text layer perfectly overlay the canvas */
#viewer-wrapper {
    position: relative;
    display: inline-block;
}

#the-canvas {
    z-index: 1; 
}

#text-layer { 
   position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.7;
    line-height: 1.0;
    /* CRITICAL: Force 100% so it perfectly matches the canvas size, bypassing buggy round() math */
        width: 100% !important; 
        height: 100% !important;
}
.textLayer span {
        color: rgba(255, 0, 0, 0.4); /* Keep red temporarily to verify the fix */
        position: absolute;
        white-space: pre;
        cursor: text;
        transform-origin: 0% 0%;
        line-height: 1;

        /* THE CRITICAL MISSING PIECES */
        font-size: calc(var(--font-height) * var(--scale-factor)) !important;
        transform: scaleX(var(--scale-x)) !important;
    }
#text-layer > div {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

/* Forces the blue highlight to appear */
.text-layer ::selection {
    background: rgba(0, 0, 255, 0.3) !important; 
    color: rgba(0, 0, 0, 0) !important; 
}