/* ===================================
   Selective Steering - Academic Project Page
   Light Theme - Clean Academic Design
   =================================== */

/* CSS Reset & Variables */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --accent: #ec4899;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-gray: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Aptos Serif', 'Georgia', 'Times New Roman', serif;
    background: var(--bg-white);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    font-size: 18px;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: 'Aptos Serif', 'Georgia', 'Times New Roman', serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

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

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-gray);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation - Hidden for cleaner look */
.navbar {
    display: none;
}

/* Hero Section - Academic Style */
.hero {
    padding: 4rem 2rem 2rem;
    text-align: center;
    background: var(--bg-white);
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: none;
}

.hero-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    line-height: 1.35;
}

.hero-title .highlight {
    color: var(--primary);
}

.hero-subtitle {
    display: none;
}

/* Authors */
.authors {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.author {
    display: inline;
}

.author-name {
    color: var(--primary);
    font-weight: 500;
}

.author-name:hover {
    text-decoration: underline;
}

.author sup {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.author-separator {
    color: var(--text-muted);
}

.author-note {
    display: block;
    width: 100%;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Affiliations */
.affiliations {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.affiliations p {
    margin: 0.15rem 0;
    display: inline;
}

.affiliations sup {
    color: var(--primary);
    font-weight: 500;
}

.affiliations-inline {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

/* Buttons */
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-icon {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--text-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary);
    color: white;
    text-decoration: none;
}

.btn-secondary {
    background: var(--text-primary);
    color: white;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    text-decoration: none;
}

.btn-outline {
    background: var(--text-primary);
    color: white;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    text-decoration: none;
}

/* Hero Stats - Prominent Display */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    background: linear-gradient(90deg, transparent, var(--bg-light), transparent);
    border-radius: 8px;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Teaser Section - Like RoboVIP */
.teaser-section {
    padding: 2rem;
    background: var(--bg-white);
}

.teaser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.teaser-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.teaser-item img {
    width: 100%;
    height: auto;
    display: block;
}

.teaser-caption {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Teaser Diagram - Main diagram display */
.teaser-diagram {
    max-width: 900px;
    margin: 0 auto 1rem;
    text-align: center;
}

.teaser-diagram img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

/* Video Teaser */
.video-teaser {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-teaser video {
    width: 100%;
    display: block;
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section-alt {
    background: var(--bg-light);
}

.section-title {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-description {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

/* Abstract */
.abstract-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2.5rem;
    align-items: start;
}

.abstract-content {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.abstract-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    text-align: justify;
    font-size: 0.95rem;
}

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

.abstract-content strong {
    color: var(--text-primary);
}

.abstract-content .highlight {
    background: rgba(99, 102, 241, 0.1);
    padding: 0 4px;
    border-radius: 4px;
}

/* Abstract Diagram - Smaller diagram in abstract */
.abstract-diagram {
    text-align: center;
}

.abstract-diagram img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.abstract-diagram .figure-caption {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .abstract-grid {
        grid-template-columns: 1fr;
    }
}

/* Contributions */
.contributions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.contribution-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.contribution-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.card-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.contribution-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.contribution-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Demo Section */
.demo-container {
    max-width: 900px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.demo-video {
    width: 100%;
    display: block;
    background: var(--bg-gray);
}

.demo-note {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
}

.demo-note code {
    color: var(--primary);
}

/* Examples Section */
.examples-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.examples-controls label {
    font-weight: 500;
    color: var(--text-primary);
}

.degree-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
}

.degree-select:focus {
    outline: none;
    border-color: var(--primary);
}

.examples-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.examples-container {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 300px;
    box-shadow: var(--shadow-sm);
}

.loading-text {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.example-item {
    margin-bottom: 1.5rem;
}

.example-prompt {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    margin-bottom: 1rem;
}

.example-prompt strong {
    color: var(--primary);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.example-prompt p {
    color: var(--text-primary);
    margin: 0;
}

.example-response {
    background: var(--bg-gray);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
    max-height: 400px;
    overflow-y: auto;
}

.example-response strong {
    color: var(--accent);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.example-response p {
    color: var(--text-secondary);
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.6;
}

.example-perplexity {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.examples-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.nav-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.nav-btn:hover:not(:disabled) {
    background: var(--primary-dark);
}

.nav-btn:disabled {
    background: var(--bg-gray);
    color: var(--text-muted);
    cursor: not-allowed;
}

.example-counter {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Method Section */
.method-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.method-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 3rem;
}

.method-grid.reverse {
    direction: rtl;
}

.method-grid.reverse>* {
    direction: ltr;
}

.method-text h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.method-text p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.method-text ul {
    list-style: none;
    margin-left: 0;
}

.method-text li {
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.method-text li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.method-text li strong {
    color: var(--text-primary);
}

.equation {
    background: var(--bg-light);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    margin: 1rem 0;
    font-family: 'JetBrains Mono', monospace;
}

.method-figure {
    background: var(--bg-white);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.method-figure img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.figure-caption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* Algorithm Box */
.algorithm-box {
    background: var(--bg-white);
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow: hidden;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.algorithm-box h3 {
    background: var(--primary);
    color: white;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
}

.algorithm-content {
    padding: 1.25rem;
    background: var(--bg-light);
}

.algorithm-content pre {
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.8;
    overflow-x: auto;
}

.algorithm-content .keyword {
    color: var(--accent);
    font-weight: 500;
}

.algorithm-content .comment {
    color: var(--text-muted);
    font-style: italic;
}

/* Results Section */
.results-tabs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.625rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tab-content {
    display: none;
}

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

.tab-content h3 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.table-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
}

.results-table th,
.results-table td {
    padding: 0.875rem 1rem;
    text-align: center;
}

.results-table th {
    background: var(--bg-light);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-table td {
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

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

.highlight-cell {
    color: var(--success) !important;
    font-weight: 600;
}

.bad-cell {
    color: var(--error) !important;
}

.baseline-row td {
    background: rgba(99, 102, 241, 0.05);
}

.key-finding {
    background: var(--bg-light);
    border-left: 3px solid var(--primary);
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
}

.key-finding strong {
    color: var(--text-primary);
}

/* Results Figure - Image-based results */
.results-figure {
    max-width: 100%;
    margin: 1.5rem auto;
    text-align: center;
    background: var(--bg-white);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

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

/* Perplexity Stats */
.perplexity-summary {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2.5rem 0;
    flex-wrap: wrap;
}

.perplexity-stat {
    text-align: center;
    padding: 1.5rem 2rem;
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border);
    min-width: 160px;
    box-shadow: var(--shadow-sm);
}

.perplexity-stat.good {
    border-color: var(--success);
}

.perplexity-stat.bad {
    border-color: var(--error);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
}

.perplexity-stat.good .stat-number {
    color: var(--success);
}

.perplexity-stat.bad .stat-number {
    color: var(--error);
}

.stat-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: block;
}

/* Citation */
.bibtex-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.bibtex-code {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.4rem 0.875rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.copy-btn svg {
    width: 14px;
    height: 14px;
}

/* Footer */
.footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-license {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.footer-credit {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 900px) {
    .method-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .method-grid.reverse {
        direction: ltr;
    }
}

@media (max-width: 600px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .authors {
        flex-direction: column;
        gap: 0.25rem;
    }

    .abstract-content {
        padding: 1.25rem;
    }

    .perplexity-summary {
        flex-direction: column;
        align-items: center;
    }

    .teaser-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.hero-content>* {
    animation: fadeInUp 0.5s ease forwards;
}

.hero-title {
    animation-delay: 0.1s;
}

.authors {
    animation-delay: 0.15s;
}

.affiliations {
    animation-delay: 0.2s;
}

.hero-buttons {
    animation-delay: 0.25s;
}

.hero-stats {
    animation-delay: 0.3s;
}