/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    font-size: 16px;
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 30px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #222;
}

h1 {
    font-size: 2.2em;
    line-height: 1.2;
    text-align: center;
    margin-bottom: 0.3em;
}

h2 {
    font-size: 1.4em;
    /* margin-top: 1.5em; */
    margin-bottom: 0.8em;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.3em;
}

h3 {
    font-size: 1.2em;
    margin-top: 2em;
    margin-bottom: 0em;
    padding-bottom: 0em;
    color: #333;
    font-weight: 600;
}

/* Special styling for RF findings */
h3 {
    /* border-bottom: 2px solid #f0f0f0; */
    /* padding-bottom: 0.3em; */
    /* margin-bottom: 1.2em; */
    position: relative;
}

h3::before {
    content: "";
    position: absolute;
    left: -1em;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #0066cc;
    border-radius: 2px;
}

p {
    margin-bottom: 1em;
    text-align: justify;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2em;
}

.title {
    font-size: 2.2em;
    font-weight: 700;
    color: #222;
    margin-bottom: 0.5em;
}

.subtitle {
    font-weight: 600;
    color: #555;
    display: block;
    font-size: 0.9em;
    margin-top: 0.2em;
}

.authors {
    margin: 1.5em 0;
}

.author-info {
    margin-bottom: 0.5em;
}

.author-name {
    font-size: 1.1em;
    font-weight: 500;
    color: #333;
}

.affiliation {
    color: #666;
    font-size: 0.95em;
}

.conference-info {
    font-size: 1.1em;
    margin: 1em 0;
    color: #444;
}

.links {
    margin: 1.5em 0;
    font-size: 1em;
}

.links a {
    color: #0066cc;
    text-decoration: none;
    margin: 0 0.2em;
}

.links a:hover {
    text-decoration: underline;
}

/* Sections */
.section {
    margin: 3em 0;
}

.section:first-of-type {
    margin-top: 2em;
}

.section-intro {
    background-color: #f8f9fa;
    border-left: 4px solid #0066cc;
    padding: 1.2em 1.8em;
    margin: 1.5em 0 2.5em 0;
    border-radius: 0 6px 6px 0;
    font-size: 1.05em;
    line-height: 1.7;
}

.section-intro p {
    margin: 0;
    color: #444;
}

/* Horizontal rules */
hr {
    border: none;
    height: 1px;
    background-color: #e0e0e0;
    margin: 3em 0;
    opacity: 0.8;
}

/* Lists */
ul, ol {
    margin-left: 1.5em;
    margin-bottom: 1.2em;
}

li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

/* Improve list styling in results sections */
.section ul li {
    position: relative;
    padding-left: 0.5em;
}

.section ul li::marker {
    color: #0066cc;
    font-weight: 600;
}

.outline {
    list-style: none;
    margin-left: 0;
}

.outline li {
    margin-bottom: 0.4em;
}

.outline a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.outline a:hover {
    text-decoration: underline;
}

/* Abstract and key content */
.abstract-text {
    font-size: 1.05em;
    line-height: 1.7;
}

