:root {
    --imp-high: #FC3D21;
    --imp-med: #005DAB;
    --imp-low: #A7A9AC;
    --bg-dark: #050505;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-dark);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow: hidden;
    color: white;
}

#map {
    height: calc(110vh - 40px);
    width: 100%;
    background: #e6e6e6;
}

.leaflet-tile-pane {
    filter: grayscale(100%) brightness(105%);
}

.section-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 13000;
    background: rgba(9, 9, 9, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-tab {
    padding: 1rem 1.5rem;
    font-size: 8px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #6a6860;
    cursor: pointer;
    border: none;
    background: none;
    border-right: 1px solid #252520;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.nav-tab:hover,
.nav-tab.active {
    background: rgba(200, 192, 168, 0.04);
    color: white;
}


.site-title {
    font-weight: 600;
    letter-spacing: 2px;
    margin-left: 25px;
    color: #e0e0e0;
    text-transform: none;
}

#lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 20000;
    cursor: zoom-out;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#lightbox img {
    max-width: 95%;
    max-height: 95%;
    border: 1px solid #444;
}


.popup-img-container {
    position: relative; 
    width: 100%;
    height: 110px;
    overflow: hidden;
    margin-top: 8px;
    border: 1px solid #333;
    background: #bdbdbd;
    cursor: pointer;
}

.popup-img-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

.popup-view-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: none;
    background-color: rgba(0, 0, 0, 0.5); 
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; 
}

.popup-img-container:hover img {
    opacity: 0.8; 
}

.popup-img-container:hover .popup-view-overlay {
    opacity: 1; 
}

.popup-btns {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.popup-select-btn {
    width: 100%;
    background: #005DAB;
    color: #ffffff;
    border: none;
    letter-spacing: 0.5px;
    padding: 8px;
    font-size: 10px; 
    font-weight: bold;
    text-transform: none;
    cursor: pointer;
    transition: all 0.2s;
}

.popup-select-btn:hover {
    background: #003e71;
}

.popup-select-btn.is-remove {
    background: var(--imp-high);
    color: #fff;
    border-color: var(--imp-high);
}


#comparison-overlay,
#detail-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(230, 230, 230, 0.98);
    backdrop-filter: blur(12px);
    align-items: flex-start;
    justify-content: center;
    z-index: 12000;
    animation: fadeIn 0.4s ease;
    overflow-y: auto;
    padding: 60px 0;
}

.comparison-container {
    display: flex;
    align-items: stretch;
    width: 94%;
    max-width: 1050px;
    position: relative;
}

.newspaper-card {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    margin: 0 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    max-height: 90vh;
}

.card-header {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    background: #222;
    border-bottom: 1px solid #333;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.journal-name {
    font-weight: 600;
    font-size: 15px;
    color: #fff;
}

.image-box {
    height: 53vh;
    min-height: 200px;
    background: #C1C1C1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid #333;
    overflow-y: auto;
}

.image-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    cursor: pointer;
}

.card-footer {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #333;
    overflow: hidden;
}

.footer-label {
    padding: 8px 25px 8px 10px;
    font-size: 12px;
    font-weight: 800;
    text-transform: none;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    background: #222;
    color: #fff;
}

.footer-scroll-area {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

.footer-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    font-weight: 400;
    margin-bottom: 15px;
}

.footer-desc strong {
    color: #222;
    text-transform: none;
    font-size: 13px;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.footer-scroll-area::-webkit-scrollbar,
.image-box::-webkit-scrollbar {
    width: 6px;
}

.footer-scroll-area::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.footer-scroll-area::-webkit-scrollbar-thumb,
.image-box::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.footer-scroll-area::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.vs-divider {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.vs-circle {
    width: 38px;
    height: 38px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 11px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.close-btn {
    position: fixed;
    top: 60px;
    right: 40px;
    background: rgba(230, 230, 230, 0.8);
    border: 1px solid #252520;
    padding: 10px 20px;
    color: #333;
    cursor: pointer;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
    z-index: 12001;
    transition: all 0.3s;
}

.close-btn:hover {
    background: #cdcdcd;
    color: #000;
    border-color: #000;
}

.leaflet-popup-content-wrapper {
    background: #111;
    color: white;
    border-radius: 0;
    border: 1px solid #444;
}

.leaflet-popup-tip {
    background: #111;
}

#archive-view,
#sources-view {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #e6e6e6;
    z-index: 9000;
    overflow-y: auto;
    padding: 40px 0 40px;
    box-sizing: border-box;
}

.continent-block {
    margin-bottom: 60px;
    padding: 0 9%;
}

.continent-title {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 3px;
    color: #333;
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 25px;
    text-transform: none;
}

.country-block {
    margin-bottom: 30px;
}

.country-title {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    margin-bottom: 15px;
    text-transform: none;
    letter-spacing: 1.5px;
    border-left: 2px solid #ccc;
    padding-left: 10px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 20px 15px;
    align-items: start;
}

.grid-item {
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.grid-item:hover {
    transform: translateY(-8px);
}

.grid-item.selected .grid-img-wrapper {
    border: 3px solid #0055a0;
}

.grid-img-wrapper {
    width: 100%;
    overflow: hidden;
    background: #f0f0f0;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.grid-img-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%);
    transition: all 0.5s ease;
}

.grid-item:hover .grid-img-wrapper img {
    filter: grayscale(0%);
}

.grid-info {
    width: 100%;
    padding: 0 10px;
    text-align: left;
}

.grid-city {
    font-weight: 400;
    font-size: 10px;
    color: #70757a;
    margin-bottom: 2px;
    line-height: 1.2;
}

.grid-journal {
    font-weight: 600;
    font-size: 12px;
    color: #202124;
}

.archive-toolbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #e6e6e6;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 40px 9% 15px;
    margin-bottom: 25px;
    border-bottom: none;
}

.archive-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-label {
    font-size: 12px;
    font-weight: 700;
    color: #454545;
    text-transform: none;
}

.importance-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border: 1px solid #252520;
    color: #454545;
    padding: 8px 16px;
    font-size: 9px;
    font-weight: 600;
    text-transform: none;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    background: #dddddd;
    color: #000;
}

.filter-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

.archive-compare-button.active {
    background: #0026ff;
    border-color: #0026ff;
    color: #fff;
}

#map-legend {
    position: fixed;
    bottom: 30px;
    left: 142px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    padding: 12px 15px;
    border: 1px solid #252520;
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 6px;
}

