* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Roboto, sans-serif; background: #f5f9fc; color: #1e293b; line-height: 1.5; padding: 24px 20px; }
.app-container { max-width: 1400px; margin: 0 auto; }
        
.hero { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 28px; padding: 20px 28px; margin-bottom: 28px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.logo-container { flex: 1; }
.app-logo { max-width: 550px; width: 100%; height: auto; display: block; }
.author-badge { text-align: right; background: #f0f4f8; padding: 3px 16px; border-radius: 60px; border: 1px solid #e2e8f0; }
.author-badge .name { font-size: 0.80rem; font-weight: 500; color: #1e293b; }
.author-badge .name a { color: #48C9B0; text-decoration: none; }
.author-badge .name a:hover { text-decoration: underline; }
        
.search-container { background: white; padding: 12px 28px; border-radius: 24px; margin-bottom: 28px; border: 1px solid #e2e8f0; }
#searchBox { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
#query { flex: 2; padding: 6px 18px; border: 1px solid #cbd5e1; border-radius: 40px; font-size: 0.9rem; }
#query:focus { outline: none; border-color: #48C9B0; box-shadow: 0 0 0 3px rgba(72,201,176,0.1); }
        
button { padding: 6px 20px; border: none; border-radius: 40px; cursor: pointer; font-size: 0.85rem; font-weight: 500; color: white; }
#searchButton { background-color: #48C9B0; }
#searchButton:hover { background-color: #3aa892; transform: translateY(-1px); }
#downloadButton { background-color: #2c3e50; }
#downloadButton:hover:not(:disabled) { background-color: #1a2a3a; transform: translateY(-1px); }
#downloadGEXF { background-color: #34495e; }
#downloadGEXF:hover:not(:disabled) { background-color: #233240; transform: translateY(-1px); }
#centerButton { background-color: #48C9B0; }
#centerButton:hover:not(:disabled) { background-color: #3aa892; transform: translateY(-1px); }
#resetButton { background-color: #e74c3c; }
#resetButton:hover { background-color: #c0392b; transform: translateY(-1px); }
button:disabled { background-color: #cbd5e1; cursor: not-allowed; opacity: 0.6; }
        
.controls { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 15px; margin-top: 10px; }
.control-group { display: flex; gap: 10px; align-items: center; background: #f8fafc; padding: 6px 14px; border-radius: 40px; border: 1px solid #e2e8f0; }
.control-group label { font-weight: 500; color: #334155; font-size: 0.8rem; }
select, input[type="number"] { padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 30px; background: white; font-size: 0.8rem; }
        
input[type="range"] {
    -webkit-appearance: none;
    background: #e2e8f0;
    border-radius: 10px;
    height: 4px;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #48C9B0;
    cursor: pointer;
    border: none;
}
input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #48C9B0;
    cursor: pointer;
    border: none;
}
        
#loading { text-align: center; padding: 40px; display: none; font-size: 1rem; color: #48C9B0; }
#resultsInfo { margin: 16px 0; font-style: italic; color: #475569; text-align: center; }
        
#visualizationContainer { display: flex; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
        
#wordCloudContainer {
    flex: 0.35;
    min-width: 250px;
    max-width: 35%;
    background: white;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 650px;
    overflow-x: hidden;
}

.wordcloud-wrapper {
    width: 100%;
    height: 380px;
    background: #fafcff;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    word-break: break-word;
}
.wordcloud-wrapper span {
    word-break: break-word;
    max-width: 100%;
}
.visualization-title { color: #1e293b; margin-bottom: 16px; text-align: center; font-size: 1.1rem; font-weight: 600; }
.wordcloud-wrapper { 
    width: 100%; 
    height: 380px; 
    background: #fafcff; 
    border-radius: 20px; 
    overflow: hidden;
    position: relative;
}
        
.journals-panel {
    margin-top: 16px;
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.journals-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    text-align: center;
}
.journals-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.journals-list li {
    font-size: 0.75rem;
    padding: 4px 8px;
    color: #334155;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.journal-bullet {
    color: #48C9B0;
    font-size: 0.7rem;
}
        
#semanticNetworkContainer {
    flex: 0.65;
    background: white;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 650px;
    overflow: hidden;
}
.title-with-buttons { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 16px; 
    flex-wrap: wrap; 
    gap: 10px; 
    flex-shrink: 0; 
}
.title-with-buttons h3 { 
    font-size: 1.1rem; 
    font-weight: 600; 
    margin: 0; 
}
.network-buttons { 
    display: flex; 
    gap: 8px; 
    align-items: center;
    flex-wrap: nowrap;
}
.network-buttons button { 
    background-color: #e2e8f0; 
    color: #1e293b; 
    padding: 6px 14px; 
    font-size: 0.75rem; 
    border-radius: 40px; 
    white-space: nowrap;
}
.network-buttons button:hover { 
    background-color: #cbd5e1; 
}
.node-controls-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    padding: 4px 12px;
    border-radius: 40px;
}
.node-controls-inline label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}
.node-controls-inline input {
    width: 90px;
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 30px;
    font-size: 0.7rem;
}
.nodes-slider-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 4px 12px;
    border-radius: 40px;
}
.nodes-slider-inline label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}
.nodes-slider-inline input {
    width: 100px;
}
.nodes-slider-inline span {
    font-size: 0.7rem;
    color: #48C9B0;
    font-weight: 600;
    min-width: 30px;
}
        
#semanticNetwork { 
    width: 100%; 
    flex: 1; 
    min-height: 500px;
    background-color: #ffffff; 
    border: 1px solid #e2e8f0; 
    border-radius: 16px; 
    overflow: visible;
}
        
#articlesTableContainer { background: white; padding: 20px; border-radius: 24px; overflow-x: auto; border: 1px solid #e2e8f0; }
table { width: 100%; border-collapse: collapse; margin-top: 0; font-size: 0.7rem; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
th { background-color: #48C9B0; color: white; font-weight: 600;font-size: 0.9rem;}
tr:hover { background-color: #f0f7fc; }
.pmid-link { color: #48C9B0; text-decoration: none; font-weight: 500; }
.pmid-link:hover { text-decoration: underline; }
.pagination { display: flex; justify-content: center; margin-top: 25px; gap: 10px; }
.pagination button { padding: 8px 16px; background-color: #48C9B0; color: white; border: none; border-radius: 4px; cursor: pointer; transition: all 0.3s; }
.pagination button:hover:not(:disabled) { background-color: #2980b9; transform: translateY(-2px); }
.pagination button:disabled { background-color: #bdc3c7; cursor: not-allowed; opacity: 0.7; }
.pagination span { padding: 8px 16px; align-self: center; color: #555; }
.sortable-header { cursor: pointer; position: relative; padding-right: 20px; }
.sortable-header::after { content: "↑↓"; position: absolute; right: 5px; font-size: 12px; opacity: 0.7; }
.sortable-header.asc::after { content: "↑"; opacity: 1; }
.sortable-header.desc::after { content: "↓"; opacity: 1; }
        
.custom-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 3px solid #dce5ec;
}
.footer-line1 { font-size: 0.90rem; color: #2c6288; margin-bottom: 6px; }
.footer-line1 a { color: #48C9B0; text-decoration: none; font-weight: 500; }
.footer-line1 a:hover { text-decoration: underline; }
.footer-line2 { font-size: 0.70rem; color: #2c3e50; line-height: 1.4; max-width: 900px; margin: 0 auto 12px auto; }
.footer-callout { background: #f0f6ff; border-left: 5px solid #48C9B0; border-radius: 14px; padding: 10px 16px; max-width: 620px; margin: 10px auto 0 auto; text-align: center; }
.callout-text { font-size: 0.75rem; color: #1e4a6e; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.callout-text a { color: #48C9B0; text-decoration: none; border-bottom: 1px dashed #9bc0da; }
.callout-text a:hover { color: #3aa892; border-bottom: 1px solid #3aa892; }
.callout-icon { font-size: 1rem; }
        
.node { stroke: #fff; stroke-width: 1.5px; cursor: pointer; }
.link { stroke-opacity: 0.6; stroke: #94a3b8; }
.node text { pointer-events: none; }
        
.node-selected {
    stroke: #000 !important;
    stroke-width: 3px !important;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.3));
}
.node-neighbor {
    stroke: #48C9B0 !important;
    stroke-width: 2.5px !important;
}
        
@media (max-width: 1100px) {
    .network-buttons { flex-wrap: wrap; }
}
@media (max-width: 900px) { 
    #visualizationContainer { flex-direction: column; }
    .title-with-buttons { flex-direction: column; align-items: stretch; }
    .network-buttons { justify-content: center; flex-wrap: wrap; }
}
@media (max-width: 700px) { 
    body { padding: 16px; } 
    .hero { flex-direction: column; align-items: center; text-align: center; } 
    .app-logo { max-width: 280px; } 
    #searchBox { flex-direction: column; } 
    button { padding: 8px 16px; }
}

#wordCloudContainer {
    min-width: 250px;
    max-width: 35%;
    overflow-x: hidden;
}
.wordcloud-wrapper span {
    word-break: break-word;
    max-width: 100%;
}
        
#articlesTableContainer {
    padding-bottom: 25px;
}
.pagination {
    margin-top: 14px;
    margin-bottom: 0;
}
.custom-footer {
    margin-top: 45px;
    padding-top: 0;
}