/* World Map Section */
.world-map-section {
    padding: 60px 0;
    min-height: 80vh;
}

.world-map-section .section-heading {
    text-align: center;
    margin-bottom: 40px;
}

.world-map-section .section-heading h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #f5f5f7;
}

.world-map-container {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Legacy support for non-fullscreen mode */
.maps-fullscreen-section .world-map-container {
    gap: 0;
}

@media (min-width: 1200px) {
    .maps-fullscreen-section .world-map-container {
        padding: 0;
    }
}

.country-count {
    display: none;
}

.world-map-wrapper {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.world-map-svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
    pointer-events: bounding-box;
    object-fit: contain;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    
}

.country {
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.9;
    pointer-events: all;
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1;
}
path {
    fill: #808080;
}

/* Countries with tags - blue (default) */
.country[data-has-tags="true"],
.country:not([data-has-tags]) {
    fill: #4a90e2;
}

/* Countries without tags - gray */
.country[data-has-tags="false"] {
    fill: #808080;
}

.country:hover {
    opacity: 1;
    filter: brightness(1.3);
    stroke-width: 2;
    stroke: rgba(255, 255, 255, 0.6);
}

.country.active {
    opacity: 1;
    filter: brightness(1.4);
    stroke-width: 3;
    stroke: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Article counts on countries */
.country-count {
    font-size: 12px;
    font-weight: 700;
    fill: #ffffff;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 0 4px rgba(0, 0, 0, 0.5);
    font-family: 'Gantari', sans-serif;
}

@media (min-width: 768px) {
    .country-count {
        font-size: 14px;
    }
}

@media (min-width: 1024px) {
    .country-count {
        font-size: 16px;
    }
}

/* Custom tooltip */
.world-map-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: #f5f5f7;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transform: translate(-50%, -100%) translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.world-map-tooltip.show {
    opacity: 1;
    transform: translate(-50%, -100%) translateY(-5px);
}

.world-map-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* Country Info Panel */
.country-info {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 400px;
    max-width: calc(100% - 40px);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: calc(100vh - 160px); /* Restar altura del header + padding */
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.country-info h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #f5f5f7;
    padding-right: 40px;
}

.country-articles {
    margin-top: 20px;
}

.country-articles .loading {
    text-align: center;
    padding: 40px 20px;
    color: rgba(245, 245, 247, 0.6);
}

.country-articles .no-articles {
    text-align: center;
    padding: 40px 20px;
    color: rgba(245, 245, 247, 0.6);
}

/* Country Tags List */
.country-tags-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.country-tag-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.country-tag-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.country-tag-item__link {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.country-tag-item__logo {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.country-tag-item__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.country-tag-item__logo--placeholder {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(245, 245, 247, 0.8);
    background: rgba(255, 255, 255, 0.1);
}

.country-tag-item__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.country-tag-item__name {
    font-size: 1rem;
    font-weight: 600;
    color: #f5f5f7;
    line-height: 1.4;
}

.country-tag-item__count {
    font-size: 0.85rem;
    color: rgba(245, 245, 247, 0.7);
    font-weight: 400;
}

.world-map-section .close-info {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #f5f5f7;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.world-map-section .close-info:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Map Toggle Button */
.map-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.8);
    color: #f5f5f7;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-family: 'Gantari', sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    min-width: 120px;
}

.map-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
}

.map-toggle-btn:active {
    transform: translateY(0);
}

.toggle-btn-text {
    display: inline-block;
}

/* Responsive */
@media (max-width: 968px) {
    .world-map-container {
        flex-direction: column;
    }
    
    .country-info {
        position: absolute;
        top: 10px;
        right: 10px;
        width: calc(100% - 20px);
        max-width: none;
        max-height: calc(100vh - 140px); /* Restar altura del header + padding */
    }
    
    .world-map-section .section-heading h1 {
        font-size: 2rem;
    }
    
    .map-toggle-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 24px;
        font-size: 0.9rem;
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .world-map-section {
        padding: 40px 0;
    }
    
    .world-map-wrapper {
        padding: 10px;
        /* Mejorar experiencia táctil en móvil */
        touch-action: pan-x pan-y pinch-zoom;
        -webkit-overflow-scrolling: touch;
    }
    
    .world-map-svg {
        /* Permitir interacciones táctiles */
        touch-action: pan-x pan-y pinch-zoom;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    .country-info {
        padding: 20px;
        top: 10px;
        right: 10px;
        width: calc(100% - 20px);
    }
    
    .country-info h2 {
        font-size: 1.5rem;
    }
    
    .map-toggle-btn {
        bottom: 15px;
        right: 15px;
        padding: 10px 20px;
        font-size: 0.85rem;
        min-width: 90px;
    }
}

/* Zoom Controls - shared styles */
.map-zoom-controls {
    position: fixed;
    bottom: 30px;
    left: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1001;
}

.zoom-btn {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
    color: #f5f5f7;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    padding: 0;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

@media (max-width: 968px) {
    .map-zoom-controls {
        bottom: 20px;
        left: 20px;
        gap: 10px;
    }
    
    .zoom-btn {
        width: 45px;
        height: 45px;
    }
    
    .zoom-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 768px) {
    .map-zoom-controls {
        bottom: 15px;
        left: 15px;
        gap: 8px;
    }
    
    .zoom-btn {
        width: 40px;
        height: 40px;
    }
    
    .zoom-btn svg {
        width: 18px;
        height: 18px;
    }
}