.legend-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 1.5px;
    color: #454545;
    margin-bottom: 2px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #333;
    font-weight: 600;
    text-transform: none;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-note {
    margin-top: 4px;
    font-size: 10px;
    color: #666;
    font-style: italic;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 6px;
    max-width: 180px;
    line-height: 1.2;
}

#left-controls-container {
    position: fixed;
    bottom: 30px;
    left: 25px;
    z-index: 11000;
    display: flex;
    align-items: center;
    gap: 10px;
}

#legend-btn,
#purpose-btn {
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
}

#purpose-btn {
    height: 35px;
    padding: 0 20px;
    font-size: 9px;
    background: #414141;
    color: #fff;
    border: none;
    transition: all 0.2s;
}

#legend-btn {
    height: 35px;
    width: 35px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border: 1px solid #252520;
    color: #454545;
    transition: all 0.3s;
}

#legend-btn:hover {
    background: #dddddd;
    color: #000;
}

#purpose-btn:hover {
    background: #1e1e1e;
    color: #fff;
}

#purpose-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 25000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

#purpose-modal {
    background: #fff;
    color: #333;
    padding: 30px 40px;
    max-width: 550px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#purpose-modal h2 {
    margin-top: 0;
    font-size: 16px;
    letter-spacing: 2px;
    text-transform: none;
}

#purpose-modal p {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
}

.close-purpose-btn {
    display: block;
    margin-top: 25px;
    margin-left: auto;
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 25px;
    cursor: pointer;
    text-transform: none;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
    transition: background 0.2s;
}

.close-purpose-btn:hover {
    background: #000;
}

#sources-view .continent-title {
    padding-top: 40px;
}

#sources-view ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sources-view li {
    color: #444;
    font-size: 12px;
    padding: 20px 0;
    border-bottom: 1px solid #ccc;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-all;
}

#sources-view li:last-child {
    border-bottom: none;
}

#sources-view li a {
    color: #000;
    line-height: 1.5;
}

#sources-modal li a {
    color: inherit;
    text-decoration: underline;
    transition: opacity 0.2s;
}

#sources-modal li a:hover {
    opacity: 0.7;
}

.close-sources-btn {
    display: block;
    margin-top: 25px;
    margin-left: auto;
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 25px;
    cursor: pointer;
    text-transform: none;
    font-size: 11px;
    transition: background 0.2s;
}

#sources-modal .close-sources-btn:hover {
    background: #000;
}

#compare-select-container {
    position: fixed;
    bottom: 30px;
    right: 25px;
    z-index: 11000;
    display: flex;
    align-items: flex-end;
    flex-direction: row-reverse;
    gap: 10px;
}

#compare-select-btn {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border: 1px solid #252520;
    color: #454545;
    padding: 10px 20px;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: none;
    cursor: pointer;
    transition: all 0.3s;
}

#compare-select-btn:hover {
    background: #dddddd;
    color: #000;
    border-color: #000000;
}

#compare-preview-area {
    display: none;
    gap: 5px;
    height: auto;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(37, 37, 32, 0.3);
    padding: 5px;
    align-items: center;
}

.compare-preview-slot {
    width: 100px;
    height: 140px;
    background-color: rgba(255, 255, 255, 0.01);
    border: 1px dashed rgba(37, 37, 32, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.compare-preview-slot::before {
    content: '+';
    font-size: 24px;
    color: rgba(37, 37, 32, 0.3);
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.compare-preview-slot:not(:empty)::before {
    display: none;
}

.compare-preview-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: relative;
    z-index: 2;
}

.compare-preview-slot .newspaper-name-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 9px;
    text-align: center;
    padding: 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 3;
}

.remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #252520;
    color: #000;
    border-radius: 50%;
    font-size: 12px;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    padding: 0;
}

.remove-btn:hover {
    background: #000000;
    color: #fff;
}

.compare-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.compare-hint {
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin-top: 10px;
    display: block;
}

#start-compare-btn {
    background: #bbb;
    color: #fff;
    border: none; 
    padding: 10px 20px;
    font-size: 9px;
    letter-spacing: 1px;
    font-weight: bold;
    cursor: not-allowed;
    opacity: 0.5;
    transition: all 0.2s;
}

#start-compare-btn.enabled {
    background: #1e1e1e;
    cursor: pointer;
    opacity: 1;
    color: #fff;
}

#start-compare-btn.enabled:hover {
    background: #414141;
}

#cancel-compare-btn {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border: 1px solid #252520;
    color: #454545;
    padding: 10px 20px;
    font-size: 9px;
    letter-spacing: 1px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

#cancel-compare-btn:hover {
    background: #dddddd;
    color: #000;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
