/* Google Fonts: Lora for headings, Lato for body */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=Lato:wght@400;700&display=swap');

:root {
    --font-heading: 'Lora', serif;
    --font-body: 'Lato', sans-serif;
    
    --color-text: #34495e;
    --color-text-secondary: #7f8c8d;
    --color-accent: #2980b9;
    --color-accent-darker: #2c3e50;
    --color-bg: #ffffff;
    --color-bg-light: #f8f9f9;
    --color-border: #ecf0f1;

    --layout-max-width: 1000px;
    --border-radius-main: 6px;
}

/* Basic Reset and Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.65;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    zoom: 1.3;
}

.container {
    max-width: var(--layout-max-width);
    margin: 0 auto;
    padding: 70px 25px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

h1 {
    font-family: var(--font-heading);
    font-size: 1.9em;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 20px;
}

.authors {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 15px;
    margin-bottom: 12px;
    font-size: 1.05em;
}

.author a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}
.author a:hover {
    color: var(--color-accent);
}
.author sup {
    color: var(--color-accent);
    font-weight: bold;
}

.affiliations {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    line-height: 1.0;
}
.affiliation {
    display: inline-block;
    margin: 4px 10px;
}

/* Redesigned venue block */
.venue {
    margin-top: 12px;
    color: var(--color-accent);
    font-weight: 700;
    font-style: italic;
    font-size: 0.95em;
}

/* Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 3px 9px;
    background-color: white;
    color: var(--color-accent);
    text-decoration: none;
    border-radius: var(--border-radius-main);
    font-weight: 700;
    font-size: 0.95em;
    transition: all 0.25s ease;
    border: 2px solid var(--color-accent);
}
.btn:hover {
    background-color: var(--color-accent);
    color: var(--color-bg);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
}
.btn svg {
    width: 20px;
    height: 20px;
}
        
/* New Fixed Global Controls */
.top-controls {
    position: fixed;
    top: 20px;
    right: 25px;
    z-index: 1010;
    display: flex;
    gap: 10px;
}
.control-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
    position: relative; /* Added for tooltip positioning */
}
.control-btn:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    transform: translateY(-2px);
}
.control-btn svg {
    width: 20px;
    height: 20px;
}

/* Tooltip base style */
.tooltip {
    position: absolute;
    background: var(--color-accent-darker);
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Tooltip for side nav */
.side-nav .tooltip {
    right: 28px;
    top: 50%;
    transform: translateY(-50%) translateX(5px); /* Start slightly to the right */
}
.side-nav .nav-dot:hover .tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Tooltip for top controls */
.top-controls .tooltip {
    top: 110%; /* Position below the button */
    left: 50%;
    transform: translateX(-50%) translateY(-5px); /* Start slightly up */
}
.top-controls .control-btn:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* Sections */
.section {
    margin-bottom: 25px;
    scroll-margin-top: 40px;
}
.section-title {
    font-family: var(--font-heading);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
}
.section-content {
    line-height: 1.5;
}
.section-content p {
    margin-bottom: 1em;
}

/* TL;DR Section */
.tldr {
    background: var(--color-bg-light);
    padding: 25px;
    border-radius: var(--border-radius-main);
    margin-bottom: 35px;
    border-left: 4px solid var(--color-accent);
    text-align: justify;
}
.tldr-title {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 10px;
    font-size: 1.2em;
    border-bottom: none;
    padding-bottom: 0;
}
/* Fix for TLDR bottom spacing */
.tldr .section-content p:last-child {
    margin-bottom: 0;
}
        
.abstract {
    text-align: justify;
}
.placeholder-text {
    color: var(--color-text-secondary);
    font-style: italic;
}
.motivation {
    text-align: justify;
}
.methodology {
    text-align: justify;
}
.framework {
    text-align: justify;
}
.case {
    text-align: justify;
}
.conclusion {
    text-align: justify;
}

/* Side Navigation */
.side-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #bdc3c7;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}
.nav-dot:hover, .nav-dot.active {
    border-color: var(--color-accent);
    transform: scale(1.3);
}
.nav-dot.active {
    background-color: var(--color-accent);
}
        
/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(44, 62, 80, 0.7);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.visible { opacity: 1; pointer-events: auto; }
.modal-content {
    background: var(--color-bg); padding: 30px;
    border-radius: var(--border-radius-main); width: 90%; max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transform: scale(0.95); transition: transform 0.3s ease;
}
.modal-overlay.visible .modal-content { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-family: var(--font-heading); font-size: 1.4em; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 2em; line-height: 1; color: var(--color-text-secondary); transition: color 0.2s ease; }
.modal-close:hover { color: var(--color-text); }
#bibtex-code {
    width: 100%; height: 250px; font-family: "Courier New", Consolas, monospace; font-size: 0.9em;
    background: var(--color-bg-light); border: 1px solid var(--color-border); text-align: justify;
    border-radius: var(--border-radius-main); padding: 15px; resize: none; color: var(--color-text);
    white-space: pre; tab-size: 4; line-height: 1.5;
}
.modal-actions { margin-top: 20px; text-align: right; }
#copy-bibtex-btn {
    padding: 10px 20px; border: none; background: var(--color-accent);
    color: white; font-weight: 700; border-radius: var(--border-radius-main);
    cursor: pointer; transition: background-color 0.2s ease; min-width: 150px;
}
#copy-bibtex-btn:hover { background-color: #3498db; }
        
/* Footer */
.footer { margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--color-border); text-align: center; color: var(--color-text-secondary); font-size: 0.9em; }

/* Scroll Animation */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1100px) {
    .side-nav { display: none; }
}
@media (max-width: 768px) {
    body { font-size: 16px; }
    h1 { font-size: 2.2em; }
    .container { padding: 50px 20px; }
    .top-controls { top: 15px; right: 15px; }
    .action-buttons { flex-direction: column; align-items: center; }
    .btn { width: 220px; justify-content: center; }
}

/* Methodology figure */
.methodology-figure {
    margin: 15px 0;
    padding: 0;
    border: none;
    background: none;
}

.methodology-figure img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.methodology-figure figcaption {
    margin-top: 10px;
    text-align: justify;
    font-size: 0.9em;
    color: var(--color-text-secondary);
    font-style: italic;
    line-height: 1.4;
}
