/* ============================================
   CSS Variables for Theming
   ============================================ */
:root {
    --background-color: #ffffff;
    --background-secondary: #f5f5f5;
    --text-color: #2d3748;
    --text-muted: #64748b;
    --heading-color: #1e293b;
    
    /* Header */
    --header-bg: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    --header-text: #ffffff;
    --header-border: transparent;
    
    /* Vibrant blue gradient for buttons */
    --accent-gradient: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.15);
    
    --border-color: rgba(148, 163, 184, 0.3);
    --table-header-bg: rgba(59, 130, 246, 0.12);
    --table-highlight: rgba(59, 130, 246, 0.08);
}

body.dark-mode {
    --background-color: #121212;
    --background-secondary: #1e1e1e;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --heading-color: #f1f5f9;
    
    /* Header */
    --header-bg: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    --header-text: #f1f5f9;
    --header-border: #1e3a8a;
    
    --accent-gradient: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.15);
    
    --border-color: rgba(71, 85, 105, 0.5);
    --table-header-bg: rgba(59, 130, 246, 0.15);
    --table-highlight: rgba(59, 130, 246, 0.1);
}

/* ============================================
   Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
    min-height: 100vh;
}

/* Background element (kept for structure but no gradient) */
.bg-gradient {
    display: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    color: var(--heading-color);
    line-height: 1.3;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Card Components (simplified)
   ============================================ */
.glass-card {
    background: var(--background-secondary);
    border-radius: 16px;
}

/* ============================================
   Header
   ============================================ */
header {
    background: var(--header-bg);
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--header-border);
}

header h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    color: var(--header-text);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.authors {
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: var(--header-text);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.authors a {
    color: var(--header-text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.authors a:hover {
    opacity: 0.85;
}

.affiliations {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.25rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.contributions {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    margin-bottom: 0.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.tldr {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-color);
    text-align: center;
    margin: 1.5rem auto 1rem;
    line-height: 1.6;
}

.venue {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--header-text);
    margin-top: 0.75rem;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: inline-block;
}

.icon-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--header-text);
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* ============================================
   Main Content
   ============================================ */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 1.5rem 4rem;
}

section {
    margin-bottom: 3rem;
}

section h2 {
    font-size: 1.6rem;
    margin-bottom: 1.25rem;
    color: var(--heading-color);
}

section p {
    margin-bottom: 1rem;
}

.content-card {
    padding: 1.5rem 2rem;
}

.content-card p:last-child {
    margin-bottom: 0;
}


/* ============================================
   Action Buttons
   ============================================ */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1rem 0 2.5rem;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-gradient);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.link-button:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.link-button.disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

.link-button.disabled:hover {
    transform: none;
    box-shadow: none;
}

.link-button i {
    font-size: 1.1rem;
}

/* ============================================
   Hero/Teaser Figure
   ============================================ */
.hero-figure {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-figure img {
    border-radius: 8px;
    display: block;
    margin: 0 auto 1.5rem;
}

.figure-full {
    width: 100%;
}

.figure-small {
    max-width: 400px;
    width: 100%;
    margin-bottom: 0;
}

.figure-caption {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0 auto 1.5rem;
}

/* ============================================
   Subfigure Layout (side-by-side images)
   ============================================ */
.subfigure-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0 1rem;
    flex-wrap: wrap;
}

.subfigure {
    flex: 0 1 45%;
    text-align: center;
}

.subfigure img {
    width: 100%;
    border-radius: 8px;
    display: block;
    margin-bottom: 0.5rem;
}

.subfigure-caption {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

@media screen and (max-width: 600px) {
    .subfigure-container {
        flex-direction: column;
        align-items: center;
    }
    
    .subfigure {
        flex: 0 1 80%;
        max-width: 350px;
    }
}

/* ============================================
   Abstract & Method
   ============================================ */
#abstract .abstract-text,
#method p,
#results p,
#acknowledgements p {
    font-size: 1.02rem;
    text-align: justify;
    hyphens: auto;
}

#method h2 {
    margin-top: 2.5rem;
}

#method h2:first-of-type {
    margin-top: 0;
}

#method h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

#method ul,
#method ol {
    margin: 1rem 0 1rem 1.5rem;
}

#method li {
    margin-bottom: 0.5rem;
}

#method li ul,
#method li ol {
    margin-top: 0.5rem;
}

.equation {
    text-align: center;
    margin: 1.25rem 0;
    overflow-x: auto;
}

#method .content-card {
    margin-bottom: 0.5rem;
}

.method-figure,
.results-figure {
    margin-top: 1.5rem;
    text-align: center;
}

.method-figure img,
.results-figure img {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

/* ============================================
   Results Table
   ============================================ */
.table-container {
    overflow-x: auto;
    padding: 1rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 1rem 1.25rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    background: var(--table-header-bg);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--heading-color);
}

.results-table th:first-child {
    border-radius: 8px 0 0 0;
}

.results-table th:last-child {
    border-radius: 0 8px 0 0;
}

.results-table td {
    font-size: 0.95rem;
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.results-table tbody tr:hover {
    background: var(--accent-light);
}

.highlight-row {
    background: var(--table-highlight) !important;
}

.highlight-row td {
    color: var(--accent-color);
}

/* ============================================
   Video Container
   ============================================ */
.video-container {
    position: relative;
    width: 100%;
    padding: 1rem;
    overflow: hidden;
}

.video-container iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
}

/* ============================================
   Citation
   ============================================ */
.citation-container {
    position: relative;
    padding: 1.5rem;
    padding-right: 3.5rem;
}

.citation {
    text-align: left;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.88rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    color: var(--text-color);
}

.copy-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--accent-gradient);
    border: none;
    color: #ffffff;
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.copy-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.copy-button.copied {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

/* ============================================
   Footer
   ============================================ */
footer {
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
}

footer a {
    font-weight: 500;
}

/* ============================================
   Responsive Design
   ============================================ */
@media screen and (max-width: 768px) {
    header {
        padding: 2rem 1rem;
    }
    
    .header-content {
        padding: 1.5rem 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
        padding-left: 0;
        padding-right: 0;
    }
    
    .authors {
        font-size: 1rem;
        padding-left: 0;
        padding-right: 0;
    }
    
    .affiliations,
    .contributions {
        padding-left: 0;
        padding-right: 0;
    }
    
    main {
        padding: 1rem 1rem 3rem;
    }
    
    section h2 {
        font-size: 1.4rem;
    }
    
    .action-buttons {
        gap: 0.75rem;
    }
    
    .link-button {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .content-card {
        padding: 1.25rem 1.25rem;
    }
}

@media screen and (max-width: 480px) {
    .results-table th,
    .results-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
}