.key-contributions {
    background-color: #f8f9fa;
    border: 1px solid #e3f2fd;
    border-left: 4px solid #0066cc;
    padding: 1.5em 2em;
    margin: 2em 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.key-contributions p {
    margin-bottom: 0.8em;
    font-weight: 600;
    color: #333;
}

.key-contributions ol {
    margin-top: 0.8em;
    margin-bottom: 0;
}

.key-contributions li {
    margin-bottom: 1em;
    line-height: 1.6;
}

.key-contributions li:last-child {
    margin-bottom: 0;
}

/* Methodology box */
.methodology-box {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    padding: 1.5em;
    margin: 1.5em 0;
    border-radius: 4px;
}

.methodology-box p:last-child {
    margin-bottom: 0;
}

/* Algorithm box */
.algorithm-box {
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    padding: 1.5em;
    margin: 1.5em 0;
    border-radius: 4px;
}

.algorithm-box ol {
    margin-bottom: 1em;
}

.algorithm-box p {
    font-weight: 600;
    margin-bottom: 0.5em;
    color: #333;
}

/* Results highlight */
.results-highlight {
    background: linear-gradient(135deg, #e8f4f8 0%, #f0f8ff 100%);
    border: 1px solid #b8e0d2;
    padding: 1.5em 2em;
    margin: 2em 0;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.results-highlight p {
    margin: 0;
    font-weight: 600;
    color: #1a4a2d;
    font-size: 1.1em;
}

/* Figures */
.figure-container {
    text-align: center;
    margin: 2.5em 0;
    background-color: #fbfbfb;
    border: 1px solid #e8e8e8;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s ease;
}

.figure-container:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.main-figure {
    max-width: 100%;
    height: auto;
    /* margin-bottom: 1.5em; */
    /* border: 1px solid #ddd; */
    /* border-radius: 6px; */
    /* box-shadow: 0 2px 6px rgba(0,0,0,0.08); */
}

.figure-fallback {
    color: #666;
    font-style: italic;
    background-color: #f8f8f8;
    border: 2px dashed #ccc;
    padding: 2em;
    border-radius: 6px;
}

.figure-fallback a {
    color: #0066cc;
    font-weight: 600;
    text-decoration: none;
}

.figure-fallback a:hover {
    text-decoration: underline;
}

.caption {
    text-align: left;
    color: #555;
    font-size: 0.92em;
    line-height: 1.6;
    border-top: 1px solid #e8e8e8;
    padding-top: 1.2em;
    margin-top: 0.8em;
}

.caption strong {
    color: #222;
    font-weight: 600;
}

.caption small {
    color: #777;
    font-size: 0.88em;
}

.caption small a {
    color: #0066cc;
}

/* Equations */
.equation {
    text-align: center;
    margin: 1.5em 0;
    padding: 1em;
    background-color: #f9f9f9;
    border-radius: 4px;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1.5em;
    margin: 1.5em 0;
    font-style: italic;
    color: #555;
}

/* Citation section */
.citation-container {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin: 1.5em 0;
    position: relative;
}

.citation-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    flex: 1;
    padding: 0.8em;
    border: none;
    background: #f1f3f4;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s;
}

.tab-btn:hover {
    background: #e8eaed;
}

.tab-btn.active {
    background: #fff;
    border-bottom: 2px solid #0066cc;
}

.citation-content {
    display: none;
    padding: 1.5em;
}

.citation-content.active {
    display: block;
}

.citation-content pre {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1em;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85em;
    margin: 0;
}

.citation-content code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85em;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0066cc;
    color: white;
    border: none;
    padding: 0.4em 0.8em;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background: #004499;
}

.copy-btn.copied {
    background: #28a745;
}

/* Links */
a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Strong text */
strong {
    font-weight: 600;
    color: #222;
}

/* Code styling for model names and dataset names */
code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95em;
}

/* Footer */
.footer {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    border-top: 1px solid #eee;
    padding-top: 2em;
    margin-top: 3em;
}

.footer p {
    margin-bottom: 0.5em;
}

/* Responsive design */
@media (max-width: 1024px) {
    .container {
        max-width: 90%;
        padding: 30px 25px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .title {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.3em;
    }
    
    .citation-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        border-bottom: 1px solid #ddd;
    }
    
    .tab-btn:last-child {
        border-bottom: none;
    }
    
    .tab-btn.active {
        border-bottom: 1px solid #ddd;
        border-left: 4px solid #0066cc;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.5em;
    }
    
    .subtitle {
        font-size: 0.85em;
    }
    
    h2 {
        font-size: 1.2em;
    }
    
    ul, ol {
        margin-left: 1.2em;
    }
}

/* Print styles */
@media print {
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    hr {
        border-top: 1px solid #000;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .citation-tabs,
    .copy-btn {
        display: none;
    }
    
    .citation-content {
        display: block !important;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Subtle animations */
.section {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for sections */
.section:nth-child(2) { animation-delay: 0.1s; }
.section:nth-child(3) { animation-delay: 0.2s; }
.section:nth-child(4) { animation-delay: 0.3s; }
.section:nth-child(5) { animation-delay: 0.4s; }

/* Improved focus states */
a:focus, button:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Selection colors */
::selection {
    background: rgba(0, 102, 204, 0.2);
    color: #000;
}

::-moz-selection {
    background: rgba(0, 102, 204, 0.2);
    color: #000;
}

/* Improved table of contents */
.outline li {
    transition: all 0.2s ease;
}

.outline li:hover {
    transform: translateX(4px);
}

/* Enhanced responsiveness for readability */
@media (max-width: 600px) {
    .section-intro {
        padding: 1em 1.2em;
        font-size: 1em;
    }
    
    .key-contributions {
        padding: 1.2em 1.5em;
    }
    
    h3:nth-of-type(n+2)::before {
        display: none;
    }
}