:root {
    --primary: #0055b3;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --accent-green: #10b981;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    line-height: 1.5;
    background: #fff;
    margin: 0;
    padding: 20px;
}

.container { max-width: 1000px; margin: 0 auto; }

/* Metrics Bar */
/* Definitive Metrics Bar Style */
.metrics-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.metrics-left {
    display: flex;
    gap: 40px; /* Generous spacing between h-index and citations */
}

.metric-item {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    font-family: "Inter", sans-serif;
}

.metric-btn-area .btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}

.metric-btn-area .btn-secondary:hover {
    background: #e5e7eb;
}

/* Buttons & Controls */
.btn {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    background: #fff;
    color: var(--text-muted);
    border: 1px solid #e2e8f0;
    cursor: pointer;
}
.btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-secondary { background: #fff; border: 1px solid #e2e8f0; color: var(--text-main); }

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}
.sort-options { display: flex; gap: 8px; }
#pubSearch {
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 220px;
}

/* Alert Box (Confetti handled by JS) */
.new-pub-alert {
    background: #ecfdf5;
    border: 2px solid var(--accent-green);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    position: relative;
}
.new-pub-label {
    display: inline-block;
    background: var(--accent-green);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
}

/* Sections & Entries */
.key-pubs-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}
.key-pubs-header {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.key-pubs-header::before { content: "★"; color: #f59e0b; }

.pub-entry {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}
.featured-entry:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

/* Metadata Badges */
.nature-inline-meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-left: 10px;
    vertical-align: middle;
}
.badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
}
.badge-cite { background: #e0f2fe; color: #0369a1; }
.badge-infl { 
    background: #fef3c7; 
    color: #92400e; 
    display: none; /* JS toggles this */
}
.nature-doi-link {
    text-decoration: none;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 700;
}

.main-footer { text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 0.8rem; }

/* Mobile Optimizations */
/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    /* 1. Metrics Bar: Keep items on one row, button to the right */
    .metrics-bar {
        flex-direction: row !important; /* Force row layout on mobile */
        justify-content: space-between !important;
        align-items: center !important;
        padding: 15px;
        gap: 10px;
    }

    .metrics-left {
        gap: 20px; /* Tighten gap for mobile screens */
    }

    /* Prevent the button from stretching or overflowing */
    .profile-btn {
        flex-shrink: 0; 
        font-size: 0.8rem;
        padding: 6px 10px;
        white-space: nowrap; /* Keep text on one line */
    }

    /* 2. Controls: Align Sort and Search to the left */
    .controls {
        flex-direction: column !important;
        align-items: flex-start !important; /* Left align everything */
        width: 100%;
    }

    .sort-options {
        display: flex;
        justify-content: flex-start !important;
        width: 100%;
        gap: 8px;
    }

    .sort-options .btn {
        flex: 0 1 auto; /* Stop buttons from stretching */
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .search-wrapper {
        width: 100%;
    }

    #pubSearch {
        width: 100%;
        max-width: 100%; /* Respect container boundaries */
        box-sizing: border-box; /* Crucial to prevent overflow */
    }
}
}